Skip to content

Commit

Permalink
Fixed navbar and some other issues
Browse files Browse the repository at this point in the history
  • Loading branch information
elevenpassin committed Dec 26, 2017
1 parent c2df622 commit 311ff6c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
9 changes: 6 additions & 3 deletions client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ import './App.css';

import { Route } from 'react-router-dom';

import Account from './pages/Account.jsx';

// Components
import Blogposts from './components/Blogposts.jsx';
import Navbar from './components/Navbar.jsx';

// Pages
import Signin from './pages/Signin.jsx';
import Dashboard from './pages/Dashboard.jsx';

class App extends Component {
constructor(props) {
super(props);
Expand All @@ -36,7 +39,7 @@ class App extends Component {
</header>
<Route exact path="/" component={Blogposts} />
<Route exact path="/account" render={(props) => (
this.state.auth === false ? <Account setAuth={this.setAuth} {...props} /> : null
this.state.auth === false ? <Signin setAuth={this.setAuth} {...props} /> : <Dashboard />
)} />
</div>
);
Expand Down
7 changes: 6 additions & 1 deletion client/src/components/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ export default class Navbar extends Component {
if (e.key === "signout") {
this.props.setAuth(false);
this.props.history.push('/');
this.setState({ current: '/' });
} else {
this.setState({ current: e.key });
}
this.setState({ current: e.key });

}

render() {
Expand Down Expand Up @@ -52,7 +55,9 @@ export default class Navbar extends Component {
</Link>
</Menu.Item>
<Menu.Item key="signout" >
<Link to={"/"}>
Sign out
</Link>
</Menu.Item>
</SubMenu>
) : (
Expand Down
11 changes: 11 additions & 0 deletions client/src/pages/Dashboard.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React, { Component } from 'react'

export default class Dashboard extends Component {
render() {
return (
<div>
Dashboard goes here
</div>
)
}
}
File renamed without changes.

0 comments on commit 311ff6c

Please sign in to comment.