From 8ffea70b2f2ae63ca5cc13e1ca267d4d46811955 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Fri, 27 Nov 2020 21:14:15 -0500 Subject: [PATCH] Remove metadata on the Homepage (#1121) * Remove the metadata button on home page 1) Hopefully make it more clear that the Homepage is meant as a sandbox to test out the site, not a real brew that will be saved. 2) Also, avoid errors resulting from trying to modify the metadata of a brew that doesn't really exist yet. * Lint --- client/homebrew/editor/editor.jsx | 4 +++- .../homebrew/editor/snippetbar/snippetbar.jsx | 24 +++++++++++-------- client/homebrew/pages/homePage/homePage.jsx | 2 +- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index 8925835f3..d85d36d34 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -23,6 +23,7 @@ const Editor = createClass({ metadata : {}, onMetadataChange : ()=>{}, + showMetaButton : true }; }, getInitialState : function() { @@ -118,7 +119,8 @@ const Editor = createClass({ brew={this.props.value} onInject={this.handleInject} onToggle={this.handgleToggle} - showmeta={this.state.showMetadataEditor} /> + showmeta={this.state.showMetadataEditor} + showMetaButton={this.props.showMetaButton} /> {this.renderMetadataEditor()} {}, - onToggle : ()=>{}, - showmeta : false + brew : '', + onInject : ()=>{}, + onToggle : ()=>{}, + showmeta : false, + showMetaButton : true }; }, @@ -41,13 +40,18 @@ const Snippetbar = createClass({ }); }, + renderMetadataButton : function(){ + if(!this.props.showMetaButton) return; + return
+ +
; + }, + render : function(){ return
{this.renderSnippetGroups()} -
- -
+ {this.renderMetadataButton()}
; } }); diff --git a/client/homebrew/pages/homePage/homePage.jsx b/client/homebrew/pages/homePage/homePage.jsx index 8795156e7..e41251d60 100644 --- a/client/homebrew/pages/homePage/homePage.jsx +++ b/client/homebrew/pages/homePage/homePage.jsx @@ -77,7 +77,7 @@ const HomePage = createClass({
- +