From 6e57686f8f99a0052306202556a69c171fe643d3 Mon Sep 17 00:00:00 2001 From: Asara Date: Tue, 27 Aug 2019 20:53:20 -0400 Subject: [PATCH] I think i'm almost there --- src/components/AuthMenu.js | 72 ++++++++++++++++++++------------------ src/components/NavBar.js | 2 +- 2 files changed, 39 insertions(+), 35 deletions(-) diff --git a/src/components/AuthMenu.js b/src/components/AuthMenu.js index 89ff872..fe3357e 100644 --- a/src/components/AuthMenu.js +++ b/src/components/AuthMenu.js @@ -6,11 +6,12 @@ class AuthMenu extends Component { super(props) this.state = { where_in_auth_menu: "username", - auth_menu_visible: true, + auth_menu_visible: props.auth_menu_visible, } this.handleSignUpRequest = this.handleSignUpRequest.bind(this) this.handleLogInAttempt = this.handleLogInAttempt.bind(this) this.handleAccountCreation = this.handleAccountCreation.bind(this) + this.authMenu = this.authMenu.bind(this) } handleSignUpRequest() { @@ -33,41 +34,44 @@ class AuthMenu extends Component { })); } + authMenu() { + if (!this.state.auth_menu_visible) { + return null; + } + switch(this.state.where_in_auth_menu) { + case 'username': + return ( +
+
+ + + +
+
+ +
+ +
+
+ ) + case 'password': + return ( +
+
+ + + +
+
+ ) + default: + return null; + } + } + render() { return ( -
- {(() => { - switch(this.state.auth_location) { - case 'username': - return ( -
-
- - - -
-
- -
- -
-
- ) - case 'password': - return ( -
-
- - - -
-
- ) - default: - return null; - } - })()} -
+ this.authMenu(this.state.auth_menu_visible) ) } } diff --git a/src/components/NavBar.js b/src/components/NavBar.js index c1ec86f..80f4742 100644 --- a/src/components/NavBar.js +++ b/src/components/NavBar.js @@ -29,7 +29,7 @@ class NavBar extends Component {
Login - +