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.state = {
...defaultStateConfig,
processing: false,
isDonating: this.props.isDonating,
...defaultStateConfig
isDonating: this.props.isDonating
};
this.getActiveDonationAmount = this.getActiveDonationAmount.bind(this);

View File

@ -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: {

View File

@ -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} />;
}