From 21b09b53cbfd475cfb31f50b3cb0cecc7519b79a Mon Sep 17 00:00:00 2001
From: Mrugesh Mohapatra
Date: Tue, 19 Nov 2019 14:39:56 +0530
Subject: [PATCH] fix(donate): adjust verbiage and time contibuted
---
.../components/Donation/components/DonateForm.js | 15 +++++++++------
.../components/Donation/components/DonateText.js | 2 +-
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/client/src/components/Donation/components/DonateForm.js b/client/src/components/Donation/components/DonateForm.js
index 630dd50780..257637a67b 100644
--- a/client/src/components/Donation/components/DonateForm.js
+++ b/client/src/components/Donation/components/DonateForm.js
@@ -96,8 +96,12 @@ class DonateForm extends Component {
: this.amounts[durationSelected][0];
}
- convertToTimeContributed(amount) {
- return `${numToCommas((amount / 100) * 50 * 60)} minutes`;
+ convertToTimeContributed(amount, duration) {
+ const timeContributed =
+ duration === 'month'
+ ? Math.round(((amount / 100) * 50) / 12)
+ : (amount / 100) * 50;
+ return `${numToCommas(timeContributed)} hours`;
}
getFormatedAmountLabel(amount) {
@@ -183,10 +187,9 @@ class DonateForm extends Component {
{`Your `}
{this.getFormatedAmountLabel(donationAmount)}
{` donation will provide `}
- {this.convertToTimeContributed(donationAmount)}
- {` of learning to people around the world `}
- {duration === 'one-time' ? `for one ` : `each `}
- {duration === 'monthly' ? `month.` : `year.`}
+ {this.convertToTimeContributed(donationAmount, duration)}
+ {` of learning to people around the world`}
+ {duration === 'onetime' ? `.` : ` each ${duration}.`}
diff --git a/client/src/components/Donation/components/DonateText.js b/client/src/components/Donation/components/DonateText.js
index 4856e5c87f..9e54c8e24f 100644
--- a/client/src/components/Donation/components/DonateText.js
+++ b/client/src/components/Donation/components/DonateText.js
@@ -7,7 +7,7 @@ const DonateText = () => {
freeCodeCamp is a highly efficient education nonprofit.
- In 2019 alone, we provided 1,100,000,000 minutes of free education to
+ In 2019 alone, we provided 18 million hours of free education to
people around the world.