I think i'm almost there
This commit is contained in:
parent
27a29d827a
commit
6e57686f8f
2 changed files with 39 additions and 35 deletions
|
@ -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,11 +34,11 @@ class AuthMenu extends Component {
|
|||
}));
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
{(() => {
|
||||
switch(this.state.auth_location) {
|
||||
authMenu() {
|
||||
if (!this.state.auth_menu_visible) {
|
||||
return null;
|
||||
}
|
||||
switch(this.state.where_in_auth_menu) {
|
||||
case 'username':
|
||||
return (
|
||||
<div className="ui menu dropdown" style={{display: "inline"}}>
|
||||
|
@ -66,8 +67,11 @@ class AuthMenu extends Component {
|
|||
default:
|
||||
return null;
|
||||
}
|
||||
})()}
|
||||
</div>
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
this.authMenu(this.state.auth_menu_visible)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ class NavBar extends Component {
|
|||
<div onClick={this.handleLoginDropdown} className='item ui button dropdown'>
|
||||
Login
|
||||
<i className="dropdown icon"></i>
|
||||
<AuthMenu showMenu={this.state.auth_menu_visible}></AuthMenu>
|
||||
<AuthMenu auth_menu_visible={this.state.auth_menu_visible}></AuthMenu>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Reference in a new issue