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

Updated newsletter updated messaging

refs https://github.com/TryGhost/members.js/issues/95

- Updates the newsletter status update as part of existing label
This commit is contained in:
Rish 2020-09-08 18:43:50 +05:30
parent baf15f577c
commit 21a7d61c85
2 changed files with 5 additions and 14 deletions

View file

@ -248,7 +248,7 @@ export default class App extends React.Component {
this.setState({
action: ''
});
}, 5000);
}, 2000);
} catch (e) {
this.setState({
action: `${action}:failed`

View file

@ -196,21 +196,13 @@ const PaidAccountActions = ({member, openUpdatePlan, onEditBilling}) => {
return null;
};
const NotifyNewsletterUpdated = ({action}) => {
if (action === 'updateNewsletter:success') {
return (
<p>
Newsletter updated
</p>
);
}
return null;
};
const AccountActions = ({member, action, openEditProfile, openUpdatePlan, onEditBilling, onToggleSubscription}) => {
const {name, email, subscribed} = member;
const label = subscribed ? 'Subscribed to email newsletters' : 'Not subscribed to email newsletters';
let label = subscribed ? 'Subscribed to email newsletters' : 'Not subscribed to email newsletters';
if (action === 'updateNewsletter:success') {
label = '✓ Newsletter updated';
}
return (
<div className='gh-portal-list'>
<section>
@ -227,7 +219,6 @@ const AccountActions = ({member, action, openEditProfile, openUpdatePlan, onEdit
<div className='gh-portal-list-detail'>
<h3>Newsletter</h3>
<p>{label}</p>
<NotifyNewsletterUpdated action={action} />
</div>
<div>
<Switch onToggle={(e) => {