mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-02 08:32:41 +00:00
remove prop drilling
This commit is contained in:
@@ -466,7 +466,6 @@ const Editor = createClass({
|
||||
rerenderParent={this.rerenderParent} />
|
||||
<MetadataEditor
|
||||
metadata={this.props.brew}
|
||||
isOwner={this.props.isOwner}
|
||||
themeBundle={this.props.themeBundle}
|
||||
onChange={this.props.onMetaChange}
|
||||
reportError={this.props.reportError}
|
||||
|
||||
@@ -47,6 +47,7 @@ const MetadataEditor = createClass({
|
||||
|
||||
getInitialState : function(){
|
||||
return {
|
||||
isOwner : global.account?.username && global.account?.username === this.props.metadata?.authors[0],
|
||||
showThumbnail : true
|
||||
};
|
||||
},
|
||||
@@ -212,7 +213,7 @@ const MetadataEditor = createClass({
|
||||
if(authors && authors.length){
|
||||
text = authors.join(', ');
|
||||
}
|
||||
if(!this.props.isOwner || authors.length < 2) return (
|
||||
if(!this.state.isOwner || authors.length < 2) return (
|
||||
<div className='field authors'>
|
||||
<label>authors</label>
|
||||
<div className='value'>
|
||||
|
||||
Reference in New Issue
Block a user