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

pull/40312/head
Ahmad Abdolsaheb 2020-11-25 06:00:12 +03:00 committed by GitHub
parent 79e3cb51e5
commit 00849387c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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() {
const { donationAmount, donationDuration, processing } = this.state;
return !processing ? (
@ -267,14 +281,7 @@ class DonateForm extends Component {
{this.renderAmountButtons(duration)}
</ToggleButtonGroup>
<Spacer />
<p className='donation-description'>
{`Your `}
{this.getFormatedAmountLabel(donationAmount)}
{` donation will provide `}
{this.convertToTimeContributed(donationAmount)}
{` of learning to people around the world`}
{duration === 'onetime' ? `.` : ` each ${duration}.`}
</p>
{this.renderDonationDescription()}
</div>
</Tab>
))}
@ -383,7 +390,7 @@ class DonateForm extends Component {
renderPageForm() {
return (
<Row>
<Col xs={12}>{this.renderDurationAmountOptions()}</Col>
<Col xs={12}>{this.renderDonationDescription()}</Col>
<Col xs={12}>{this.renderDonationOptions()}</Col>
</Row>
);

View File

@ -407,3 +407,8 @@ button#confirm-donation-btn:hover {
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>
<br />
<p>
If you would like to make additional donations, those will
help our nonprofit and our mission, too.
You can make an additional one-time donation of any amount
using this link:{' '}
<a href='https://www.paypal.me/freecodecamp'>
https://www.paypal.me/freecodecamp
</a>
</p>
</Alert>
) : null}
<DonateText isDonating={isDonating} />
<Spacer />
<DonateForm
enableDonationSettingsPage={this.enableDonationSettingsPage}
handleProcessing={this.handleProcessing}

View File

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