fix(donate): apply suggestions from code review

Co-Authored-By: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
mrugesh
2019-11-19 23:56:30 +05:30
committed by Mrugesh Mohapatra
parent 0bd66eaf82
commit 62aa54efba
3 changed files with 8 additions and 8 deletions

View File

@ -73,9 +73,9 @@ class DonateForm extends Component {
this.amounts = amountsConfig; this.amounts = amountsConfig;
this.state = { this.state = {
...defaultStateConfig,
processing: false, processing: false,
isDonating: this.props.isDonating, isDonating: this.props.isDonating
...defaultStateConfig
}; };
this.getActiveDonationAmount = this.getActiveDonationAmount.bind(this); this.getActiveDonationAmount = this.getActiveDonationAmount.bind(this);

View File

@ -37,7 +37,7 @@ export class DonationServicebotEmbed extends Component {
disableCoupon: true, disableCoupon: true,
forceCard: true, forceCard: true,
disableTiers: [ disableTiers: [
'Monthly $10 Donation - Unavailable', 'Monthly $10 Donation - Unavailable',
'Monthly $3 Donation - Unavailable' 'Monthly $3 Donation - Unavailable'
], ],
card: { card: {

View File

@ -85,7 +85,7 @@ export class DonationSettingsPage extends Component {
renderServicebotEmbed() { renderServicebotEmbed() {
const { currentSettingsEmail, hash } = this.state; const { currentSettingsEmail, hash } = this.state;
if (!hash && !currentSettingsEmail) { if (!hash || !currentSettingsEmail) {
return null; return null;
} }
return ( return (
@ -100,8 +100,8 @@ export class DonationSettingsPage extends Component {
const { donationEmails } = this.props; const { donationEmails } = this.props;
return ( return (
<div> <div>
{uniq(donationEmails).map((email, index) => ( {uniq(donationEmails).map(email => (
<div key={email + '-' + index}> <div key={email}>
<Button <Button
bsStyle='primary' bsStyle='primary'
className='btn btn-block' className='btn btn-block'
@ -124,12 +124,12 @@ export class DonationSettingsPage extends Component {
return <Loader fullScreen={true} />; return <Loader fullScreen={true} />;
} }
if (!showLoading && !isSignedIn) { if (!isSignedIn) {
navigate(`${apiLocation}/signin?returnTo=donation/settings`); navigate(`${apiLocation}/signin?returnTo=donation/settings`);
return <Loader fullScreen={true} />; return <Loader fullScreen={true} />;
} }
if (!showLoading && !isDonating) { if (!isDonating) {
navigate(`/donate`); navigate(`/donate`);
return <Loader fullScreen={true} />; return <Loader fullScreen={true} />;
} }