feat: remove all donation options on /donate but $5 (#40309)

This commit is contained in:
Ahmad Abdolsaheb
2020-11-25 06:00:12 +03:00
committed by GitHub
parent 79e3cb51e5
commit 00849387c0
4 changed files with 27 additions and 14 deletions

View File

@ -234,6 +234,20 @@ class DonateForm extends Component {
)); ));
} }
renderDonationDescription() {
const { donationAmount, donationDuration } = this.state;
return (
<p className='donation-description'>
{`Your `}
{this.getFormatedAmountLabel(donationAmount)}
{` donation will provide `}
{this.convertToTimeContributed(donationAmount)}
{` of learning to people around the world`}
{donationDuration === 'onetime' ? `.` : ` each ${donationDuration}.`}
</p>
);
}
renderDurationAmountOptions() { renderDurationAmountOptions() {
const { donationAmount, donationDuration, processing } = this.state; const { donationAmount, donationDuration, processing } = this.state;
return !processing ? ( return !processing ? (
@ -267,14 +281,7 @@ class DonateForm extends Component {
{this.renderAmountButtons(duration)} {this.renderAmountButtons(duration)}
</ToggleButtonGroup> </ToggleButtonGroup>
<Spacer /> <Spacer />
<p className='donation-description'> {this.renderDonationDescription()}
{`Your `}
{this.getFormatedAmountLabel(donationAmount)}
{` donation will provide `}
{this.convertToTimeContributed(donationAmount)}
{` of learning to people around the world`}
{duration === 'onetime' ? `.` : ` each ${duration}.`}
</p>
</div> </div>
</Tab> </Tab>
))} ))}
@ -383,7 +390,7 @@ class DonateForm extends Component {
renderPageForm() { renderPageForm() {
return ( return (
<Row> <Row>
<Col xs={12}>{this.renderDurationAmountOptions()}</Col> <Col xs={12}>{this.renderDonationDescription()}</Col>
<Col xs={12}>{this.renderDonationOptions()}</Col> <Col xs={12}>{this.renderDonationOptions()}</Col>
</Row> </Row>
); );

View File

@ -407,3 +407,8 @@ button#confirm-donation-btn:hover {
margin-right: auto; margin-right: auto;
} }
} }
.donate-page-wrapper .alert.alert-info a:hover {
color: #327290;
background-color: #acdef3;
}

View File

@ -101,13 +101,15 @@ export class DonatePage extends Component {
</p> </p>
<br /> <br />
<p> <p>
If you would like to make additional donations, those will You can make an additional one-time donation of any amount
help our nonprofit and our mission, too. using this link:{' '}
<a href='https://www.paypal.me/freecodecamp'>
https://www.paypal.me/freecodecamp
</a>
</p> </p>
</Alert> </Alert>
) : null} ) : null}
<DonateText isDonating={isDonating} /> <DonateText isDonating={isDonating} />
<Spacer />
<DonateForm <DonateForm
enableDonationSettingsPage={this.enableDonationSettingsPage} enableDonationSettingsPage={this.enableDonationSettingsPage}
handleProcessing={this.handleProcessing} handleProcessing={this.handleProcessing}

View File

@ -8,8 +8,7 @@ const amountsConfig = {
onetime: [2500, 5000, 7500, 10000, 15000] onetime: [2500, 5000, 7500, 10000, 15000]
}; };
const defaultAmount = { const defaultAmount = {
month: 1000, month: 500
onetime: 2500
}; };
const defaultDonation = { const defaultDonation = {
donationAmount: defaultAmount['month'], donationAmount: defaultAmount['month'],