mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-09 11:32:39 +00:00
not render snippets element if empty
This commit is contained in:
@@ -150,6 +150,7 @@ const Snippetbar = createClass({
|
|||||||
|
|
||||||
renderSnippetGroups : function(){
|
renderSnippetGroups : function(){
|
||||||
const snippets = this.state.snippets.filter((snippetGroup)=>snippetGroup.view === this.props.view);
|
const snippets = this.state.snippets.filter((snippetGroup)=>snippetGroup.view === this.props.view);
|
||||||
|
if(snippets.length === 0) return null;
|
||||||
|
|
||||||
return <div className='snippets'>
|
return <div className='snippets'>
|
||||||
{_.map(snippets, (snippetGroup)=>{
|
{_.map(snippets, (snippetGroup)=>{
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
display : flex;
|
display : flex;
|
||||||
flex-wrap : wrap-reverse;
|
flex-wrap : wrap-reverse;
|
||||||
justify-content : space-between;
|
justify-content : space-between;
|
||||||
min-width : 331px;
|
|
||||||
height : auto;
|
height : auto;
|
||||||
color : black;
|
color : black;
|
||||||
background-color : #DDDDDD;
|
background-color : #DDDDDD;
|
||||||
@@ -20,6 +19,10 @@
|
|||||||
.editors {
|
.editors {
|
||||||
display : flex;
|
display : flex;
|
||||||
justify-content : space-between;
|
justify-content : space-between;
|
||||||
|
|
||||||
|
&:only-child {
|
||||||
|
margin-left:auto;
|
||||||
|
}
|
||||||
>div {
|
>div {
|
||||||
display : flex;
|
display : flex;
|
||||||
flex : 1;
|
flex : 1;
|
||||||
@@ -218,9 +221,21 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*text tab*/
|
||||||
@container editor (width < 553px) {
|
@container editor (width < 553px) {
|
||||||
|
/*This rule doesn't apply to properties editor or homepage*/
|
||||||
|
.snippetBar:not(:has(>*:only-child)):has(.snippets >*:nth-child(3)) {
|
||||||
.editors,.snippets { flex : 1; }
|
.editors,.snippets { flex : 1; }
|
||||||
.editors { border-bottom : 1px solid;}
|
.editors { border-bottom : 1px solid;}
|
||||||
.snippetBar .editors > div.history > .dropdown { right : unset; }
|
.editors > div.history > .dropdown { right : unset; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*style tab*/
|
||||||
|
@container editor (width < 328px) {
|
||||||
|
/*This rule doesn't apply to properties editor or homepage*/
|
||||||
|
.snippetBar:not(:has(>*:only-child)) {
|
||||||
|
.editors,.snippets { flex : 1; }
|
||||||
|
.editors { border-bottom : 1px solid;}
|
||||||
|
.editors > div.history > .dropdown { right : unset; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user