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";
|
|
|
|
import "./SettingsPage.css"
|
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-06-25 22:43:26 +02:00
|
|
|
getContent() {
|
|
|
|
switch (this.state.currentpage) {
|
|
|
|
case "general":
|
|
|
|
return <GeneralSettings/>;
|
|
|
|
case "movies":
|
|
|
|
return <MovieSettings/>;
|
|
|
|
default:
|
|
|
|
return "unknown button clicked";
|
2020-06-04 22:19:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div>
|
2020-06-25 22:43:26 +02:00
|
|
|
<div className='SettingsSidebar'>
|
|
|
|
<div className='SettingsSidebarTitle'>Settings</div>
|
|
|
|
<div onClick={() => this.setState({currentpage: "general"})}
|
|
|
|
className='SettingSidebarElement'>General
|
|
|
|
</div>
|
|
|
|
<div onClick={() => this.setState({currentpage: "movies"})}
|
|
|
|
className='SettingSidebarElement'>Movies
|
|
|
|
</div>
|
|
|
|
<div onClick={() => this.setState({currentpage: "tv"})}
|
|
|
|
className='SettingSidebarElement'>TV Shows
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className='SettingsContent'>
|
|
|
|
{this.getContent()}
|
|
|
|
</div>
|
2020-06-04 22:19:18 +02:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default SettingsPage;
|