0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-03 01:52:42 +00:00

remove prop drilling

This commit is contained in:
Víctor Losada Hernández
2025-07-18 16:39:00 +02:00
parent e0bba53df1
commit d5645083f3
5 changed files with 4 additions and 8 deletions

View File

@@ -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'>