fix(donate): apply suggestions from code review
Co-Authored-By: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
0bd66eaf82
commit
62aa54efba
@ -73,9 +73,9 @@ class DonateForm extends Component {
|
||||
this.amounts = amountsConfig;
|
||||
|
||||
this.state = {
|
||||
...defaultStateConfig,
|
||||
processing: false,
|
||||
isDonating: this.props.isDonating,
|
||||
...defaultStateConfig
|
||||
isDonating: this.props.isDonating
|
||||
};
|
||||
|
||||
this.getActiveDonationAmount = this.getActiveDonationAmount.bind(this);
|
||||
|
@ -37,7 +37,7 @@ export class DonationServicebotEmbed extends Component {
|
||||
disableCoupon: true,
|
||||
forceCard: true,
|
||||
disableTiers: [
|
||||
'Monthly $10 Donation - Unavailable',
|
||||
'Monthly $10 Donation - Unavailable',
|
||||
'Monthly $3 Donation - Unavailable'
|
||||
],
|
||||
card: {
|
||||
|
@ -85,7 +85,7 @@ export class DonationSettingsPage extends Component {
|
||||
|
||||
renderServicebotEmbed() {
|
||||
const { currentSettingsEmail, hash } = this.state;
|
||||
if (!hash && !currentSettingsEmail) {
|
||||
if (!hash || !currentSettingsEmail) {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
@ -100,8 +100,8 @@ export class DonationSettingsPage extends Component {
|
||||
const { donationEmails } = this.props;
|
||||
return (
|
||||
<div>
|
||||
{uniq(donationEmails).map((email, index) => (
|
||||
<div key={email + '-' + index}>
|
||||
{uniq(donationEmails).map(email => (
|
||||
<div key={email}>
|
||||
<Button
|
||||
bsStyle='primary'
|
||||
className='btn btn-block'
|
||||
@ -124,12 +124,12 @@ export class DonationSettingsPage extends Component {
|
||||
return <Loader fullScreen={true} />;
|
||||
}
|
||||
|
||||
if (!showLoading && !isSignedIn) {
|
||||
if (!isSignedIn) {
|
||||
navigate(`${apiLocation}/signin?returnTo=donation/settings`);
|
||||
return <Loader fullScreen={true} />;
|
||||
}
|
||||
|
||||
if (!showLoading && !isDonating) {
|
||||
if (!isDonating) {
|
||||
navigate(`/donate`);
|
||||
return <Loader fullScreen={true} />;
|
||||
}
|
||||
|
Reference in New Issue
Block a user