Skip to content

Commit

Permalink
add logout link
Browse files Browse the repository at this point in the history
  • Loading branch information
damikael committed Aug 20, 2020
1 parent c622db4 commit bb3d72a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
17 changes: 10 additions & 7 deletions spid-validator/client/src/components/Sidebar/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,17 @@ class Sidebar extends Component {
const url = item.url ? item.url : '';
return (
<NavItem key={key} className={classes.item}>
{ isExternal(url) ?
<RsNavLink href={url} className={classes.link} active>
<i className={classes.icon}></i>{item.name}{badge(item.badge)}
</RsNavLink>
{
url=='logout' ?
<a href="/logout" className={classes.link}><i className={classes.icon}></i>{item.name}{badge(item.badge)}</a>
:isExternal(url) ?
<RsNavLink href={url} className={classes.link} active>
<i className={classes.icon}></i>{item.name}{badge(item.badge)}
</RsNavLink>
:
<NavLink to={url} className={classes.link} activeClassName="active" onClick={this.hideMobile}>
<i className={classes.icon}></i>{item.name}{badge(item.badge)}
</NavLink>
<NavLink to={url} className={classes.link} activeClassName="active" onClick={this.hideMobile}>
<i className={classes.icon}></i>{item.name}{badge(item.badge)}
</NavLink>
}
</NavItem>
)
Expand Down
6 changes: 6 additions & 0 deletions spid-validator/client/src/components/Sidebar/_nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,11 @@ export default {
{ name: 'Report', url: '/response-report' },
]
},
{
name: 'Logout',
icon: 'icon-logout',
sessionRequired: false,
url: 'logout'
}
]
};
2 changes: 1 addition & 1 deletion spid-validator/client/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ReactDOM.render((
<Route path="/response-report" component={Main}/>
<Route path="/worksave" component={Empty}/>
<Route path="/login" component={Empty}/>
<Route path="/" name="Home" component={Empty}/>
<Route path="/" name="Home" component={Empty}/>
</Switch>
</HashRouter>
), document.getElementById('root'));

0 comments on commit bb3d72a

Please sign in to comment.