0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-17 16:42:41 +00:00

Fix Share links

This commit is contained in:
Trevor Buckner
2020-10-07 17:13:37 -04:00
parent 28ed2fe8f2
commit 8fe0148821
3 changed files with 37 additions and 16 deletions

View File

@@ -45,15 +45,10 @@ const SharePage = createClass({
}
},
renderSourceButton : function() {
let shareLink = this.props.brew.shareId;
if(this.props.brew.googleId) {
shareLink = this.props.brew.googleId + shareLink;
}
return <Nav.item href={`/source/${shareLink}`} color='teal' icon='fa-code'>
source
</Nav.item>;
processShareId : function() {
return this.props.brew.googleId ?
this.props.brew.googleId + this.props.brew.shareId :
this.props.brew.shareId;
},
render : function(){
@@ -65,8 +60,10 @@ const SharePage = createClass({
</Nav.section>
<Nav.section>
<PrintLink shareId={this.props.brew.shareId} />
{this.renderSourceButton()}
<PrintLink shareId={this.processShareId()} />
<Nav.item href={`/source/${this.processShareId()}`} color='teal' icon='fa-code'>
source
</Nav.item>
<RecentNavItem brew={this.props.brew} storageKey='view' />
<Account />
</Nav.section>