0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-02 21:32:42 +00:00

pass userThemes as a new prop, rather than inside of the brew

This commit is contained in:
Trevor Buckner
2024-07-15 23:29:16 -04:00
parent af5434c9b7
commit dfbd85a8ce
3 changed files with 4 additions and 4 deletions

View File

@@ -66,9 +66,9 @@ const Homebrew = createClass({
<Router location={this.props.url}> <Router location={this.props.url}>
<div className='homebrew'> <div className='homebrew'>
<Routes> <Routes>
<Route path='/edit/:id' element={<WithRoute el={EditPage} brew={this.props.brew} />} /> <Route path='/edit/:id' element={<WithRoute el={EditPage} brew={this.props.brew} userThemes={this.props.userThemes}/>} />
<Route path='/share/:id' element={<WithRoute el={SharePage} brew={this.props.brew} />} /> <Route path='/share/:id' element={<WithRoute el={SharePage} brew={this.props.brew} />} />
<Route path='/new/:id' element={<WithRoute el={NewPage} brew={this.props.brew} />} /> <Route path='/new/:id' element={<WithRoute el={NewPage} brew={this.props.brew} userThemes={this.props.userThemes}/>} />
<Route path='/new' element={<WithRoute el={NewPage}/>} /> <Route path='/new' element={<WithRoute el={NewPage}/>} />
<Route path='/user/:username' element={<WithRoute el={UserPage} brews={this.props.brews} />} /> <Route path='/user/:username' element={<WithRoute el={UserPage} brews={this.props.brews} />} />
<Route path='/changelog' element={<WithRoute el={SharePage} brew={this.props.brew} />} /> <Route path='/changelog' element={<WithRoute el={SharePage} brew={this.props.brew} />} />

View File

@@ -55,7 +55,6 @@ const EditPage = createClass({
autoSaveWarning : false, autoSaveWarning : false,
unsavedTime : new Date(), unsavedTime : new Date(),
currentEditorPage : 0, currentEditorPage : 0,
userThemes : this.props.brew.userThemes,
displayLockMessage : this.props.brew.lock || false displayLockMessage : this.props.brew.lock || false
}; };
}, },
@@ -415,7 +414,7 @@ const EditPage = createClass({
theme={this.state.brew.theme} theme={this.state.brew.theme}
errors={this.state.htmlErrors} errors={this.state.htmlErrors}
lang={this.state.brew.lang} lang={this.state.brew.lang}
userThemes={this.state.brew.userThemes} userThemes={this.props.userThemes}
currentEditorPage={this.state.currentEditorPage} currentEditorPage={this.state.currentEditorPage}
allowPrint={true} allowPrint={true}
/> />

View File

@@ -218,6 +218,7 @@ const NewPage = createClass({
theme={this.state.brew.theme} theme={this.state.brew.theme}
errors={this.state.htmlErrors} errors={this.state.htmlErrors}
lang={this.state.brew.lang} lang={this.state.brew.lang}
userThemes={this.props.userThemes}
currentEditorPage={this.state.currentEditorPage} currentEditorPage={this.state.currentEditorPage}
allowPrint={true} allowPrint={true}
/> />