diff -r aecde527900a -r 14989b339e5d client/src/components/Navbar.js
--- a/client/src/components/Navbar.js Tue Jun 20 17:54:02 2017 +0200
+++ b/client/src/components/Navbar.js Tue Jun 20 19:04:42 2017 +0200
@@ -6,6 +6,37 @@
import { Navbar, Nav, NavItem, NavDropdown, MenuItem } from 'react-bootstrap';
import * as authActions from '../actions/authActions';
+const LoginNav = ({isAuthenticated, currentUser, history, authActions}) => {
+
+ const onClickSettings = (e) => {
+ e.preventDefault();
+ history.push('/settings');
+ }
+
+ const onClickLogout = (e) => {
+ e.preventDefault();
+ authActions.logout();
+ }
+
+ const onClickLogin = (e) => {
+ e.preventDefault();
+ history.push('/login');
+ }
+
+
+ if (isAuthenticated) {
+ return (
+
+
+
+
+ );
+ }
+ return (
+ Login
+ );
+}
+
class AppNavbar extends Component {
onClickHome = (e) => {
@@ -18,37 +49,6 @@
this.props.history.push('/sessions');
}
- onClickLogin = (e) => {
- e.preventDefault();
- this.props.history.push('/login');
- }
-
- onClickSettings = (e) => {
- e.preventDefault();
- this.props.history.push('/settings');
- }
-
- onClickLogout = (e) => {
- e.preventDefault();
- this.props.authActions.logout();
- }
-
- renderLogin() {
-
- if (this.props.isAuthenticated) {
- return (
-
-
-
-
- );
- }
-
- return (
- Login
- );
- }
-
render() {
return (
@@ -63,7 +63,7 @@
Sessions