2020-06-04 22:19:18 +02:00
|
|
|
import React from "react";
|
2020-06-25 22:43:26 +02:00
|
|
|
import MovieSettings from "./MovieSettings";
|
|
|
|
import GeneralSettings from "./GeneralSettings";
|
2020-07-08 19:33:23 +02:00
|
|
|
import style from "./SettingsPage.module.css"
|
2020-08-05 22:00:55 +02:00
|
|
|
import GlobalInfos from "../../GlobalInfos";
|
2020-06-04 22:19:18 +02:00
|
|
|
|
2020-08-12 17:50:25 +00:00
|
|
|
/**
|
|
|
|
* The Settingspage handles all kinds of settings for the mediacenter
|
|
|
|
* and is basically a wrapper for child-tabs
|
|
|
|
*/
|
2020-06-04 22:19:18 +02:00
|
|
|
class SettingsPage extends React.Component {
|
|
|
|
constructor(props, context) {
|
|
|
|
super(props, context);
|
2020-06-25 22:43:26 +02:00
|
|
|
|
2020-06-04 22:19:18 +02:00
|
|
|
this.state = {
|
2020-06-25 22:43:26 +02:00
|
|
|
currentpage: "general"
|
2020-06-04 22:19:18 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-08-12 17:50:25 +00:00
|
|
|
/**
|
|
|
|
* load the selected tab
|
|
|
|
* @returns {JSX.Element|string} the jsx element of the selected tab
|
|
|
|
*/
|
2020-06-25 22:43:26 +02:00
|
|
|
getContent() {
|
|
|
|
switch (this.state.currentpage) {
|
|
|
|
case "general":
|
|
|
|
return <GeneralSettings/>;
|
|
|
|
case "movies":
|
|
|
|
return <MovieSettings/>;
|
2020-06-29 19:55:40 +02:00
|
|
|
case "tv":
|
2020-06-29 21:34:43 +02:00
|
|
|
return <span/>; // todo this page
|
2020-06-25 22:43:26 +02:00
|
|
|
default:
|
|
|
|
return "unknown button clicked";
|
2020-06-04 22:19:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2020-08-05 22:00:55 +02:00
|
|
|
const themestyle = GlobalInfos.getThemeStyle();
|
2020-06-04 22:19:18 +02:00
|
|
|
return (
|
|
|
|
<div>
|
2020-08-04 18:53:11 +02:00
|
|
|
<div className={style.SettingsSidebar + ' ' + themestyle.secbackground}>
|
|
|
|
<div className={style.SettingsSidebarTitle + ' ' + themestyle.lighttextcolor}>Settings</div>
|
2020-06-25 22:43:26 +02:00
|
|
|
<div onClick={() => this.setState({currentpage: "general"})}
|
2020-07-08 19:33:23 +02:00
|
|
|
className={style.SettingSidebarElement}>General
|
2020-06-25 22:43:26 +02:00
|
|
|
</div>
|
|
|
|
<div onClick={() => this.setState({currentpage: "movies"})}
|
2020-07-08 19:33:23 +02:00
|
|
|
className={style.SettingSidebarElement}>Movies
|
2020-06-25 22:43:26 +02:00
|
|
|
</div>
|
|
|
|
<div onClick={() => this.setState({currentpage: "tv"})}
|
2020-07-08 19:33:23 +02:00
|
|
|
className={style.SettingSidebarElement}>TV Shows
|
2020-06-25 22:43:26 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-07-08 19:33:23 +02:00
|
|
|
<div className={style.SettingsContent}>
|
2020-06-25 22:43:26 +02:00
|
|
|
{this.getContent()}
|
|
|
|
</div>
|
2020-06-04 22:19:18 +02:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default SettingsPage;
|