From 659340ec3e720100b90563a086fc607f5b4d12ad Mon Sep 17 00:00:00 2001 From: Rish Date: Fri, 2 Oct 2020 16:38:11 +0530 Subject: [PATCH] Fixed back button visible on link pages no issue - When account plan/profile pages are opened via Portal Link, the back button is non-functional as we don't have a last page to go to, fix hides the back button in such cases --- ghost/portal/src/components/common/BackButton.js | 2 +- ghost/portal/src/components/pages/AccountPlanPage.js | 2 +- ghost/portal/src/components/pages/AccountProfilePage.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ghost/portal/src/components/common/BackButton.js b/ghost/portal/src/components/common/BackButton.js index a461cbb66a..3b6c503f8a 100644 --- a/ghost/portal/src/components/common/BackButton.js +++ b/ghost/portal/src/components/common/BackButton.js @@ -32,7 +32,7 @@ export const BackButtonStyles = ` function ActionButton({label = 'Back', brandColor = '#3eb0ef', hidden = false, onClick}) { if (hidden) { - return; + return null; } return ( diff --git a/ghost/portal/src/components/pages/AccountPlanPage.js b/ghost/portal/src/components/pages/AccountPlanPage.js index c0ce7de7e9..723d3690d2 100644 --- a/ghost/portal/src/components/pages/AccountPlanPage.js +++ b/ghost/portal/src/components/pages/AccountPlanPage.js @@ -36,7 +36,7 @@ const Header = ({member, lastPage, brandColor, onBack, showConfirmation, confirm } return (
- {lastPage ? onBack(e)} /> : null} + onBack(e)} hidden={!lastPage} />

{title}

); diff --git a/ghost/portal/src/components/pages/AccountProfilePage.js b/ghost/portal/src/components/pages/AccountProfilePage.js index 6753c1f59f..0f0565d95b 100644 --- a/ghost/portal/src/components/pages/AccountProfilePage.js +++ b/ghost/portal/src/components/pages/AccountProfilePage.js @@ -95,7 +95,7 @@ export default class AccountProfilePage extends React.Component { renderHeader() { return (
- this.onBack(e)} /> +
);