|
@@ -44,7 +44,9 @@ export class Sidebar extends React.Component {
|
|
|
|
|
|
render() {
|
|
|
|
|
|
- const { showSidebar, showSidebarFlag } = this.props;
|
|
|
+ const { showSidebar, showSidebarFlag } = this.props;
|
|
|
+ const role = localStorage.user && JSON.parse(localStorage.user).user.role;
|
|
|
+
|
|
|
return (
|
|
|
<div className={ !showSidebarFlag ? 'menu close' : 'menu' }>
|
|
|
<nav>
|
|
@@ -55,7 +57,7 @@ export class Sidebar extends React.Component {
|
|
|
</div>
|
|
|
<ul>
|
|
|
{
|
|
|
- localStorage.user && <li><Link to="/profile">Profile</Link></li>
|
|
|
+ role && <li><Link to="/profile">Profile</Link></li>
|
|
|
}
|
|
|
|
|
|
{
|
|
@@ -66,10 +68,10 @@ export class Sidebar extends React.Component {
|
|
|
)
|
|
|
}
|
|
|
{
|
|
|
- !localStorage.user && <li><Link to="/login">Login</Link></li>
|
|
|
+ !role && <li><Link to="/login">Login</Link></li>
|
|
|
}
|
|
|
{
|
|
|
- localStorage.user && <li>
|
|
|
+ role && <li>
|
|
|
<button className="logout" onClick={this.logoutHandler}>
|
|
|
<i className="fa fa-sign-out"></i>
|
|
|
</button>
|