mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-24 18:32:41 +00:00
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
This commit is contained in:
@@ -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()}
|
||||
<CodeEditor
|
||||
ref='codeEditor'
|
||||
|
||||
@@ -12,15 +12,14 @@ const execute = function(val, brew){
|
||||
return val;
|
||||
};
|
||||
|
||||
|
||||
|
||||
const Snippetbar = createClass({
|
||||
getDefaultProps : function() {
|
||||
return {
|
||||
brew : '',
|
||||
onInject : ()=>{},
|
||||
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 <div className={cx('toggleMeta', { selected: this.props.showmeta })}
|
||||
onClick={this.props.onToggle}>
|
||||
<i className='fa fa-bars' />
|
||||
</div>;
|
||||
},
|
||||
|
||||
render : function(){
|
||||
return <div className='snippetBar'>
|
||||
{this.renderSnippetGroups()}
|
||||
<div className={cx('toggleMeta', { selected: this.props.showmeta })}
|
||||
onClick={this.props.onToggle}>
|
||||
<i className='fa fa-bars' />
|
||||
</div>
|
||||
{this.renderMetadataButton()}
|
||||
</div>;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -77,7 +77,7 @@ const HomePage = createClass({
|
||||
|
||||
<div className='content'>
|
||||
<SplitPane onDragFinish={this.handleSplitMove} ref='pane'>
|
||||
<Editor value={this.state.text} onChange={this.handleTextChange} ref='editor'/>
|
||||
<Editor value={this.state.text} onChange={this.handleTextChange} showMetaButton={false} ref='editor'/>
|
||||
<BrewRenderer text={this.state.text} />
|
||||
</SplitPane>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user