0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-30 13:12:40 +00:00

Initial code pass to not display "Source" and "Get PDF" NavBar buttons on the /changelog page.

This commit is contained in:
Sean Robertson
2021-07-28 15:25:17 +12:00
parent 3948e17da2
commit caf151a0dd
2 changed files with 21 additions and 9 deletions

View File

@@ -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='/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='/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}/>}/>
</Switch>
</div>

View File

@@ -25,7 +25,9 @@ const SharePage = createClass({
updatedAt : null,
views : 0,
renderer : ''
}
},
showSource : true,
showPrint : true
};
},
@@ -79,6 +81,21 @@ const SharePage = createClass({
</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(){
return <div className='sharePage sitePage'>
<Meta name='robots' content='noindex, nofollow' />
@@ -88,13 +105,8 @@ const SharePage = createClass({
</Nav.section>
<Nav.section>
<PrintLink shareId={this.processShareId()} />
<Nav.item icon='fas fa-code' color='red' className='source'
onMouseEnter={()=>this.handleDropdown(true)}
onMouseLeave={()=>this.handleDropdown(false)}>
source
{this.renderDropdown()}
</Nav.item>
{this.renderPrint()}
{this.renderSourceDropdown()}
<RecentNavItem brew={this.props.brew} storageKey='view' />
<Account />
</Nav.section>