committed by
mrugesh
parent
c25fa49b5b
commit
65e5b26fa1
@ -16,6 +16,7 @@ import { StripeProvider, Elements } from 'react-stripe-elements';
|
|||||||
import {
|
import {
|
||||||
amountsConfig,
|
amountsConfig,
|
||||||
durationsConfig,
|
durationsConfig,
|
||||||
|
defaultAmount,
|
||||||
defaultStateConfig
|
defaultStateConfig
|
||||||
} from '../../../../../config/donation-settings';
|
} from '../../../../../config/donation-settings';
|
||||||
import { apiLocation } from '../../../../config/env.json';
|
import { apiLocation } from '../../../../config/env.json';
|
||||||
@ -89,7 +90,7 @@ class DonateForm extends Component {
|
|||||||
getActiveDonationAmount(durationSelected, amountSelected) {
|
getActiveDonationAmount(durationSelected, amountSelected) {
|
||||||
return this.amounts[durationSelected].includes(amountSelected)
|
return this.amounts[durationSelected].includes(amountSelected)
|
||||||
? amountSelected
|
? amountSelected
|
||||||
: this.amounts[durationSelected][0];
|
: defaultAmount[durationSelected] || this.amounts[durationSelected][0];
|
||||||
}
|
}
|
||||||
|
|
||||||
convertToTimeContributed(amount, duration) {
|
convertToTimeContributed(amount, duration) {
|
||||||
|
@ -9,8 +9,13 @@ const amountsConfig = {
|
|||||||
month: [5000, 3500, 500],
|
month: [5000, 3500, 500],
|
||||||
onetime: [100000, 25000, 3500]
|
onetime: [100000, 25000, 3500]
|
||||||
};
|
};
|
||||||
|
const defaultAmount = {
|
||||||
|
year: 25000,
|
||||||
|
month: 3500,
|
||||||
|
onetime: 25000
|
||||||
|
};
|
||||||
const defaultStateConfig = {
|
const defaultStateConfig = {
|
||||||
donationAmount: 5000,
|
donationAmount: defaultAmount['month'],
|
||||||
donationDuration: 'month',
|
donationDuration: 'month',
|
||||||
paymentType: 'Card'
|
paymentType: 'Card'
|
||||||
};
|
};
|
||||||
@ -32,6 +37,7 @@ const donationSubscriptionConfig = {
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
durationsConfig,
|
durationsConfig,
|
||||||
amountsConfig,
|
amountsConfig,
|
||||||
|
defaultAmount,
|
||||||
defaultStateConfig,
|
defaultStateConfig,
|
||||||
durationKeysConfig,
|
durationKeysConfig,
|
||||||
donationOneTimeConfig,
|
donationOneTimeConfig,
|
||||||
|
Reference in New Issue
Block a user