Files
OpenMediaCenter/src/pages/SettingsPage/SettingsPage.js
T

55 lines
1.8 KiB
JavaScript
Raw Normal View History

2020-06-04 22:19:18 +02:00
import React from "react";
import MovieSettings from "./MovieSettings";
import GeneralSettings from "./GeneralSettings";
2020-07-08 19:33:23 +02:00
import style from "./SettingsPage.module.css"
import GlobalInfos from "../../GlobalInfos";
2020-06-04 22:19:18 +02:00
class SettingsPage extends React.Component {
constructor(props, context) {
super(props, context);
2020-06-04 22:19:18 +02:00
this.state = {
currentpage: "general"
2020-06-04 22:19:18 +02:00
};
}
getContent() {
switch (this.state.currentpage) {
case "general":
return <GeneralSettings/>;
case "movies":
return <MovieSettings/>;
case "tv":
2020-06-29 21:34:43 +02:00
return <span/>; // todo this page
default:
return "unknown button clicked";
2020-06-04 22:19:18 +02:00
}
}
render() {
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>
<div onClick={() => this.setState({currentpage: "general"})}
2020-07-08 19:33:23 +02:00
className={style.SettingSidebarElement}>General
</div>
<div onClick={() => this.setState({currentpage: "movies"})}
2020-07-08 19:33:23 +02:00
className={style.SettingSidebarElement}>Movies
</div>
<div onClick={() => this.setState({currentpage: "tv"})}
2020-07-08 19:33:23 +02:00
className={style.SettingSidebarElement}>TV Shows
</div>
</div>
2020-07-08 19:33:23 +02:00
<div className={style.SettingsContent}>
{this.getContent()}
</div>
2020-06-04 22:19:18 +02:00
</div>
);
}
}
export default SettingsPage;