fix: Handle goal reached 🎉
This commit is contained in:
committed by
mrugesh mohapatra
parent
1fba44f722
commit
2e578a7af8
@ -17,22 +17,33 @@ const supportersLocale = supporterGoal.toLocaleString();
|
||||
|
||||
function Supporters({ isDonating, activeDonations }) {
|
||||
const donationsLocale = activeDonations.toLocaleString();
|
||||
const isGoalReached = activeDonations >= supporterGoal;
|
||||
return (
|
||||
<Fragment>
|
||||
<FullWidthRow>
|
||||
<h2>Support an open future.</h2>
|
||||
</FullWidthRow>
|
||||
<FullWidthRow>
|
||||
<div id='supporter-progress-wrapper'>
|
||||
<ProgressBar max={10000} now={activeDonations} />
|
||||
<div id='progress-label-wrapper'>
|
||||
<span className='progress-label'>
|
||||
{donationsLocale} supporters out of {supportersLocale} supporter
|
||||
goal
|
||||
</span>
|
||||
{isGoalReached ? (
|
||||
<FullWidthRow>
|
||||
<Spacer />
|
||||
<p>
|
||||
🎉 {donationsLocale} supporters help keep freeCodeCamp.org free to
|
||||
use
|
||||
</p>
|
||||
</FullWidthRow>
|
||||
) : (
|
||||
<FullWidthRow>
|
||||
<div id='supporter-progress-wrapper'>
|
||||
<ProgressBar max={supporterGoal} now={activeDonations} />
|
||||
<div id='progress-label-wrapper'>
|
||||
<span className='progress-label'>
|
||||
{donationsLocale} supporters out of {supportersLocale} supporter
|
||||
goal
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</FullWidthRow>
|
||||
</FullWidthRow>
|
||||
)}
|
||||
<Spacer />
|
||||
<FullWidthRow>
|
||||
<b>
|
||||
|
Reference in New Issue
Block a user