diff --git a/client/src/client-only-routes/ShowSettings.js b/client/src/client-only-routes/ShowSettings.js index dbc05d52c1..82b90cbb9f 100644 --- a/client/src/client-only-routes/ShowSettings.js +++ b/client/src/client-only-routes/ShowSettings.js @@ -24,6 +24,7 @@ import Portfolio from '../components/settings/Portfolio'; import Honesty from '../components/settings/Honesty'; import Certification from '../components/settings/Certification'; import DangerZone from '../components/settings/DangerZone'; +import SectionHeader from '../components/settings/SectionHeader.js'; const propTypes = { createFlashMessage: PropTypes.func.isRequired, @@ -54,6 +55,7 @@ const propTypes = { isApisMicroservicesCert: PropTypes.bool, isBackEndCert: PropTypes.bool, isDataVisCert: PropTypes.bool, + isDonating: PropTypes.bool, isEmailVerified: PropTypes.bool, isFrontEndCert: PropTypes.bool, isFrontEndLibsCert: PropTypes.bool, @@ -122,6 +124,7 @@ export function ShowSettings(props) { user: { completedChallenges, email, + isDonating, is2018DataVisCert, isApisMicroservicesCert, isJsAlgoDataStructCert, @@ -161,7 +164,7 @@ export function ShowSettings(props) { return ; } - if (!showLoading && !isSignedIn) { + if (!isSignedIn) { navigate(`${apiLocation}/signin?returnTo=settings`); return ; } @@ -215,6 +218,20 @@ export function ShowSettings(props) { updateQuincyEmail={updateQuincyEmail} /> + {isDonating ? ( +
+ Donation Settings + + + Manage your existing donations + + + +
+ ) : null} a { [name='payment-method'] { font-family: 'Lato', sans-serif; } +.servicebot-embed-panel .panel { + padding: 20px; +} diff --git a/client/src/components/Intro/index.js b/client/src/components/Intro/index.js index 2507f2b04e..4c88dbce70 100644 --- a/client/src/components/Intro/index.js +++ b/client/src/components/Intro/index.js @@ -57,7 +57,7 @@ function Intro({ View my Portfolio - Update my settings + Update my account settings diff --git a/client/src/components/profile/Profile.js b/client/src/components/profile/Profile.js index 018ec31d37..4369b8fc2f 100644 --- a/client/src/components/profile/Profile.js +++ b/client/src/components/profile/Profile.js @@ -175,7 +175,7 @@ function Profile({ user, isSessionUser, navigate }) { {isSessionUser ? ( - Update my settings + Update my account settings - + + + + + + + + +

+ Manage your existing donation +

+
+ {[ + `Update your existing donation`, + `Download donation receipts` + ].map(donationSettingOps => ( + + {donationSettingOps} + + ))}
- ))} - -
- - - - -
+ + + + + + + + + ); diff --git a/client/src/pages/donation/settings.js b/client/src/pages/donation/settings.js index 090cf3cdac..94b6c08bc2 100644 --- a/client/src/pages/donation/settings.js +++ b/client/src/pages/donation/settings.js @@ -3,7 +3,7 @@ import Helmet from 'react-helmet'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { createSelector } from 'reselect'; -import { Grid, Row, Col, Button } from '@freecodecamp/react-bootstrap'; +import { Grid, Button, Panel } from '@freecodecamp/react-bootstrap'; import { uniq } from 'lodash'; import { apiLocation } from '../../../config/env.json'; @@ -16,7 +16,8 @@ import { } from '../../redux'; // eslint-disable-next-line max-len import DonateServicebotEmbed from '../../components/Donation/components/DonateServicebotEmbed'; -import { Loader, Spacer, Link } from '../../components/helpers'; +import { Loader, Spacer, Link, FullWidthRow } from '../../components/helpers'; +import SectionHeader from '../../components/settings/SectionHeader.js'; const propTypes = { donationEmails: PropTypes.array, @@ -85,36 +86,39 @@ export class DonationSettingsPage extends Component { renderServicebotEmbed() { const { currentSettingsEmail, hash } = this.state; - if (!hash || !currentSettingsEmail) { - return null; - } return ( -
- - +
+ {!hash || !currentSettingsEmail ? ( + + +

+ Select the email associated to your donations above. +

+
+ ) : ( + + + + + + )}
); } renderDonationEmailsList() { const { donationEmails } = this.props; - return ( -
- {uniq(donationEmails).map(email => ( -
- - -
- ))} -
- ); + return uniq(donationEmails).map(email => ( + + )); } render() { @@ -138,38 +142,42 @@ export class DonationSettingsPage extends Component { - - - - - - - - + + + Update my account settings + + + +

Manage your donations

- -

- Donations made using a credit or debit card -

- -
- - + + + + + Donations made using a credit or debit card + + {this.renderDonationEmailsList()} - - - - - {this.renderServicebotEmbed()} - - - - -
-

Donations made using PayPal

+ + + {this.renderServicebotEmbed()} + + + Donations made using PayPal +

You can update your PayPal donation{' '} .

- -
- - -
-

Still need help?

+ + + + Still need help? +

If you can't see your donation here, forward a donation receipt you have recieved in your email to team@freeCodeCamp.org and tell us how we can help you with it.

- - -
+ + + +
);