From ed099aa061bef4ad783d64a459232beed0c12602 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Fri, 20 Dec 2024 21:47:05 -0600 Subject: [PATCH] Disable the BrewSnippets menu if empty. --- client/homebrew/editor/snippetbar/snippetbar.jsx | 6 +++--- client/homebrew/editor/snippetbar/snippetbar.less | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippetbar.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index 1809d8f7b..b1fd02fd2 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -322,11 +322,11 @@ const SnippetGroup = createClass({ }, render : function(){ - const groupName = `groupName ${this.props.snippets.length === 0 ? 'disabled' : ''}`; - return
+ const snippetGroup = `snippetGroup snippetBarButton ${this.props.snippets.length === 0 ? 'disabledSnippets' : ''}`; + return
- {this.props.groupName} + {this.props.groupName}
{this.renderSnippets(this.props.snippets)} diff --git a/client/homebrew/editor/snippetbar/snippetbar.less b/client/homebrew/editor/snippetbar/snippetbar.less index 33242174b..3478dfde0 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -231,6 +231,13 @@ } } } + .disabledSnippets { + color: grey; + cursor: not-allowed; + + &:hover { background-color: #DDDDDD;} + } + } @container editor (width < 553px) { .snippetBar {