0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -05:00

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
This commit is contained in:
Rish 2020-10-02 16:38:11 +05:30
parent f9ab9835e8
commit 659340ec3e
3 changed files with 3 additions and 3 deletions

View file

@ -32,7 +32,7 @@ export const BackButtonStyles = `
function ActionButton({label = 'Back', brandColor = '#3eb0ef', hidden = false, onClick}) {
if (hidden) {
return;
return null;
}
return (

View file

@ -36,7 +36,7 @@ const Header = ({member, lastPage, brandColor, onBack, showConfirmation, confirm
}
return (
<header className='gh-portal-detail-header'>
{lastPage ? <BackButton brandColor={brandColor} onClick={e => onBack(e)} /> : null}
<BackButton brandColor={brandColor} onClick={e => onBack(e)} hidden={!lastPage} />
<h3 className='gh-portal-main-title'>{title}</h3>
</header>
);

View file

@ -95,7 +95,7 @@ export default class AccountProfilePage extends React.Component {
renderHeader() {
return (
<header className='gh-portal-detail-header'>
<BackButton brandColor={this.context.brandColor} onClick={e => this.onBack(e)} />
<BackButton brandColor={this.context.brandColor} hidden={!this.context.lastPage} onClick={e => this.onBack(e)} />
<h3 className='gh-portal-main-title'>Account settings</h3>
</header>
);