0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 18:32:41 +00:00

Add dropdown selector (not clickable yet)

This commit is contained in:
Trevor Buckner
2022-01-09 22:35:53 -05:00
parent 9f12e2748d
commit 87bb682836
9 changed files with 142 additions and 33 deletions

View File

@@ -69,6 +69,12 @@ const Nav = {
}),
dropdown : createClass({
getDefaultProps : function() {
return {
trigger : 'hover'
};
},
getInitialState : function() {
return {
showDropdown : false
@@ -99,7 +105,8 @@ const Nav = {
});
return (
<div className='navDropdownContainer'
onMouseEnter={()=>this.handleDropdown(true)}
onMouseEnter={this.props.trigger == 'hover' ? ()=>{this.handleDropdown(true);} : undefined}
onClick= {this.props.trigger == 'click' ? ()=>{this.handleDropdown(true);} : undefined}
onMouseLeave={()=>this.handleDropdown(false)}>
{this.props.children[0]}
{this.renderDropdown(dropdownChildren)}