From e8578341b509170caff411fce7d48224316ba879 Mon Sep 17 00:00:00 2001 From: Shaun Hamilton <51722130+ShaunSHamilton@users.noreply.github.com> Date: Thu, 6 May 2021 19:45:19 +0100 Subject: [PATCH] feat(client): add quick superblock cert claim steps (#42031) * feat(client): add quick superblock cert claim steps * remove comments --- client/i18n/locales/english/translations.json | 9 +++ client/src/components/settings/Honesty.js | 2 +- client/src/components/settings/Privacy.js | 2 +- .../__snapshots__/Honesty.test.js.snap | 2 + .../Introduction/components/CertChallenge.js | 5 ++ .../components/CertificationCard.js | 64 +++++++++++++++++++ .../Introduction/components/ClaimCertSteps.js | 51 +++++++++++++++ 7 files changed, 133 insertions(+), 2 deletions(-) create mode 100644 client/src/templates/Introduction/components/CertificationCard.js create mode 100644 client/src/templates/Introduction/components/ClaimCertSteps.js diff --git a/client/i18n/locales/english/translations.json b/client/i18n/locales/english/translations.json index 15bd0852f0..5f5ef43830 100644 --- a/client/i18n/locales/english/translations.json +++ b/client/i18n/locales/english/translations.json @@ -554,5 +554,14 @@ "Neural Network SMS Text Classifier": "Neural Network SMS Text Classifier" } } + }, + "certification-card": { + "title": "Steps to Claim Your Certification", + "intro": "Complete the following steps to claim and view your {{i18nCertText}}", + "complete-project": "Complete {{i18nCertText}} Projects", + "accept-honesty": "Accept our Academic Honesty Policy", + "set-name": "Set your name, and make it public", + "set-certs-public": "Set your certificication settings to public", + "set-profile-public": "Set your profile settings to public" } } diff --git a/client/src/components/settings/Honesty.js b/client/src/components/settings/Honesty.js index 2ff6948629..90ddd2c33f 100644 --- a/client/src/components/settings/Honesty.js +++ b/client/src/components/settings/Honesty.js @@ -35,7 +35,7 @@ const Honesty = ({ isHonest, updateIsHonest }) => { ); return ( -
+
{t('settings.headings.honesty')} diff --git a/client/src/components/settings/Privacy.js b/client/src/components/settings/Privacy.js index b0f1d745c2..0e34243975 100644 --- a/client/src/components/settings/Privacy.js +++ b/client/src/components/settings/Privacy.js @@ -66,7 +66,7 @@ class PrivacySettings extends Component { } = user.profileUI; return ( -
+
{t('settings.headings.privacy')}

{t('settings.privacy')}

diff --git a/client/src/components/settings/__snapshots__/Honesty.test.js.snap b/client/src/components/settings/__snapshots__/Honesty.test.js.snap index c88fda569d..9e6d5accbd 100644 --- a/client/src/components/settings/__snapshots__/Honesty.test.js.snap +++ b/client/src/components/settings/__snapshots__/Honesty.test.js.snap @@ -3,6 +3,7 @@ exports[` snapshot when isHonest is false: Honesty 1`] = `
settings.headings.honesty @@ -31,6 +32,7 @@ exports[` snapshot when isHonest is false: Honesty 1`] = exports[` snapshot when isHonest is true: HonestyAccepted 1`] = `
settings.headings.honesty diff --git a/client/src/templates/Introduction/components/CertChallenge.js b/client/src/templates/Introduction/components/CertChallenge.js index 06399bffd0..7de9812419 100644 --- a/client/src/templates/Introduction/components/CertChallenge.js +++ b/client/src/templates/Introduction/components/CertChallenge.js @@ -15,6 +15,7 @@ import { certSlugTypeMap, superBlockCertTypeMap } from '../../../../../config/certification-settings'; +import CertificationCard from './CertificationCard'; const propTypes = { currentCerts: CurrentCertsType, @@ -57,6 +58,10 @@ export class CertChallenge extends Component { return (
+ + {isExpanded && ( + + )} +
+ + ); +}; + +CertificationCard.displayName = 'CertStatus'; +CertificationCard.propTypes = propTypes; + +export default CertificationCard; diff --git a/client/src/templates/Introduction/components/ClaimCertSteps.js b/client/src/templates/Introduction/components/ClaimCertSteps.js new file mode 100644 index 0000000000..50ed1bc58d --- /dev/null +++ b/client/src/templates/Introduction/components/ClaimCertSteps.js @@ -0,0 +1,51 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { Link } from 'gatsby'; +import { withTranslation, useTranslation } from 'react-i18next'; + +const propTypes = { + i18nCertText: PropTypes.string, + superBlock: PropTypes.string +}; + +const ClaimCertSteps = ({ i18nCertText, superBlock }) => { + const { t } = useTranslation(); + + const settingsLink = '/settings#privacy-settings'; + const honestyPolicyAnchor = '/settings#honesty-policy'; + + return ( + + ); +}; + +ClaimCertSteps.displayName = 'ClaimCertSteps'; +ClaimCertSteps.propTypes = propTypes; + +export default withTranslation()(ClaimCertSteps);