diff --git a/src/components/AuthMenu.js b/src/components/AuthMenu.js
new file mode 100644
index 0000000..f171faf
--- /dev/null
+++ b/src/components/AuthMenu.js
@@ -0,0 +1,85 @@
+import React, { Component } from 'react';
+import { connect } from 'react-redux';
+
+class AuthMenu extends Component {
+ constructor (props) {
+ super(props)
+ this.state = {
+ where_in_auth_menu: "username",
+ auth_menu_visible: true,
+ }
+ this.handleSignUpRequest = this.handleSignUpRequest.bind(this)
+ this.handleLogInAttempt = this.handleLogInAttempt.bind(this)
+ this.handleAccountCreation = this.handleAccountCreation.bind(this)
+ }
+
+ handleSignUpRequest() {
+ this.setState(state => ({
+ where_in_auth_menu: "email",
+ auth_menu_visible: true,
+ }));
+ }
+
+ handleLogInAttempt() {
+ this.setState(state => ({
+ where_in_auth_menu: "password",
+ auth_menu_visible: true,
+ }));
+ }
+ handleAccountCreation() {
+ this.setState(state => ({
+ where_in_auth_menu: "password",
+ auth_menu_visible: true,
+ }));
+ }
+
+ render() {
+ return (
+
+ {(() => {
+ switch(this.state.auth_location) {
+ case 'username':
+ return (
+
+ )
+ case 'password':
+ return (
+
+ )
+ default:
+ return null;
+ }
+ })()}
+
+ )
+ }
+}
+
+
+
+const mapStateToProps = (state) => {
+ return {
+ where_in_auth_menu: state.where_in_auth_menu,
+ };
+}
+
+export default connect(
+ mapStateToProps,
+)(AuthMenu);
diff --git a/src/components/NavBar.js b/src/components/NavBar.js
index 8916883..5c9f374 100644
--- a/src/components/NavBar.js
+++ b/src/components/NavBar.js
@@ -1,32 +1,7 @@
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 (
-
- )
-}
+import AuthMenu from './AuthMenu';
class NavBar extends Component {
constructor (props) {
@@ -34,14 +9,14 @@ class NavBar extends Component {
this.state = {
logged_in: false,
auth_menu_visible: false,
- where_in_auth_menu: false,
+ where_in_auth_menu: "username",
}
this.handleLoginDropdown = this.handleLoginDropdown.bind(this)
}
handleLoginDropdown() {
this.setState(state => ({
- auth_menu_visible: !state.auth_menu_visible
+ auth_menu_visible: true
}));
}
@@ -55,7 +30,7 @@ class NavBar extends Component {