fix(donate): fix computed hours donated for monthly donation
Closes #37786
This commit is contained in:
committed by
mrugesh
parent
65e5b26fa1
commit
b663c39901
@ -93,12 +93,8 @@ class DonateForm extends Component {
|
|||||||
: defaultAmount[durationSelected] || this.amounts[durationSelected][0];
|
: defaultAmount[durationSelected] || this.amounts[durationSelected][0];
|
||||||
}
|
}
|
||||||
|
|
||||||
convertToTimeContributed(amount, duration) {
|
convertToTimeContributed(amount) {
|
||||||
const timeContributed =
|
return `${numToCommas((amount / 100) * 50)} hours`;
|
||||||
duration === 'month'
|
|
||||||
? Math.round(((amount / 100) * 50) / 12)
|
|
||||||
: (amount / 100) * 50;
|
|
||||||
return `${numToCommas(timeContributed)} hours`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getFormatedAmountLabel(amount) {
|
getFormatedAmountLabel(amount) {
|
||||||
@ -184,7 +180,7 @@ class DonateForm extends Component {
|
|||||||
{`Your `}
|
{`Your `}
|
||||||
{this.getFormatedAmountLabel(donationAmount)}
|
{this.getFormatedAmountLabel(donationAmount)}
|
||||||
{` donation will provide `}
|
{` donation will provide `}
|
||||||
{this.convertToTimeContributed(donationAmount, duration)}
|
{this.convertToTimeContributed(donationAmount)}
|
||||||
{` of learning to people around the world`}
|
{` of learning to people around the world`}
|
||||||
{duration === 'onetime' ? `.` : ` each ${duration}.`}
|
{duration === 'onetime' ? `.` : ` each ${duration}.`}
|
||||||
</p>
|
</p>
|
||||||
|
Reference in New Issue
Block a user