|
@@ -33,8 +33,15 @@ const siteMenu = [
|
|
|
];
|
|
|
|
|
|
export class Sidebar extends React.Component {
|
|
|
+ // const {history} = this.props;
|
|
|
+
|
|
|
+ logout(e) {
|
|
|
+ localStorage.removeItem('showProfile');
|
|
|
+ }
|
|
|
+
|
|
|
render() {
|
|
|
- const { showProfile } = this.props;
|
|
|
+ console.log(this.props)
|
|
|
+ //const { showProfile } = this.props;
|
|
|
return (
|
|
|
<div className="menu">
|
|
|
<nav>
|
|
@@ -45,7 +52,7 @@ export class Sidebar extends React.Component {
|
|
|
</div>
|
|
|
<ul>
|
|
|
{
|
|
|
- showProfile && <li><Link to="/profile">Profile</Link></li>
|
|
|
+ localStorage.showProfile && <li><Link to="/profile">Profile</Link></li>
|
|
|
}
|
|
|
|
|
|
{
|
|
@@ -56,10 +63,10 @@ export class Sidebar extends React.Component {
|
|
|
)
|
|
|
}
|
|
|
{
|
|
|
- !showProfile && <li><Link to="/login">Login</Link></li>
|
|
|
+ !localStorage.showProfile && <li><Link to="/login">Login</Link></li>
|
|
|
}
|
|
|
- {
|
|
|
- showProfile && <li><button>Logout</button></li>
|
|
|
+ {
|
|
|
+ localStorage.showProfile && <li><button onClick={this.logout}>Logout</button></li>
|
|
|
}
|
|
|
|
|
|
</ul>
|