Adding logout option.

merge-requests/7/head
sinthuja 7 years ago
parent 362a2d1d32
commit 596b25a5ab

@ -63,7 +63,7 @@ class Base extends Component {
} }
render() { render() {
console.log('came here/////'); console.log('came to base ../////');
if (this.state.user !== null) { if (this.state.user !== null) {
return ( return (
<div> <div>
@ -107,12 +107,13 @@ class Store extends Component {
} }
render() { render() {
console.log('came to store');
return ( return (
<div className="App"> <div className="App">
<Router basename="store" history={history}> <Router basename="store" history={history}>
<Switch> <Switch>
<Route path="/login" component={Login}/> <Route exact path="/login" component={Login}/>
<Route path="/logout" component={Login}/> <Route exact path="/logout" component={Login}/>
<Route component={Base}/> <Route component={Base}/>
</Switch> </Switch>
</Router> </Router>

@ -43,7 +43,7 @@ class UserOptions extends Component {
if (this.state.user) { if (this.state.user) {
return ( return (
<div id='user-options-drop-down' className="dropdown-content" style={{display: displayOptions}}> <div id='user-options-drop-down' className="dropdown-content" style={{display: displayOptions}}>
<a href="#">Logout</a> <a href="/store/logout">Logout</a>
</div> </div>
); );
} else { } else {

Loading…
Cancel
Save