diff --git a/src/components/AuthMenu.js b/src/components/AuthMenu.js
index a64c0d2..e58ce57 100644
--- a/src/components/AuthMenu.js
+++ b/src/components/AuthMenu.js
@@ -93,7 +93,8 @@ class AuthMenu extends Component {
this.props.userLogin(this.state.username, this.state.password)
.then(res => {
this.setState(state => ({
- auth_menu_visible: false
+ auth_menu_visible: false,
+ where_in_auth_menu: "loggedIn"
}))
this.props.close()
}
@@ -184,6 +185,15 @@ class AuthMenu extends Component {
)
+ case 'loggedIn':
+ return (
+
+ )
default:
return null;
}
@@ -196,13 +206,7 @@ class AuthMenu extends Component {
}
}
-const mapStateToProps = (state) => {
- return {
- username: state.username,
- };
-}
-
export default connect(
- mapStateToProps,
+ null,
{ userLogin, loadCookieToState }
)(AuthMenu);
diff --git a/src/components/NavBar.js b/src/components/NavBar.js
index 17d8093..ffbcc7d 100644
--- a/src/components/NavBar.js
+++ b/src/components/NavBar.js
@@ -9,6 +9,7 @@ class NavBar extends Component {
this.state = {
logged_in: false,
auth_menu_visible: false,
+ user_or_login: 'Login'
}
this.handleLoginDropdown = this.handleLoginDropdown.bind(this)
}
@@ -27,7 +28,7 @@ class NavBar extends Component {
Posts
About
- Login
+ {this.state.user_or_login}
this.setState({auth_menu_visible: false})}>