mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
Added loader icon for edit billing update
no issue - Adds loading indicator for Billing update button while it waits to create and load stripe session
This commit is contained in:
parent
b037d98fb8
commit
da7aee7003
1 changed files with 8 additions and 1 deletions
|
@ -5,6 +5,8 @@ import CloseButton from '../common/CloseButton';
|
|||
import Switch from '../common/Switch';
|
||||
import {getMemberSubscription, hasOnlyFreePlan, isComplimentaryMember} from '../../utils/helpers';
|
||||
import {getDateString} from '../../utils/date-time';
|
||||
import {ReactComponent as LoaderIcon} from '../../images/icons/loader.svg';
|
||||
import {useContext} from 'react';
|
||||
|
||||
const React = require('react');
|
||||
|
||||
|
@ -155,16 +157,21 @@ const PaidAccountActions = ({member, site, openUpdatePlan, onEditBilling}) => {
|
|||
};
|
||||
|
||||
const BillingSection = ({defaultCardLast4, isComplimentary}) => {
|
||||
const {action} = useContext(AppContext);
|
||||
const label = action === 'editBilling:running' ? (
|
||||
<LoaderIcon className='' />
|
||||
) : 'Update';
|
||||
if (isComplimentary) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<section>
|
||||
<div className='gh-portal-list-detail'>
|
||||
<h3>Billing Info</h3>
|
||||
<CardLabel defaultCardLast4={defaultCardLast4} />
|
||||
</div>
|
||||
<button className='gh-portal-btn gh-portal-btn-list' onClick={e => onEditBilling(e)}>Update</button>
|
||||
<button className='gh-portal-btn gh-portal-btn-list' onClick={e => onEditBilling(e)}>{label}</button>
|
||||
</section>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue