diff --git a/src/components/NavBar.js b/src/components/NavBar.js index ca9b16b..8916883 100644 --- a/src/components/NavBar.js +++ b/src/components/NavBar.js @@ -2,44 +2,62 @@ import React, { Component } from 'react'; import { NavLink } from 'react-router-dom'; import { connect } from 'react-redux'; +function AuthMenu(props) { + if (!props.showMenu) { + return null; + } + + return ( +
+
+ + + +
+
+ + + +
+
+ +
+ +
+
+ ) +} + class NavBar extends Component { constructor (props) { super(props) this.state = { logged_in: false, - auth_menu_visible: false + auth_menu_visible: false, + where_in_auth_menu: false, } + this.handleLoginDropdown = this.handleLoginDropdown.bind(this) } - componentDidMount() { + + handleLoginDropdown() { + this.setState(state => ({ + auth_menu_visible: !state.auth_menu_visible + })); } + render() { return ( -
- sudoscientist:~# - Posts - About -
-
Login
- -
-
- - - -
-
- - - -
-
- -
- -
+
+
+ sudoscientist:~# + Posts + About +
+ Login + +
-
); } @@ -48,7 +66,7 @@ class NavBar extends Component { const mapStateToProps = (state) => { return { logged_in: state.logged_in, - auth_menu_collapsed: state.auth_menu_collapsed + auth_menu_visible: state.auth_menu_visible }; }