feat(client): migrate donate module to ts (#42561)

* change DonationTextComponent extension to tsx

* migrate DonationTextComponents to ts

* change DonationModal extension to tsx

* add @types/react-redux

* migrate DonationModal to ts

* change PaypalButton extension to ts

* change DonateCompletion extension to tsx

* migrate DonateCompletion to TypeScript

* change PayPalButtonLoader extension to tsx

* first changes in paypal button (help needed)

* first changes in PayPalButtonScriptLoader (help needed)

* change DonateForm extension to tsx

* migrate donate module to ts

* Update client/src/components/Donation/DonateForm.tsx

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>

* Update client/src/components/Donation/DonationModal.tsx

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>

* Update client/src/components/Donation/DonationModal.tsx

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>

* Update client/src/components/Donation/DonateForm.tsx

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>

* Update client/src/components/Donation/DonateForm.tsx

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>

* Delete console.log client/src/components/Donation/DonationModal.tsx

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>

* applied changes requested

* fix: readjust default one time amount

* fix types

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>

* chore: restore comments.json

* fix: type assertion

* fix: specific DonateForm props

* Apply suggestions from code review

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>

* Update client/src/components/Donation/PaypalButton.tsx

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>

* fix:set default stat for paypalbutton

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>
This commit is contained in:
Nicolás Restrepo
2021-08-04 06:21:11 -04:00
committed by GitHub
parent 8886a9396c
commit e34ec814ef
12 changed files with 467 additions and 239 deletions

View File

@ -8,7 +8,8 @@ const amountsConfig = {
onetime: [2500, 5000, 7500, 10000, 15000]
};
const defaultAmount = {
month: 500
month: 500,
onetime: 7500
};
const defaultDonation = {
donationAmount: defaultAmount['month'],
@ -75,7 +76,7 @@ const paypalConfigTypes = {
const paypalConfigurator = (donationAmount, donationDuration, paypalConfig) => {
if (donationDuration === 'onetime') {
return { amount: donationAmount, duration: donationDuration };
return { amount: donationAmount, duration: donationDuration, planId: null };
}
return {
amount: donationAmount,