From caf151a0dd6d943857c7673d697148f9cad234d4 Mon Sep 17 00:00:00 2001 From: Sean Robertson Date: Wed, 28 Jul 2021 15:25:17 +1200 Subject: [PATCH] Initial code pass to not display "Source" and "Get PDF" NavBar buttons on the `/changelog` page. --- client/homebrew/homebrew.jsx | 2 +- client/homebrew/pages/sharePage/sharePage.jsx | 28 +++++++++++++------ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/client/homebrew/homebrew.jsx b/client/homebrew/homebrew.jsx index 94131b1dd..d3cc1e824 100644 --- a/client/homebrew/homebrew.jsx +++ b/client/homebrew/homebrew.jsx @@ -48,7 +48,7 @@ const Homebrew = createClass({ }/> } /> } /> - }/> + }/> }/> diff --git a/client/homebrew/pages/sharePage/sharePage.jsx b/client/homebrew/pages/sharePage/sharePage.jsx index 82b948675..3e51aafb0 100644 --- a/client/homebrew/pages/sharePage/sharePage.jsx +++ b/client/homebrew/pages/sharePage/sharePage.jsx @@ -25,7 +25,9 @@ const SharePage = createClass({ updatedAt : null, views : 0, renderer : '' - } + }, + showSource : true, + showPrint : true }; }, @@ -79,6 +81,21 @@ const SharePage = createClass({ ; }, + renderPrint : function(){ + if(!this.state.showPrint) return; + return ; + } + + renderSourceDropdown : function(){ + if(!this.state.showSource) return; + return this.handleDropdown(true)} + onMouseLeave={()=>this.handleDropdown(false)}> + source + {this.renderDropdown()} + ; + }, + render : function(){ return
@@ -88,13 +105,8 @@ const SharePage = createClass({ - - this.handleDropdown(true)} - onMouseLeave={()=>this.handleDropdown(false)}> - source - {this.renderDropdown()} - + {this.renderPrint()} + {this.renderSourceDropdown()}