Skip to content

Commit

Permalink
Account home page refinements
Browse files Browse the repository at this point in the history
no refs.
- copy refinements
- added renewal date to paid members' account home
  • Loading branch information
peterzimon committed Nov 10, 2020
1 parent 23c75e3 commit 6587eca
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions ghost/portal/src/components/pages/AccountHomePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ const PaidAccountActions = ({member, site, openUpdatePlan, onEditBilling}) => {
return (
<section>
<div className='gh-portal-list-detail'>
<h3>Billing Info</h3>
<h3>Billing info</h3>
<CardLabel defaultCardLast4={defaultCardLast4} />
</div>
<button className='gh-portal-btn gh-portal-btn-list' onClick={e => onEditBilling(e)}>{label}</button>
Expand Down Expand Up @@ -247,7 +247,7 @@ const SubscribeButton = ({site, action, openSubscribe, brandColor}) => {
return (
<ActionButton
isRunning={isRunning}
label="Upgrade now"
label="View plans"
onClick={() => openSubscribe()}
brandColor={brandColor}
style={{width: '100%'}}
Expand All @@ -256,24 +256,28 @@ const SubscribeButton = ({site, action, openSubscribe, brandColor}) => {
};

const AccountWelcome = ({member, action, site, openSubscribe, brandColor}) => {
const {name, firstname, email} = member;
const {title: siteTitle} = site;
const {is_stripe_configured: isStripeConfigured} = site;

if (!isStripeConfigured) {
return null;
}

if (member.paid) {
return null;
const subscription = getMemberSubscription({member});
const currentPeriodEnd = subscription.current_period_end;
if (subscription.cancel_at_period_end) {
return null;
}
return (
<div className='gh-portal-section'>
<p className='gh-portal-text-center gh-portal-free-ctatext'>Your subscription will renew on {getDateString(currentPeriodEnd)}</p>
</div>
);
}

return (
<div className='gh-portal-section'>
<p className='gh-portal-text-center gh-portal-free-ctatext'>
Hey <strong>{firstname || name || email}! </strong>
You are subscribed to free updates from <strong>{siteTitle}</strong>, but you don't have a paid subscription to unlock full access
</p>
<p className='gh-portal-text-center gh-portal-free-ctatext'>You currently have a free membership, upgrade to a paid subscription for full access.</p>
<SubscribeButton action={action} site={site} openSubscribe={openSubscribe} brandColor={brandColor} />
</div>
);
Expand Down Expand Up @@ -303,9 +307,7 @@ const CancelContinueSubscription = ({member, onAction, action, brandColor, showO
}
const currentPeriodEnd = subscription.current_period_end;
return (
<p className="gh-portal-expire-warning">
Your subscription will expire on {getDateString(currentPeriodEnd)}.
</p>
<p className='gh-portal-text-center gh-portal-free-ctatext'>Your subscription will expire on {getDateString(currentPeriodEnd)}</p>
);
};

Expand Down

0 comments on commit 6587eca

Please sign in to comment.