From 3243a3852dc9e78bbcd49a9410e2651ed5501194 Mon Sep 17 00:00:00 2001 From: Shaun Hamilton Date: Tue, 30 Jan 2024 11:36:46 +0200 Subject: [PATCH] revert: b1fc2dbc34e8d7d26641523bf1ec99116b3920a7 (#53447) --- .../components/Header/components/login.tsx | 6 ++- .../Header/components/universal-nav.css | 1 - .../src/components/formHelpers/form.test.tsx | 2 +- .../block-save-button.test.tsx.snap | 2 +- .../helpers/form/block-save-button.tsx | 7 +-- .../src/components/helpers/toggle-button.css | 51 +++++++++++++++++++ client/src/components/layouts/global.css | 6 ++- .../__snapshots__/honesty.test.tsx.snap | 12 +++-- client/src/components/settings/about.tsx | 4 +- .../src/components/settings/certification.tsx | 35 ++++++++----- .../src/components/settings/danger-zone.css | 15 ++++++ .../src/components/settings/danger-zone.tsx | 15 ++++-- .../src/components/settings/delete-modal.tsx | 15 +++--- client/src/components/settings/email.tsx | 21 ++++---- .../src/components/settings/honesty.test.tsx | 2 +- client/src/components/settings/honesty.tsx | 7 +-- client/src/components/settings/internet.tsx | 4 +- client/src/components/settings/portfolio.tsx | 16 +++--- client/src/components/settings/privacy.tsx | 12 ++--- .../src/components/settings/reset-modal.tsx | 13 ++--- .../settings/toggle-button-setting.tsx | 3 ++ .../settings/toggle-radio-setting.tsx | 1 + client/src/components/settings/username.tsx | 4 +- client/src/pages/update-email.tsx | 8 +-- .../e2e/default/learn/challenges/projects.ts | 9 +--- .../show-cert-from-superblock.ts | 7 +-- .../e2e/default/settings/certifications.ts | 6 +-- .../default/settings/image-picture-check.ts | 5 +- cypress/e2e/default/settings/portfolio.ts | 9 +--- tools/ui-components/src/index.ts | 2 +- 30 files changed, 186 insertions(+), 114 deletions(-) create mode 100644 client/src/components/helpers/toggle-button.css create mode 100644 client/src/components/settings/danger-zone.css diff --git a/client/src/components/Header/components/login.tsx b/client/src/components/Header/components/login.tsx index 1d21af2e30f..22dabc152cf 100644 --- a/client/src/components/Header/components/login.tsx +++ b/client/src/components/Header/components/login.tsx @@ -1,3 +1,4 @@ +import { Button } from '@freecodecamp/react-bootstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faRightToBracket } from '@fortawesome/free-solid-svg-icons'; import React, { ReactNode } from 'react'; @@ -31,7 +32,8 @@ const Login = ({ const href = isSignedIn ? `${homeLocation}/learn` : `${apiLocation}/signin`; return ( - {t('buttons.sign-in')} {children || t('buttons.sign-in')} - + ); }; diff --git a/client/src/components/Header/components/universal-nav.css b/client/src/components/Header/components/universal-nav.css index 52a566ac7ba..2cc70158347 100644 --- a/client/src/components/Header/components/universal-nav.css +++ b/client/src/components/Header/components/universal-nav.css @@ -342,7 +342,6 @@ li > button.nav-link-signout:not([aria-disabled='true']):is(:hover, :focus) { max-height: var(--header-element-size); min-width: var(--header-element-size); padding: 0 4px; - text-decoration: none; } @media (min-width: 601px) { diff --git a/client/src/components/formHelpers/form.test.tsx b/client/src/components/formHelpers/form.test.tsx index 13987d41fe9..b62aed7f5b2 100644 --- a/client/src/components/formHelpers/form.test.tsx +++ b/client/src/components/formHelpers/form.test.tsx @@ -29,7 +29,7 @@ test('should render', () => { const button = screen.getByText(/submit/i); expect(button).toHaveAttribute('type', 'submit'); - expect(button).toHaveAttribute('aria-disabled', 'true'); + expect(button).toBeDisabled(); }); test('should render with default values', () => { diff --git a/client/src/components/helpers/form/__snapshots__/block-save-button.test.tsx.snap b/client/src/components/helpers/form/__snapshots__/block-save-button.test.tsx.snap index 1a7fb59ed03..837496907c9 100644 --- a/client/src/components/helpers/form/__snapshots__/block-save-button.test.tsx.snap +++ b/client/src/components/helpers/form/__snapshots__/block-save-button.test.tsx.snap @@ -3,7 +3,7 @@ exports[` snapshot 1`] = `
@@ -99,10 +102,13 @@ exports[` snapshot when isHonest is true: HonestyAccepted

diff --git a/client/src/components/settings/about.tsx b/client/src/components/settings/about.tsx index 0450f298938..8dcc533348c 100644 --- a/client/src/components/settings/about.tsx +++ b/client/src/components/settings/about.tsx @@ -267,8 +267,8 @@ class AboutSettings extends Component {
{t('buttons.save')}{' '} diff --git a/client/src/components/settings/certification.tsx b/client/src/components/settings/certification.tsx index 0190a60071b..83d6e4a8667 100644 --- a/client/src/components/settings/certification.tsx +++ b/client/src/components/settings/certification.tsx @@ -1,3 +1,4 @@ +import { Button } from '@freecodecamp/react-bootstrap'; import { Link, navigate } from 'gatsby'; import { find } from 'lodash-es'; import React, { MouseEvent, useState } from 'react'; @@ -6,7 +7,7 @@ import type { TFunction } from 'i18next'; import { createSelector } from 'reselect'; import ScrollableAnchor, { configureAnchors } from 'react-scrollable-anchor'; import { connect } from 'react-redux'; -import { Table, Button } from '@freecodecamp/ui'; +import { Table } from '@freecodecamp/ui'; import { regeneratePathAndHistory } from '../../../../shared/utils/polyvinyl'; import ProjectPreviewModal from '../../templates/Challenges/components/project-preview-modal'; @@ -179,6 +180,12 @@ const LegacyFullStack = (props: CertificationSettingsProps) => { const certSlug = Certification.LegacyFullStack; const certLocation = `/certification/${username}/${certSlug}`; + const buttonStyle = { + marginBottom: '30px', + padding: '6px 12px', + fontSize: '18px' + }; + const createClickHandler = (certSlug: keyof typeof certSlugTypeMap) => (e: MouseEvent) => { @@ -218,27 +225,29 @@ const LegacyFullStack = (props: CertificationSettingsProps) => { -
+
{fullStackClaimable ? ( ) : ( @@ -393,11 +402,11 @@ function CertificationSettings(props: CertificationSettingsProps) { + + +
); @@ -247,8 +244,8 @@ function EmailSettings({
{t('buttons.save')}{' '} diff --git a/client/src/components/settings/honesty.test.tsx b/client/src/components/settings/honesty.test.tsx index a9c10b59bf3..acda37827b0 100644 --- a/client/src/components/settings/honesty.test.tsx +++ b/client/src/components/settings/honesty.test.tsx @@ -1,4 +1,4 @@ -import { Button } from '@freecodecamp/ui'; +import { Button } from '@freecodecamp/react-bootstrap'; import React from 'react'; import TestRenderer from 'react-test-renderer'; import ShallowRenderer from 'react-test-renderer/shallow'; diff --git a/client/src/components/settings/honesty.tsx b/client/src/components/settings/honesty.tsx index 69cf587f603..11eacd89d53 100644 --- a/client/src/components/settings/honesty.tsx +++ b/client/src/components/settings/honesty.tsx @@ -1,6 +1,7 @@ +import { Button } from '@freecodecamp/react-bootstrap'; import React from 'react'; import { Trans, useTranslation } from 'react-i18next'; -import { Panel, Button } from '@freecodecamp/ui'; +import { Panel } from '@freecodecamp/ui'; import { FullWidthRow } from '../helpers'; import SectionHeader from './section-header'; @@ -38,8 +39,8 @@ const Honesty = ({ isHonest, updateIsHonest }: HonestyProps): JSX.Element => {