Moved most of the sidebar into a CommonLinks panel

This commit is contained in:
2019-05-24 09:30:02 +10:00
parent 936fe9f2f5
commit 4fe34a62e8
5 changed files with 52 additions and 38 deletions
+37
View File
@@ -0,0 +1,37 @@
import React from 'react';
import { withRouter, Link } from 'react-router-dom';
import Logout from './logout.jsx';
class CommonLinks extends React.Component {
constructor(props) {
super(props);
this.state = {
//
}
}
render() {
let Extra;
if (this.props.extra) {
Extra = this.props.extra;
} else {
Extra = () => null;
}
return (
<div className='panel'>
<p>Return <Link to='/' onClick={this.props.onClickHome}>home</Link></p>
<p>Go to <Link to='/profile' onClick={this.props.onClickProfile}>your profile</Link></p>
<p>Go to <Link to='/ladder' onClick={this.props.onClickLadder}>the game ladder</Link></p>
<Extra />
<Logout onClick={() => this.props.history.push('/')} />
</div>
);
}
}
export default withRouter(CommonLinks);