mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-16 19:02:40 +00:00
Initial code pass to not display "Source" and "Get PDF" NavBar buttons on the /changelog page.
This commit is contained in:
@@ -48,7 +48,7 @@ const Homebrew = createClass({
|
|||||||
<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={{ title: 'Changelog', text: this.props.changelog }} />}/>
|
<Route path='/changelog' exact component={()=><SharePage brew={{ title: 'Changelog', text: this.props.changelog }} showSource=false showPrint=false />}/>
|
||||||
<Route path='/' component={()=><HomePage welcomeText={this.props.welcomeText}/>}/>
|
<Route path='/' component={()=><HomePage welcomeText={this.props.welcomeText}/>}/>
|
||||||
</Switch>
|
</Switch>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -25,7 +25,9 @@ const SharePage = createClass({
|
|||||||
updatedAt : null,
|
updatedAt : null,
|
||||||
views : 0,
|
views : 0,
|
||||||
renderer : ''
|
renderer : ''
|
||||||
}
|
},
|
||||||
|
showSource : true,
|
||||||
|
showPrint : true
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -79,6 +81,21 @@ const SharePage = createClass({
|
|||||||
</div>;
|
</div>;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
renderPrint : function(){
|
||||||
|
if(!this.state.showPrint) return;
|
||||||
|
return <PrintLink shareId={this.processShareId()} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
renderSourceDropdown : function(){
|
||||||
|
if(!this.state.showSource) return;
|
||||||
|
return <Nav.item icon='fas fa-code' color='red' className='source'
|
||||||
|
onMouseEnter={()=>this.handleDropdown(true)}
|
||||||
|
onMouseLeave={()=>this.handleDropdown(false)}>
|
||||||
|
source
|
||||||
|
{this.renderDropdown()}
|
||||||
|
</Nav.item>;
|
||||||
|
},
|
||||||
|
|
||||||
render : function(){
|
render : function(){
|
||||||
return <div className='sharePage sitePage'>
|
return <div className='sharePage sitePage'>
|
||||||
<Meta name='robots' content='noindex, nofollow' />
|
<Meta name='robots' content='noindex, nofollow' />
|
||||||
@@ -88,13 +105,8 @@ const SharePage = createClass({
|
|||||||
</Nav.section>
|
</Nav.section>
|
||||||
|
|
||||||
<Nav.section>
|
<Nav.section>
|
||||||
<PrintLink shareId={this.processShareId()} />
|
{this.renderPrint()}
|
||||||
<Nav.item icon='fas fa-code' color='red' className='source'
|
{this.renderSourceDropdown()}
|
||||||
onMouseEnter={()=>this.handleDropdown(true)}
|
|
||||||
onMouseLeave={()=>this.handleDropdown(false)}>
|
|
||||||
source
|
|
||||||
{this.renderDropdown()}
|
|
||||||
</Nav.item>
|
|
||||||
<RecentNavItem brew={this.props.brew} storageKey='view' />
|
<RecentNavItem brew={this.props.brew} storageKey='view' />
|
||||||
<Account />
|
<Account />
|
||||||
</Nav.section>
|
</Nav.section>
|
||||||
|
|||||||
Reference in New Issue
Block a user