mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-11 15:32:47 +00:00
Shift HomePage to use a minimal brew
This commit is contained in:
@@ -44,12 +44,12 @@ const Homebrew = createClass({
|
|||||||
<Route path='/edit/:id' component={(routeProps)=><EditPage id={routeProps.match.params.id} brew={this.props.brew} />}/>
|
<Route path='/edit/:id' component={(routeProps)=><EditPage id={routeProps.match.params.id} brew={this.props.brew} />}/>
|
||||||
<Route path='/share/:id' component={(routeProps)=><SharePage id={routeProps.match.params.id} brew={this.props.brew} />}/>
|
<Route path='/share/:id' component={(routeProps)=><SharePage id={routeProps.match.params.id} brew={this.props.brew} />}/>
|
||||||
<Route path='/new/:id' component={(routeProps)=><NewPage id={routeProps.match.params.id} brew={this.props.brew} />}/>
|
<Route path='/new/:id' component={(routeProps)=><NewPage id={routeProps.match.params.id} brew={this.props.brew} />}/>
|
||||||
<Route path='/new' exact component={(routeProps)=><NewPage/>}/>
|
<Route path='/new' exact component={(routeProps)=><NewPage />}/>
|
||||||
<Route path='/user/:username' component={(routeProps)=><UserPage username={routeProps.match.params.username} brews={this.props.brews} />}/>
|
<Route path='/user/:username' component={(routeProps)=><UserPage username={routeProps.match.params.username} brews={this.props.brews} />}/>
|
||||||
<Route path='/print/:id' component={(routeProps)=><PrintPage brew={this.props.brew} query={queryString.parse(routeProps.location.search)} /> } />
|
<Route path='/print/:id' component={(routeProps)=><PrintPage brew={this.props.brew} query={queryString.parse(routeProps.location.search)} />}/>
|
||||||
<Route path='/print' exact component={(routeProps)=><PrintPage query={queryString.parse(routeProps.location.search)} /> } />
|
<Route path='/print' exact component={(routeProps)=><PrintPage query={queryString.parse(routeProps.location.search)} />}/>
|
||||||
<Route path='/changelog' exact component={()=><SharePage brew={this.props.brew} />}/>
|
<Route path='/changelog' exact component={()=><SharePage brew={this.props.brew} />}/>
|
||||||
<Route path='/' component={()=><HomePage welcomeText={this.props.welcomeText}/>}/>
|
<Route path='/' component={()=><HomePage brew={this.props.brew} />}/>
|
||||||
</Switch>
|
</Switch>
|
||||||
</div>
|
</div>
|
||||||
</Router>
|
</Router>
|
||||||
|
|||||||
@@ -23,17 +23,15 @@ const HomePage = createClass({
|
|||||||
getDefaultProps : function() {
|
getDefaultProps : function() {
|
||||||
return {
|
return {
|
||||||
brew : {
|
brew : {
|
||||||
text : ''
|
text : '',
|
||||||
|
welcomeText : ''
|
||||||
},
|
},
|
||||||
welcomeText : '',
|
ver : '0.0.0'
|
||||||
ver : '0.0.0'
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
getInitialState : function() {
|
getInitialState : function() {
|
||||||
return {
|
return {
|
||||||
brew : {
|
brew : this.props.brew
|
||||||
text : this.props.welcomeText
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
handleSave : function(){
|
handleSave : function(){
|
||||||
@@ -87,7 +85,7 @@ const HomePage = createClass({
|
|||||||
</SplitPane>
|
</SplitPane>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={cx('floatingSaveButton', { show: this.props.welcomeText != this.state.brew.text })} onClick={this.handleSave}>
|
<div className={cx('floatingSaveButton', { show: this.props.brew.welcomeText != this.state.brew.text })} onClick={this.handleSave}>
|
||||||
Save current <i className='fas fa-save' />
|
Save current <i className='fas fa-save' />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -107,7 +107,11 @@ app.get('/robots.txt', (req, res)=>{
|
|||||||
|
|
||||||
//Home page
|
//Home page
|
||||||
app.get('/', async (req, res, next)=>{
|
app.get('/', async (req, res, next)=>{
|
||||||
req.welcomeText = welcomeText;
|
const brew = {
|
||||||
|
text : welcomeText,
|
||||||
|
welcomeText : welcomeText
|
||||||
|
};
|
||||||
|
req.brew = brew;
|
||||||
return next();
|
return next();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user