0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-01 10:52:46 +00:00

Fully disable theme selection when in Legacy mode

Making Legacy a "theme" implies we will add more themes to Legacy, which we aren't planning to.
This commit is contained in:
Trevor Buckner
2022-03-01 00:34:19 -05:00
parent da5ce35c3c
commit 8e0629062d
3 changed files with 29 additions and 10 deletions

View File

@@ -98,17 +98,18 @@ const Nav = {
);
},
render : function () {
console.log(this.props.children);
const dropdownChildren = React.Children.map(this.props.children, (child, i)=>{
// Ignore the first child
if(i < 1) return;
return child;
});
return (
<div className='navDropdownContainer'
<div className={`navDropdownContainer ${this.props.className}`}
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.props.children[0] || this.props.children} //children is not an array when only one child
{this.renderDropdown(dropdownChildren)}
</div>
);