0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-29 09:02:37 +00:00

Disable the BrewSnippets menu if empty.

This commit is contained in:
David Bolack
2024-12-20 21:47:05 -06:00
parent 5f54777663
commit ed099aa061
2 changed files with 10 additions and 3 deletions

View File

@@ -322,11 +322,11 @@ const SnippetGroup = createClass({
}, },
render : function(){ render : function(){
const groupName = `groupName ${this.props.snippets.length === 0 ? 'disabled' : ''}`; const snippetGroup = `snippetGroup snippetBarButton ${this.props.snippets.length === 0 ? 'disabledSnippets' : ''}`;
return <div className='snippetGroup snippetBarButton'> return <div className={snippetGroup}>
<div className='text'> <div className='text'>
<i className={this.props.icon} /> <i className={this.props.icon} />
<span className={groupName}>{this.props.groupName}</span> <span className='groupName'>{this.props.groupName}</span>
</div> </div>
<div className='dropdown'> <div className='dropdown'>
{this.renderSnippets(this.props.snippets)} {this.renderSnippets(this.props.snippets)}

View File

@@ -231,6 +231,13 @@
} }
} }
} }
.disabledSnippets {
color: grey;
cursor: not-allowed;
&:hover { background-color: #DDDDDD;}
}
} }
@container editor (width < 553px) { @container editor (width < 553px) {
.snippetBar { .snippetBar {