2019-07-30 16:25:01 +01:00
|
|
|
import React, { Component } from "react";
|
2020-01-29 12:31:19 +00:00
|
|
|
import { Route, Link, Switch } from "react-router-dom";
|
|
|
|
import { Paper, Tabs, Tab} from '@material-ui/core';
|
2019-07-30 16:25:01 +01:00
|
|
|
|
2019-07-31 12:24:10 +01:00
|
|
|
import ChangePassword from "./ChangePassword.js";
|
|
|
|
import SpotifyLink from "./SpotifyLink.js";
|
2019-10-19 17:57:56 +01:00
|
|
|
import LastFM from "./LastFM.js";
|
2019-07-30 16:25:01 +01:00
|
|
|
|
|
|
|
class Settings extends Component {
|
|
|
|
|
2020-01-29 12:31:19 +00:00
|
|
|
constructor(props){
|
|
|
|
super(props);
|
|
|
|
this.state = {
|
|
|
|
tab: 0
|
|
|
|
}
|
|
|
|
this.handleChange = this.handleChange.bind(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
handleChange(e, newValue){
|
|
|
|
this.setState({
|
|
|
|
tab: newValue
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2019-07-30 16:25:01 +01:00
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div>
|
2020-01-29 12:31:19 +00:00
|
|
|
<Paper>
|
|
|
|
<Tabs
|
|
|
|
value={this.state.tab}
|
|
|
|
onChange={this.handleChange}
|
|
|
|
indicatorColor="primary"
|
|
|
|
centered
|
|
|
|
width="50%"
|
|
|
|
>
|
|
|
|
<Tab label="Password" component={Link} to={`${this.props.match.url}/password`} />
|
|
|
|
<Tab label="Spotify" component={Link} to={`${this.props.match.url}/spotify`} />
|
|
|
|
<Tab label="Last.fm" component={Link} to={`${this.props.match.url}/lastfm`} />
|
|
|
|
</Tabs>
|
|
|
|
</Paper>
|
|
|
|
<Switch>
|
|
|
|
<Route path={`${this.props.match.url}/password`} component={ChangePassword} />
|
|
|
|
<Route path={`${this.props.match.url}/spotify`} component={SpotifyLink} />
|
|
|
|
<Route path={`${this.props.match.url}/lastfm`} component={LastFM} />
|
|
|
|
</Switch>
|
2019-07-30 16:25:01 +01:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default Settings;
|