From ba40dbddbb4d21f7257a8c4ad20a1d9941f68d40 Mon Sep 17 00:00:00 2001 From: Manabu Matsumoto Date: Wed, 15 Mar 2023 21:31:56 +0900 Subject: [PATCH] fix(UI): remove the ButtonSpacer (#49480) Co-authored-by: Muhammed Mustafa Co-authored-by: Ahmad Abdolsaheb --- .../client-only-routes/show-certification.tsx | 14 +++++----- .../client-only-routes/show-project-links.tsx | 4 +-- .../src/client-only-routes/show-settings.tsx | 18 ++++++------- .../client-only-routes/show-unsubscribed.tsx | 6 ++--- client/src/client-only-routes/show-user.tsx | 10 +++---- .../src/components/Donation/donate-form.tsx | 2 +- .../components/Donation/donation-modal.tsx | 4 +-- client/src/components/FourOhFour/index.tsx | 8 +++--- .../Intro/components/IntroDescription.tsx | 2 +- client/src/components/Intro/index.tsx | 18 ++++++------- client/src/components/Map/index.tsx | 2 +- .../src/components/helpers/button-spacer.tsx | 9 ------- client/src/components/helpers/index.ts | 1 - client/src/components/helpers/spacer.tsx | 22 +++++----------- .../landing/components/certifications.tsx | 4 +-- .../landing/components/landing-top.tsx | 6 ++--- .../__snapshots__/profile.test.tsx.snap | 4 +++ .../profile/components/certifications.tsx | 6 ++--- .../profile/components/heat-map.tsx | 4 +-- client/src/components/profile/profile.tsx | 12 ++++----- .../settings-button.test.js.snap | 15 +++++++++++ client/src/components/settings/about.tsx | 4 +-- .../src/components/settings/certification.js | 6 ++--- .../src/components/settings/danger-zone.tsx | 8 +++--- .../src/components/settings/delete-modal.tsx | 4 +-- client/src/components/settings/email.tsx | 2 +- client/src/components/settings/portfolio.tsx | 12 ++++----- client/src/components/settings/privacy.tsx | 2 +- .../src/components/settings/reset-modal.tsx | 4 +-- client/src/components/settings/sound.tsx | 2 +- .../components/settings/toggle-setting.tsx | 4 +-- client/src/components/settings/user-token.tsx | 8 +++--- client/src/components/signout-modal/index.tsx | 4 +-- .../__snapshots__/email-sign-up.test.js.snap | 11 ++++++-- client/src/pages/blocked.tsx | 6 ++--- client/src/pages/donate.tsx | 10 +++---- client/src/pages/email-sign-up.tsx | 18 ++++++------- client/src/pages/learn.tsx | 2 +- client/src/pages/update-email.tsx | 2 +- .../templates/Challenges/codeally/show.tsx | 26 +++++++++---------- client/src/templates/Challenges/odin/Show.tsx | 16 ++++++------ .../Challenges/projects/backend/Show.tsx | 4 +-- .../Challenges/projects/frontend/Show.tsx | 4 +-- .../src/templates/Challenges/video/Show.tsx | 10 +++---- .../Introduction/components/block.tsx | 2 +- .../components/super-block-intro.tsx | 4 +-- client/src/templates/Introduction/intro.tsx | 6 ++--- .../Introduction/super-block-intro.tsx | 14 +++++----- 48 files changed, 187 insertions(+), 179 deletions(-) delete mode 100644 client/src/components/helpers/button-spacer.tsx diff --git a/client/src/client-only-routes/show-certification.tsx b/client/src/client-only-routes/show-certification.tsx index 3ccbe646e1c..541199ecc14 100644 --- a/client/src/client-only-routes/show-certification.tsx +++ b/client/src/client-only-routes/show-certification.tsx @@ -240,7 +240,7 @@ const ShowCertification = (props: ShowCertificationProps): JSX.Element => { const donationSection = (
- + {!isDonationSubmitted && ( @@ -263,7 +263,7 @@ const ShowCertification = (props: ShowCertificationProps): JSX.Element => { {isDonationSubmitted && donationCloseBtn} - +
); @@ -281,7 +281,7 @@ const ShowCertification = (props: ShowCertificationProps): JSX.Element => { > {t('profile.add-linkedin')} - + - + ); @@ -365,11 +365,11 @@ const ShowCertification = (props: ShowCertificationProps): JSX.Element => {
- + {signedInUserName === username ? shareCertBtns : ''} - + - +
); diff --git a/client/src/client-only-routes/show-project-links.tsx b/client/src/client-only-routes/show-project-links.tsx index 94d8a603759..dc2589111bf 100644 --- a/client/src/client-only-routes/show-project-links.tsx +++ b/client/src/client-only-routes/show-project-links.tsx @@ -160,7 +160,7 @@ const ShowProjectLinks = (props: ShowProjectLinksProps): JSX.Element => { : 'certification.project.heading', { user: name } )} - + @@ -170,7 +170,7 @@ const ShowProjectLinks = (props: ShowProjectLinksProps): JSX.Element => { {renderProjectsFor(certName)}
- +
- +

{t('settings.for', { username: username })}

@@ -180,16 +180,16 @@ export function ShowSettings(props: ShowSettingsProps): JSX.Element { toggleKeyboardShortcuts={toggleKeyboardShortcuts} username={username} /> - + - + - + - + {/* @ts-expect-error Portfolio types mismatch */} - + - + {userToken && ( <> - + )} - +
diff --git a/client/src/client-only-routes/show-unsubscribed.tsx b/client/src/client-only-routes/show-unsubscribed.tsx index 0ddd3c02482..ff809f2174e 100644 --- a/client/src/client-only-routes/show-unsubscribed.tsx +++ b/client/src/client-only-routes/show-unsubscribed.tsx @@ -23,9 +23,9 @@ function ShowUnsubscribed({
- + - +

{t('misc.unsubscribed')}

{t('misc.keep-coding')}

@@ -42,7 +42,7 @@ function ShowUnsubscribed({
) : null} - +
diff --git a/client/src/client-only-routes/show-user.tsx b/client/src/client-only-routes/show-user.tsx index 7379587ecab..c02611d92f2 100644 --- a/client/src/client-only-routes/show-user.tsx +++ b/client/src/client-only-routes/show-user.tsx @@ -83,7 +83,7 @@ function ShowUser({ return (
- + @@ -91,11 +91,11 @@ function ShowUser({ - + {t('buttons.click-here')} - + @@ -108,7 +108,7 @@ function ShowUser({ {t('report.portfolio')} | freeCodeCamp.org - +

{t('report.portfolio-2', { username: username })}

@@ -135,7 +135,7 @@ function ShowUser({ - +
diff --git a/client/src/components/Donation/donate-form.tsx b/client/src/components/Donation/donate-form.tsx index 164cf6f6fc7..4c80ed60dda 100644 --- a/client/src/components/Donation/donate-form.tsx +++ b/client/src/components/Donation/donate-form.tsx @@ -273,7 +273,7 @@ class DonateForm extends Component { {this.getDonationButtonLabel()}: - +
diff --git a/client/src/components/Donation/donation-modal.tsx b/client/src/components/Donation/donation-modal.tsx index aad2237c521..73e2bc3ce9f 100644 --- a/client/src/components/Donation/donation-modal.tsx +++ b/client/src/components/Donation/donation-modal.tsx @@ -134,7 +134,7 @@ function DonateModal({ > {donationText} - + - + - + { /> - +
diff --git a/client/src/components/profile/profile.tsx b/client/src/components/profile/profile.tsx index f03da622751..bf4352078ed 100644 --- a/client/src/components/profile/profile.tsx +++ b/client/src/components/profile/profile.tsx @@ -29,7 +29,7 @@ function renderMessage(

{t('profile.you-change-privacy')}

- + ) : ( <> @@ -43,7 +43,7 @@ function renderMessage( {t('profile.username-change-privacy', { username: username })}

- + ); } @@ -103,7 +103,7 @@ function renderProfile(user: ProfileProps['user']): JSX.Element { {showTimeLine ? ( ) : null} - + ); } @@ -120,9 +120,9 @@ function Profile({ user, isSessionUser }: ProfileProps): JSX.Element { {t('buttons.profile')} | freeCodeCamp.org - + - + {isLocked ? renderMessage(isSessionUser, username, t) : null} {!isLocked || isSessionUser ? renderProfile(user) : null} {isSessionUser ? null : ( @@ -132,7 +132,7 @@ function Profile({ user, isSessionUser }: ProfileProps): JSX.Element { )} - + ); diff --git a/client/src/components/settings/__snapshots__/settings-button.test.js.snap b/client/src/components/settings/__snapshots__/settings-button.test.js.snap index 078295f084b..219bb0227aa 100644 --- a/client/src/components/settings/__snapshots__/settings-button.test.js.snap +++ b/client/src/components/settings/__snapshots__/settings-button.test.js.snap @@ -9,6 +9,7 @@ Array [ className="col-sm-8 col-sm-offset-2 col-xs-12" >
{ return ( <> - + {t('settings.headings.personal-info')}
@@ -271,7 +271,7 @@ class AboutSettings extends Component {
- + - +

{t(`certification.title.${certName}`, certName)}

@@ -345,7 +345,7 @@ export class CertificationSettings extends Component { }; return ( - +

{t('certification.title.Legacy Full Stack Certification')}

@@ -403,7 +403,7 @@ export class CertificationSettings extends Component { )}
- + ); }; diff --git a/client/src/components/settings/danger-zone.tsx b/client/src/components/settings/danger-zone.tsx index c795c269e9c..5e8a86bb12f 100644 --- a/client/src/components/settings/danger-zone.tsx +++ b/client/src/components/settings/danger-zone.tsx @@ -6,7 +6,7 @@ import { bindActionCreators } from 'redux'; import type { Dispatch } from 'redux'; import { deleteAccount, resetProgress } from '../../redux/settings/actions'; -import { FullWidthRow, ButtonSpacer, Spacer } from '../helpers'; +import { FullWidthRow, Spacer } from '../helpers'; import DeleteModal from './delete-modal'; import ResetModal from './reset-modal'; @@ -45,7 +45,7 @@ function DangerZone({ deleteAccount, resetProgress, t }: DangerZoneProps) { {t('settings.danger.heading')} - +

{t('settings.danger.be-careful')}

- + - +
diff --git a/client/src/components/settings/delete-modal.tsx b/client/src/components/settings/delete-modal.tsx index 74a6a8b4229..07128525c2c 100644 --- a/client/src/components/settings/delete-modal.tsx +++ b/client/src/components/settings/delete-modal.tsx @@ -2,7 +2,7 @@ import { Button, Modal } from '@freecodecamp/react-bootstrap'; import React from 'react'; import { Trans, useTranslation } from 'react-i18next'; -import { ButtonSpacer } from '../helpers'; +import { Spacer } from '../helpers'; import './danger-zone.css'; @@ -52,7 +52,7 @@ function DeleteModal(props: DeleteModalProps): JSX.Element { > {t('settings.danger.nevermind')} - +
- + - + {portfolio.length ? portfolio.map(this.renderPortfolio) : null} ); diff --git a/client/src/components/settings/privacy.tsx b/client/src/components/settings/privacy.tsx index ccb6ea49b27..8f2d89fb18a 100644 --- a/client/src/components/settings/privacy.tsx +++ b/client/src/components/settings/privacy.tsx @@ -161,7 +161,7 @@ function PrivacySettings({ - +

{t('settings.data')}

- +
- + ); } diff --git a/client/src/components/settings/user-token.tsx b/client/src/components/settings/user-token.tsx index 747f22aa2c2..f6e768b0b90 100644 --- a/client/src/components/settings/user-token.tsx +++ b/client/src/components/settings/user-token.tsx @@ -5,7 +5,7 @@ import { TFunction, withTranslation } from 'react-i18next'; import { connect } from 'react-redux'; import { deleteUserToken } from '../../redux/actions'; -import { ButtonSpacer, FullWidthRow, Spacer } from '../helpers'; +import { FullWidthRow, Spacer } from '../helpers'; import './user-token.css'; @@ -33,10 +33,10 @@ class UserToken extends Component { {t('user-token.title')} - +

{t('user-token.delete-p1')}

- + - +
diff --git a/client/src/components/signout-modal/index.tsx b/client/src/components/signout-modal/index.tsx index ec07cf3be54..b9c95f03c65 100644 --- a/client/src/components/signout-modal/index.tsx +++ b/client/src/components/signout-modal/index.tsx @@ -5,7 +5,7 @@ import { createSelector } from 'reselect'; import { connect } from 'react-redux'; import { useTranslation } from 'react-i18next'; -import { ButtonSpacer } from '../helpers'; +import { Spacer } from '../helpers'; import { hardGoTo as navigate, closeSignoutModal } from '../../redux/actions'; import { isSignoutModalOpenSelector } from '../../redux/selectors'; import { apiLocation } from '../../../../config/env.json'; @@ -79,7 +79,7 @@ function SignoutModal(props: SignoutModalProps): JSX.Element { > {t('signout.nevermind')} - + - + - + ); } else { return ( - + - + ); } @@ -139,7 +139,7 @@ function AcceptPrivacyTerms({ - +
@@ -147,13 +147,13 @@ function AcceptPrivacyTerms({ {t('misc.quincy')} - +

{t('misc.email-blast')}

- + {renderEmailListOptin(isSignedIn, showLoading)} - +
diff --git a/client/src/pages/learn.tsx b/client/src/pages/learn.tsx index 476858cc865..172933a5ca3 100644 --- a/client/src/pages/learn.tsx +++ b/client/src/pages/learn.tsx @@ -106,7 +106,7 @@ function LearnPage({ isDonating={isDonating} /> - + diff --git a/client/src/pages/update-email.tsx b/client/src/pages/update-email.tsx index 0b9af5fb5ba..6159dcb904e 100644 --- a/client/src/pages/update-email.tsx +++ b/client/src/pages/update-email.tsx @@ -71,7 +71,7 @@ function UpdateEmail({ isNewEmail, t, updateMyEmail }: UpdateEmailProps) { {t('misc.update-email-1')} | freeCodeCamp.org - +

{t('misc.update-email-2')}

diff --git a/client/src/templates/Challenges/codeally/show.tsx b/client/src/templates/Challenges/codeally/show.tsx index ffc594f310e..6d9c95e4c91 100644 --- a/client/src/templates/Challenges/codeally/show.tsx +++ b/client/src/templates/Challenges/codeally/show.tsx @@ -253,16 +253,16 @@ class ShowCodeAlly extends Component { - + {title} - + - + - + {isSignedIn && challengeType === challengeTypes.codeAllyCert && ( <> @@ -283,7 +283,7 @@ class ShowCodeAlly extends Component { {t('learn.complete-both-steps')}

- + {t('learn.step-1')} {(isPartiallyCompleted || isCompleted) && ( { }} /> )} - +
{t('learn.runs-in-vm')}
- + - + )} @@ -321,7 +321,7 @@ class ShowCodeAlly extends Component { challengeType === challengeTypes.codeAllyCert && ( <>
- + {t('learn.step-2')} {isCompleted && ( { }} /> )} - +
{t('learn.submit-public-url')}
- + - + { )}
- + { {videoId && ( - +
{!this.state.videoIsLoaded ? (
@@ -262,10 +262,10 @@ class ShowOdin extends Component { )} - +

{title}

- + {assignments.length > 0 && ( <> @@ -291,11 +291,11 @@ class ShowOdin extends Component { className={'video-quiz-option'} text={assignment} /> - + ))}
{' '} - + )} @@ -326,7 +326,7 @@ class ShowOdin extends Component { ))}
- +
{ )}
- + - + { - + { output={output} /> - + { - + { guideUrl={getGuideUrl({ forumTopicId, title })} />
- + { /> - + { - +
{answers.map((option, index) => ( @@ -273,7 +273,7 @@ class ShowVideo extends Component { ))}
- +
{ {t('learn.check-answer')} )}
- + - + { {blockrenderer()} {(isNewResponsiveWebDesign || isNewJsAlgos || isCollegeAlgebraPy) && !isProjectBlock ? null : ( - + )} ); diff --git a/client/src/templates/Introduction/components/super-block-intro.tsx b/client/src/templates/Introduction/components/super-block-intro.tsx index 63e983530d3..28577b5cf10 100644 --- a/client/src/templates/Introduction/components/super-block-intro.tsx +++ b/client/src/templates/Introduction/components/super-block-intro.tsx @@ -26,9 +26,9 @@ function SuperBlockIntro(props: SuperBlockIntroProps): JSX.Element { return ( <>

{i18nSuperBlock}

- + {generateIconComponent(superBlock, 'cert-header-icon')} - + {superBlockIntroText.map((str, i) => (

{str}

))} diff --git a/client/src/templates/Introduction/intro.tsx b/client/src/templates/Introduction/intro.tsx index aadb8d88541..bd4842ebf58 100644 --- a/client/src/templates/Introduction/intro.tsx +++ b/client/src/templates/Introduction/intro.tsx @@ -4,7 +4,7 @@ import React from 'react'; import Helmet from 'react-helmet'; import { useTranslation } from 'react-i18next'; -import ButtonSpacer from '../../components/helpers/button-spacer'; +import Spacer from '../../components/helpers/spacer'; import FullWidthRow from '../../components/helpers/full-width-row'; import LearnLayout from '../../components/layouts/learn'; import { @@ -67,11 +67,11 @@ function IntroductionPage({ > {t('buttons.first-lesson')} - + {t('buttons.view-curriculum')} - +
diff --git a/client/src/templates/Introduction/super-block-intro.tsx b/client/src/templates/Introduction/super-block-intro.tsx index e9ecc075298..bdbf10f72d3 100644 --- a/client/src/templates/Introduction/super-block-intro.tsx +++ b/client/src/templates/Introduction/super-block-intro.tsx @@ -190,14 +190,14 @@ const SuperBlockIntroductionPage = (props: SuperBlockProp) => {
- + - +

{t(`intro:misc-text.courses`)}

- +
{defaultCurriculumNames.map(blockDashedName => ( @@ -224,20 +224,20 @@ const SuperBlockIntroductionPage = (props: SuperBlockProp) => {
{!isSignedIn && !signInLoading && (
- + {t('buttons.logged-out-cta-btn')}
)} - +

{t(`intro:misc-text.browse-other`)}

- + - +