From b663c399015b99d1c2124814a17042e0aa2ce5c8 Mon Sep 17 00:00:00 2001 From: Mrugesh Mohapatra Date: Wed, 20 Nov 2019 11:55:35 +0530 Subject: [PATCH] fix(donate): fix computed hours donated for monthly donation Closes #37786 --- .../src/components/Donation/components/DonateForm.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/client/src/components/Donation/components/DonateForm.js b/client/src/components/Donation/components/DonateForm.js index cec6f5774d..d61dfa074e 100644 --- a/client/src/components/Donation/components/DonateForm.js +++ b/client/src/components/Donation/components/DonateForm.js @@ -93,12 +93,8 @@ class DonateForm extends Component { : defaultAmount[durationSelected] || this.amounts[durationSelected][0]; } - convertToTimeContributed(amount, duration) { - const timeContributed = - duration === 'month' - ? Math.round(((amount / 100) * 50) / 12) - : (amount / 100) * 50; - return `${numToCommas(timeContributed)} hours`; + convertToTimeContributed(amount) { + return `${numToCommas((amount / 100) * 50)} hours`; } getFormatedAmountLabel(amount) { @@ -184,7 +180,7 @@ class DonateForm extends Component { {`Your `} {this.getFormatedAmountLabel(donationAmount)} {` donation will provide `} - {this.convertToTimeContributed(donationAmount, duration)} + {this.convertToTimeContributed(donationAmount)} {` of learning to people around the world`} {duration === 'onetime' ? `.` : ` each ${duration}.`}