0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-19 01:12:45 +00:00

Shift to title wrapper

This commit is contained in:
G.Ambatte
2023-03-15 09:17:05 +13:00
parent 4505308b81
commit 24564a2750
6 changed files with 30 additions and 18 deletions

View File

@@ -14,17 +14,17 @@ const MetadataNav = createClass({
getInitialState : function() {
return {
showDropdown : false
showMetaWindow : false
};
},
componentDidMount : function() {
},
handleDropdown : function(show){
this.setState({
showDropdown : show
});
toggleMetaWindow : function(){
this.setState((prevProps)=>({
showMetaWindow : !prevProps.showMetaWindow
}));
},
getAuthors : function(){
@@ -42,8 +42,8 @@ const MetadataNav = createClass({
return this.props.brew.systems.join(', ');
},
renderDropdown : function(){
if(!this.state.showDropdown) return null;
renderMetaWindow : function(){
if(!this.state.showMetaWindow) return null;
return <div className='dropdown'>
<h4>Description</h4>
@@ -59,10 +59,9 @@ const MetadataNav = createClass({
render : function(){
return <Nav.item icon='fas fa-info-circle' color='grey' className='metadata'
onMouseEnter={()=>this.handleDropdown(true)}
onMouseLeave={()=>this.handleDropdown(false)}>
METADATA
{this.renderDropdown()}
onClick={()=>this.toggleMetaWindow()}>
{this.props.children}
{this.renderMetaWindow()}
</Nav.item>;
}