0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-08 02:52:39 -05:00

Attempting to add a single newsletter solution for FAQ to get around lack of back stack

refs https://github.com/TryGhost/Team/issues/2348
This commit is contained in:
James Morris 2022-12-01 18:30:50 +00:00
parent 7c392a6d30
commit 50383316c0
3 changed files with 13 additions and 4 deletions
ghost/portal/src/components

View file

@ -529,7 +529,7 @@ const FrameStyles = `
align-items: center;
justify-content: space-between;
flex-direction: column;
gap: 2rem;
gap: 12px;
}
.gh-portal-list-header {

View file

@ -20,7 +20,12 @@ function EmailNewsletterAction() {
<section>
<div className='gh-portal-list-detail'>
<h3>Email newsletter</h3>
<p>{label}</p>
<p>{label} {subscribed && <button
className='gh-portal-btn-text gh-email-faq-page-button'
onClick={() => onAction('switchPage', {page: 'emailReceivingFAQ', lastPage: 'accountHome'})}
>
Not receiving emails?
</button>}</p>
</div>
<div>
<Switch

View file

@ -5,7 +5,7 @@ import CloseButton from 'components/common/CloseButton';
import {getSupportAddress} from 'utils/helpers';
export default function EmailReceivingPage() {
const {brandColor, onAction, site} = useContext(AppContext);
const {brandColor, onAction, site, lastPage} = useContext(AppContext);
const supportAddress = `mailto:${getSupportAddress({site})}`;
@ -13,7 +13,11 @@ export default function EmailReceivingPage() {
<div className="gh-email-receiving-faq">
<header className='gh-portal-detail-header'>
<BackButton brandColor={brandColor} onClick={() => {
onAction('switchPage', {page: 'accountEmail', lastPage: 'accountHome'});
if (!lastPage) {
onAction('switchPage', {page: 'accountEmail', lastPage: 'accountHome'});
} else {
onAction('switchPage', {page: 'accountHome'});
}
}} />
<CloseButton />
</header>