From 67759602410903ff5d712d08f3662f2cc7d1cff9 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Mon, 9 Aug 2021 13:26:10 +1200 Subject: [PATCH 1/2] Hide Private brew `
` if UserPage is not for logged in User --- client/homebrew/pages/userPage/userPage.jsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/client/homebrew/pages/userPage/userPage.jsx b/client/homebrew/pages/userPage/userPage.jsx index 28e0a17c9..f5e787a1d 100644 --- a/client/homebrew/pages/userPage/userPage.jsx +++ b/client/homebrew/pages/userPage/userPage.jsx @@ -145,10 +145,12 @@ const UserPage = createClass({

{this.getUsernameWithS()} brews

{this.renderBrews(brews.published)}
-
-

{this.getUsernameWithS()} unpublished brews

- {this.renderBrews(brews.private)} -
+ {this.props?.username == global.account?.username && +
+

{this.getUsernameWithS()} unpublished brews

+ {this.renderBrews(brews.private)} +
+ } ; From 9ca8afb3baf2ac3cca3dbc997482815f35528b21 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Mon, 9 Aug 2021 00:40:25 -0400 Subject: [PATCH 2/2] optional chaining not needed on props --- client/homebrew/pages/userPage/userPage.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/homebrew/pages/userPage/userPage.jsx b/client/homebrew/pages/userPage/userPage.jsx index f5e787a1d..a3acab7f7 100644 --- a/client/homebrew/pages/userPage/userPage.jsx +++ b/client/homebrew/pages/userPage/userPage.jsx @@ -142,10 +142,10 @@ const UserPage = createClass({
{this.renderSortOptions()}
-

{this.getUsernameWithS()} brews

+

{this.getUsernameWithS()} published brews

{this.renderBrews(brews.published)}
- {this.props?.username == global.account?.username && + {this.props.username == global.account?.username &&

{this.getUsernameWithS()} unpublished brews

{this.renderBrews(brews.private)}