diff --git a/packages/fxa-settings/src/components/Banner/index.tsx b/packages/fxa-settings/src/components/Banner/index.tsx index 5b165702787..2565a9d4f03 100644 --- a/packages/fxa-settings/src/components/Banner/index.tsx +++ b/packages/fxa-settings/src/components/Banner/index.tsx @@ -7,7 +7,7 @@ import React, { ReactElement } from 'react'; import { FtlMsg } from 'fxa-react/lib/utils'; import { ReactComponent as IconClose } from '@fxa/shared/assets/images/close.svg'; import { FIREFOX_NOREPLY_EMAIL } from '../../constants'; -import { CheckmarkCircleOutlineIcon } from '../images'; +import { CheckmarkCircleOutlineBlackIcon } from '../Icons'; export enum BannerType { info = 'info', @@ -118,7 +118,7 @@ export const FancyBanner = ( ((messageType) => { switch (messageType) { case BannerType.success: - return ; + return ; default: return null; } diff --git a/packages/fxa-settings/src/components/ConfirmWithLink/index.tsx b/packages/fxa-settings/src/components/ConfirmWithLink/index.tsx index 446c738ff78..8102119616b 100644 --- a/packages/fxa-settings/src/components/ConfirmWithLink/index.tsx +++ b/packages/fxa-settings/src/components/ConfirmWithLink/index.tsx @@ -4,7 +4,7 @@ import React from 'react'; import { FtlMsg } from 'fxa-react/lib/utils'; -import { MailImage } from '../../components/images'; +import { MailImage } from '../images'; import CardHeader from '../CardHeader'; import { ResendStatus } from '../../lib/types'; import Banner, { BannerType, ResendEmailSuccessBanner } from '../Banner'; diff --git a/packages/fxa-settings/src/components/Icons/en.ftl b/packages/fxa-settings/src/components/Icons/en.ftl new file mode 100644 index 00000000000..4d5aad4db76 --- /dev/null +++ b/packages/fxa-settings/src/components/Icons/en.ftl @@ -0,0 +1,51 @@ + +## Images - these are all aria labels used for illustrations +## Aria labels are used as alternate text that can be read aloud by screen readers. + +alert-icon-aria-label = + .aria-label = Alert + +authenticator-app-aria-label = + .aria-label = Authenticator Application + +backup-codes-icon-aria-label = + .aria-label = Backup codes enabled + +backup-codes-disabled-icon-aria-label = + .aria-label = Backup codes disabled + +# An icon of phone with text message. A back recovery phone number +backup-recovery-sms-icon-aria-label = + .aria-label = Recovery SMS enabled + +# Disabled version of backup-recovery-sms-icon-aria-label +backup-recovery-sms-disabled-icon-aria-label = + .aria-label = Recovery SMS disabled + +# used indicate a general checkmark, as in something checked off in a list! +checkmark-icon-aria-label = + .aria-label = Check + +# used indicate a check mark for a successful state/action +checkmark-success-icon-aria-label = + .aria-label = Success + +# used indicate a check mark for an enabled state/option +checkmark-enabled-icon-aria-label = + .aria-label = Enabled + +# Used to decorate a code you enter for verification purposes +code-icon-aria-label = + .aria-label = Code + +# Used to select Canada as country code for phone number +canadian-flag-icon-aria-label = + .aria-label = Canadian Flag + +# Used to select United States as a country code for phone number +usa-flag-icon-aria-label = + .aria-label = United States Flag + +# Used as information icon for informative messaging +info-icon-aria-label = + .aria-label = Information diff --git a/packages/fxa-settings/src/components/Icons/icon_alert.svg b/packages/fxa-settings/src/components/Icons/icon_alert.svg new file mode 100644 index 00000000000..d1bb064a9d0 --- /dev/null +++ b/packages/fxa-settings/src/components/Icons/icon_alert.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/fxa-settings/src/components/Icons/icon_authenticator_app.svg b/packages/fxa-settings/src/components/Icons/icon_authenticator_app.svg new file mode 100644 index 00000000000..bc397ac3057 --- /dev/null +++ b/packages/fxa-settings/src/components/Icons/icon_authenticator_app.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/fxa-settings/src/components/Icons/icon_backup_codes.svg b/packages/fxa-settings/src/components/Icons/icon_backup_codes.svg new file mode 100644 index 00000000000..a0f36c85390 --- /dev/null +++ b/packages/fxa-settings/src/components/Icons/icon_backup_codes.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/fxa-settings/src/components/Icons/icon_backup_codes_disabled.svg b/packages/fxa-settings/src/components/Icons/icon_backup_codes_disabled.svg new file mode 100644 index 00000000000..42884edb670 --- /dev/null +++ b/packages/fxa-settings/src/components/Icons/icon_backup_codes_disabled.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/fxa-settings/src/components/Icons/icon_backup_recovery_sms.svg b/packages/fxa-settings/src/components/Icons/icon_backup_recovery_sms.svg new file mode 100644 index 00000000000..7ed9de4c78b --- /dev/null +++ b/packages/fxa-settings/src/components/Icons/icon_backup_recovery_sms.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/fxa-settings/src/components/Icons/icon_backup_recovery_sms_disabled.svg b/packages/fxa-settings/src/components/Icons/icon_backup_recovery_sms_disabled.svg new file mode 100644 index 00000000000..73595fdb49c --- /dev/null +++ b/packages/fxa-settings/src/components/Icons/icon_backup_recovery_sms_disabled.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/fxa-settings/src/components/Icons/icon_checkmark_circle_full_green.svg b/packages/fxa-settings/src/components/Icons/icon_checkmark_circle_full_green.svg new file mode 100644 index 00000000000..d1ecf3f58b0 --- /dev/null +++ b/packages/fxa-settings/src/components/Icons/icon_checkmark_circle_full_green.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/fxa-settings/src/components/images/icon_checkmark_circle_outline.svg b/packages/fxa-settings/src/components/Icons/icon_checkmark_circle_outline_black.svg similarity index 100% rename from packages/fxa-settings/src/components/images/icon_checkmark_circle_outline.svg rename to packages/fxa-settings/src/components/Icons/icon_checkmark_circle_outline_black.svg diff --git a/packages/fxa-settings/src/components/Icons/icon_checkmark_green.svg b/packages/fxa-settings/src/components/Icons/icon_checkmark_green.svg new file mode 100644 index 00000000000..4332e5bb0f8 --- /dev/null +++ b/packages/fxa-settings/src/components/Icons/icon_checkmark_green.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/fxa-settings/src/components/Icons/icon_code.svg b/packages/fxa-settings/src/components/Icons/icon_code.svg new file mode 100644 index 00000000000..7587cff0038 --- /dev/null +++ b/packages/fxa-settings/src/components/Icons/icon_code.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/fxa-settings/src/components/Icons/icon_flag_canada.svg b/packages/fxa-settings/src/components/Icons/icon_flag_canada.svg new file mode 100644 index 00000000000..30e46358396 --- /dev/null +++ b/packages/fxa-settings/src/components/Icons/icon_flag_canada.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/fxa-settings/src/components/Icons/icon_flag_usa.svg b/packages/fxa-settings/src/components/Icons/icon_flag_usa.svg new file mode 100644 index 00000000000..552ce726a11 --- /dev/null +++ b/packages/fxa-settings/src/components/Icons/icon_flag_usa.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/fxa-settings/src/components/Icons/icon_information_circle_outline_black.svg b/packages/fxa-settings/src/components/Icons/icon_information_circle_outline_black.svg new file mode 100644 index 00000000000..bf714e73960 --- /dev/null +++ b/packages/fxa-settings/src/components/Icons/icon_information_circle_outline_black.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/fxa-settings/src/components/Icons/icon_information_circle_outline_blue.svg b/packages/fxa-settings/src/components/Icons/icon_information_circle_outline_blue.svg new file mode 100644 index 00000000000..e32aedd2372 --- /dev/null +++ b/packages/fxa-settings/src/components/Icons/icon_information_circle_outline_blue.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/fxa-settings/src/components/Icons/index.stories.tsx b/packages/fxa-settings/src/components/Icons/index.stories.tsx new file mode 100644 index 00000000000..a65491a1f60 --- /dev/null +++ b/packages/fxa-settings/src/components/Icons/index.stories.tsx @@ -0,0 +1,70 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +import React from 'react'; +import { Meta } from '@storybook/react'; + +import { + AlertIcon, + AuthenticatorAppIcon, + BackupCodesIcon, + BackupCodesDisabledIcon, + BackupRecoverySmsIcon, + BackupRecoverySmsDisabledIcon, + CheckmarkGreenIcon, + CheckmarkCircleFullGreenIcon, + CheckmarkCircleOutlineBlackIcon, + CodeIcon, + FlagCanadaIcon, + FlagUsaIcon, + InformationCircleOutlineBlueIcon, + InformationCircleOutlineBlackIcon, +} from '.'; +import { withLocalization } from 'fxa-react/lib/storybooks'; + +export default { + title: 'Components/Icons', + subcomponents: { + AlertIcon, + AuthenticatorAppIcon, + BackupCodesIcon, + BackupCodesDisabledIcon, + BackupRecoverySmsIcon, + BackupRecoverySmsDisabledIcon, + CheckmarkIcon: CheckmarkGreenIcon, + CheckmarkCircleFullIcon: CheckmarkCircleFullGreenIcon, + CheckmarkCircleOutlineIcon: CheckmarkCircleOutlineBlackIcon, + CodeIcon, + FlagCanadaIcon, + FlagUsaIcon, + InformationCircleOutlineBlueIcon, + InformationCircleOutlineBlackIcon, + }, + decorators: [withLocalization], +} as Meta; + +export const Alert = () => ; +export const AuthenticatorApp = () => ; +export const BackupCodes = () => ; +export const BackupCodesDisabled = () => ; +export const BackupRecoverySms = () => ; +export const BackupRecoverySmsDisabled = () => ( + +); +export const Checkmark = () => ; +export const CheckmarkCircleFull = () => ( + +); +export const CheckmarkCircleOutline = () => ( + +); +export const Code = () => ; +export const FlagCanada = () => ; +export const FlagUsa = () => ; +export const InformationCircleOutlineBlue = () => ( + +); +export const InformationCircleBlack = () => ( + +); diff --git a/packages/fxa-settings/src/components/Icons/index.tsx b/packages/fxa-settings/src/components/Icons/index.tsx new file mode 100644 index 00000000000..09c5e084a39 --- /dev/null +++ b/packages/fxa-settings/src/components/Icons/index.tsx @@ -0,0 +1,201 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +import React from 'react'; +import { ImageProps, PreparedImage as PreparedIcon } from '../PreparedImage'; +import { ReactComponent as Alert } from './icon_alert.svg'; +import { ReactComponent as AuthenticatorApp } from './icon_authenticator_app.svg'; +import { ReactComponent as BackupCodes } from './icon_backup_codes.svg'; +import { ReactComponent as BackupCodesDisabled } from './icon_backup_codes_disabled.svg'; +import { ReactComponent as BackupRecoverySmsDisabled } from './icon_backup_recovery_sms_disabled.svg'; +import { ReactComponent as BackupRecoverySms } from './icon_backup_recovery_sms.svg'; +import { ReactComponent as CheckmarkGreen } from './icon_checkmark_green.svg'; +import { ReactComponent as CheckmarkCircleFullGreen } from './icon_checkmark_circle_full_green.svg'; +import { ReactComponent as CheckmarkCircleOutlineBlack } from './icon_checkmark_circle_outline_black.svg'; +import { ReactComponent as Code } from './icon_code.svg'; +import { ReactComponent as FlagCanada } from './icon_flag_canada.svg'; +import { ReactComponent as FlagUsa } from './icon_flag_usa.svg'; +import { ReactComponent as InformationCircleOutlineBlue } from './icon_information_circle_outline_blue.svg'; +import { ReactComponent as InformationCircleOutlineBlack } from './icon_information_circle_outline_black.svg'; + +export const AlertIcon = ({ className, ariaHidden }: ImageProps) => ( + +); + +export const AuthenticatorAppIcon = ({ className, ariaHidden }: ImageProps) => ( + +); + +export const BackupCodesIcon = ({ className, ariaHidden }: ImageProps) => ( + +); + +export const BackupCodesDisabledIcon = ({ + className, + ariaHidden, +}: ImageProps) => ( + +); + +export const BackupRecoverySmsIcon = ({ + className, + ariaHidden, +}: ImageProps) => ( + +); + +export const BackupRecoverySmsDisabledIcon = ({ + className, + ariaHidden, +}: ImageProps) => ( + +); + +type CheckmarkMode = 'enabled' | 'success' | 'check'; +function getCheckMarkAria(mode: CheckmarkMode) { + switch (mode) { + case 'enabled': + return { + ariaLabel: 'Enabled', + ariaLabelFtlId: 'checkmark-enabled-icon-aria-label', + }; + case 'success': + return { + ariaLabel: 'Success', + ariaLabelFtlId: 'checkmark-success-icon-aria-label', + }; + case 'check': + default: + return { + ariaLabel: 'Check', + ariaLabelFtlId: 'checkmark-icon-aria-label', + }; + } +} + +export type CheckmarkProps = ImageProps & { mode: CheckmarkMode }; +export const CheckmarkGreenIcon = ({ + className, + ariaHidden, + mode, +}: CheckmarkProps) => ( + +); + +export const CheckmarkCircleFullGreenIcon = ({ + className, + ariaHidden, + mode, +}: CheckmarkProps) => ( + +); +export const CheckmarkCircleOutlineBlackIcon = ({ + className, + ariaHidden, + mode, +}: CheckmarkProps) => ( + +); + +export const CodeIcon = ({ className, ariaHidden }: ImageProps) => ( + +); + +export const FlagCanadaIcon = ({ className, ariaHidden }: ImageProps) => ( + +); + +export const FlagUsaIcon = ({ className, ariaHidden }: ImageProps) => ( + +); + +export const InformationCircleOutlineBlueIcon = ({ + className, + ariaHidden, +}: ImageProps) => ( + +); + +export const InformationCircleOutlineBlackIcon = ({ + className, + ariaHidden, +}: ImageProps) => ( + +); diff --git a/packages/fxa-settings/src/components/InlineRecoveryKeySetupCreate/index.tsx b/packages/fxa-settings/src/components/InlineRecoveryKeySetupCreate/index.tsx index 56bc9291233..3f528fdfdc9 100644 --- a/packages/fxa-settings/src/components/InlineRecoveryKeySetupCreate/index.tsx +++ b/packages/fxa-settings/src/components/InlineRecoveryKeySetupCreate/index.tsx @@ -3,7 +3,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ import React, { useState } from 'react'; -import { CheckmarkCircleOutlineIcon, RecoveryKeyImage } from '../images'; +import { RecoveryKeyImage } from '../images'; +import { CheckmarkCircleOutlineBlackIcon } from '../Icons'; import { FtlMsg } from 'fxa-react/lib/utils'; import Banner, { BannerType } from '../Banner'; import { CreateRecoveryKeyHandler } from '../../pages/InlineRecoveryKeySetup/interfaces'; @@ -33,7 +34,7 @@ export const InlineRecoveryKeySetupCreate = ({ <>

- + You’re signed in to Firefox diff --git a/packages/fxa-settings/src/components/images/index.test.tsx b/packages/fxa-settings/src/components/PreparedImage/index.test.tsx similarity index 73% rename from packages/fxa-settings/src/components/images/index.test.tsx rename to packages/fxa-settings/src/components/PreparedImage/index.test.tsx index 71f0077f0a8..7dd79f6f883 100644 --- a/packages/fxa-settings/src/components/images/index.test.tsx +++ b/packages/fxa-settings/src/components/PreparedImage/index.test.tsx @@ -5,7 +5,7 @@ import React from 'react'; import { screen } from '@testing-library/react'; import { renderWithLocalizationProvider } from 'fxa-react/lib/test-utils/localizationProvider'; -import { HeartsVerifiedImage } from '.'; +import { HeartsVerifiedImage } from '../images'; it('applies localization by default', () => { renderWithLocalizationProvider(); @@ -30,7 +30,7 @@ it('applies a11y by default', () => { ).toBeInTheDocument(); }); -it('can be hidden from screenreaders when desired', () => { +it('can be hidden from screen readers when desired', () => { renderWithLocalizationProvider(); const image = screen.getByTestId('aria-hidden-image'); expect(image).toBeInTheDocument(); @@ -45,3 +45,17 @@ it('applies custom classNames when desired', () => { ); expect(screen.getByRole('img')).toHaveClass(MOCK_CLASS); }); + +describe('images without l10n', () => { + it('applies basic styles by default', () => { + renderWithLocalizationProvider(); + expect(screen.getByRole('img')).toHaveClass('w-3/5'); + }); + it('applies custom classNames when desired', () => { + const MOCK_CLASS = 'w-full'; + renderWithLocalizationProvider( + + ); + expect(screen.getByRole('img')).toHaveClass(MOCK_CLASS); + }); +}); diff --git a/packages/fxa-settings/src/components/PreparedImage/index.tsx b/packages/fxa-settings/src/components/PreparedImage/index.tsx new file mode 100644 index 00000000000..b7514c0b171 --- /dev/null +++ b/packages/fxa-settings/src/components/PreparedImage/index.tsx @@ -0,0 +1,59 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +import React from 'react'; +import { FtlMsg } from 'fxa-react/lib/utils'; + +interface PreparedImageBaseProps { + className?: string; + Image: React.ElementType; +} + +interface PreparedImageAriaHiddenProps extends PreparedImageBaseProps { + ariaHidden: true; +} + +interface PreparedImageAriaVisibleProps extends PreparedImageBaseProps { + ariaHidden?: false; + ariaLabel: string; + ariaLabelFtlId: string; +} + +export type PreparedImageProps = + | PreparedImageAriaHiddenProps + | PreparedImageAriaVisibleProps; + +// Use this component to add your image into the collection of images exported below. +// If the component is not being reused across directories, it should remain in the directory +// where it is being used. If you are introducing an image which was previously shared and +// had localized alt-text, or a localized aria-label, please add the existing ftl id to spare +// translating it again. Don't forget to add new FTL strings into the `en.ftl` file! + +export const PreparedImage = (props: PreparedImageProps) => { + const { className = 'm-auto w-3/5', ariaHidden, Image } = props; + const showAriaLabel = + !ariaHidden && props?.ariaLabel && props?.ariaLabelFtlId; + + return ( + <> + {showAriaLabel ? ( + + + + ) : ( + + )} + + ); +}; + +export type ImageProps = { + className?: string; + ariaHidden?: boolean; +}; diff --git a/packages/fxa-settings/src/components/Ready/index.tsx b/packages/fxa-settings/src/components/Ready/index.tsx index 04a453453df..7ffefe3e800 100644 --- a/packages/fxa-settings/src/components/Ready/index.tsx +++ b/packages/fxa-settings/src/components/Ready/index.tsx @@ -7,7 +7,7 @@ import { navigate, RouteComponentProps } from '@reach/router'; import { FtlMsg } from 'fxa-react/lib/utils'; import { logViewEvent, usePageViewEvent } from '../../lib/metrics'; import { REACT_ENTRYPOINT } from '../../constants'; -import { HeartsVerifiedImage } from '../../components/images'; +import { HeartsVerifiedImage } from '../images'; import CardHeader from '../CardHeader'; import Banner, { BannerType } from '../Banner'; import { MozServices } from '../../lib/types'; diff --git a/packages/fxa-settings/src/components/images/graphic_push_factor_auth.svg b/packages/fxa-settings/src/components/images/graphic_push_factor_auth.svg index d0c7ec952e5..e059857a937 100644 --- a/packages/fxa-settings/src/components/images/graphic_push_factor_auth.svg +++ b/packages/fxa-settings/src/components/images/graphic_push_factor_auth.svg @@ -1,68 +1,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +]]> \ No newline at end of file diff --git a/packages/fxa-settings/src/components/images/icon_checkmark_circle_full.svg b/packages/fxa-settings/src/components/images/icon_checkmark_circle_full.svg deleted file mode 100644 index d0bf3e6424b..00000000000 --- a/packages/fxa-settings/src/components/images/icon_checkmark_circle_full.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/packages/fxa-settings/src/components/images/index.stories.tsx b/packages/fxa-settings/src/components/images/index.stories.tsx index 108e7655f59..718028939e9 100644 --- a/packages/fxa-settings/src/components/images/index.stories.tsx +++ b/packages/fxa-settings/src/components/images/index.stories.tsx @@ -15,8 +15,6 @@ import { BackupCodesImage, RecoveryKeyImage, TwoFactorAuthImage, - CheckmarkCircleOutlineIcon, - CheckmarkCircleFullIcon, PasswordSuccessImage, BackupRecoveryPhoneImage, BackupRecoveryPhoneCodeImage, @@ -35,8 +33,6 @@ export default { BackupCodesImage, RecoveryKeyImage, TwoFactorAuthImage, - CheckmarkCircleOutlineIcon, - CheckmarkCircleFullIcon, PasswordSuccessImage, BackupRecoveryPhoneImage, BackupRecoveryPhoneCodeImage, @@ -62,10 +58,6 @@ export const BackupCodes = () => ; export const TwoFactorAuth = () => ; -export const CircleCheckOutline = () => ; - -export const CircleCheckFull = () => ; - export const PasswordSuccess = () => ; export const BackupRecoveryPhone = () => ; diff --git a/packages/fxa-settings/src/components/images/index.tsx b/packages/fxa-settings/src/components/images/index.tsx index 851056dca23..772f515559e 100644 --- a/packages/fxa-settings/src/components/images/index.tsx +++ b/packages/fxa-settings/src/components/images/index.tsx @@ -3,6 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ import React from 'react'; +import { ImageProps, PreparedImage } from '../PreparedImage'; import { ReactComponent as HeartsBroken } from './graphic_hearts_broken.svg'; import { ReactComponent as HeartsVerified } from './graphic_hearts_verified.svg'; import { ReactComponent as BackupCodes } from './graphic_backup_codes.min.svg'; @@ -13,62 +14,10 @@ import { ReactComponent as Key } from './graphic_recovery_key.min.svg'; import { ReactComponent as Password } from './graphic_password.min.svg'; import { ReactComponent as Lightbulb } from './graphic_recovery_key_hint.min.svg'; import { ReactComponent as EmailCode } from './graphic_email_code.svg'; -import { ReactComponent as CircleCheckOutline } from './icon_checkmark_circle_outline.svg'; -import { ReactComponent as CircleCheckFull } from './icon_checkmark_circle_full.svg'; import { ReactComponent as PasswordSuccess } from './graphic_password_success.min.svg'; import { ReactComponent as BackupRecoveryPhone } from './graphic_backup_recovery_phone.min.svg'; import { ReactComponent as BackupRecoveryPhoneCode } from './graphic_phone_code.min.svg'; -import { FtlMsg } from 'fxa-react/lib/utils'; - -// Use this component to add your image into the collection of images exported below. -// If the component is not being reused across directories, it should remain in the directory -// where it is being used. If you are introducing an image which was previously shared and -// had localized alt-text, or a localized aria-label, please add the existing ftl id to spare -// translating it again. Don't forget to add new FTL strings into the `en.ftl` file! - -interface PreparedImageBaseProps { - className?: string; - Image: React.ElementType; -} - -interface PreparedImageAriaHiddenProps extends PreparedImageBaseProps { - ariaHidden: true; -} - -interface PreparedImageAriaVisibleProps extends PreparedImageBaseProps { - ariaHidden?: false; - ariaLabel: string; - ariaLabelFtlId: string; -} - -type PreparedImageProps = - | PreparedImageAriaHiddenProps - | PreparedImageAriaVisibleProps; - -export const PreparedImage = (props: PreparedImageProps) => { - const { className = 'm-auto w-3/5', ariaHidden, Image } = props; - const showAriaLabel = - !ariaHidden && props?.ariaLabel && props?.ariaLabelFtlId; - - return ( - <> - {showAriaLabel ? ( - - - - ) : ( - - )} - - ); -}; - -export type ImageProps = { - className?: string; - ariaHidden?: boolean; -}; - export const HeartsBrokenImage = ({ className, ariaHidden }: ImageProps) => ( ( {...{ className, ariaHidden }} /> ); - -export const CheckmarkCircleOutlineIcon = ({ className }: ImageProps) => ( - -); - -export const CheckmarkCircleFullIcon = ({ className }: ImageProps) => ( - -); diff --git a/packages/fxa-settings/src/pages/InlineRecoveryKeySetup/index.tsx b/packages/fxa-settings/src/pages/InlineRecoveryKeySetup/index.tsx index a38c5ee15d4..f4827ab6b68 100644 --- a/packages/fxa-settings/src/pages/InlineRecoveryKeySetup/index.tsx +++ b/packages/fxa-settings/src/pages/InlineRecoveryKeySetup/index.tsx @@ -7,10 +7,8 @@ import { RouteComponentProps } from '@reach/router'; import InlineRecoveryKeySetupCreate from '../../components/InlineRecoveryKeySetupCreate'; import RecoveryKeySetupDownload from '../../components/RecoveryKeySetupDownload'; import AppLayout from '../../components/AppLayout'; -import { - CheckmarkCircleOutlineIcon, - RecoveryKeyImage, -} from '../../components/images'; +import { RecoveryKeyImage } from '../../components/images'; +import { CheckmarkCircleOutlineBlackIcon } from '../../components/Icons'; import { FtlMsg, hardNavigate } from 'fxa-react/lib/utils'; import Banner, { BannerType } from '../../components/Banner'; import { Constants } from '../../lib/constants'; @@ -63,7 +61,10 @@ export const InlineRecoveryKeySetup = ({ <>

- + Account recovery key created diff --git a/packages/fxa-settings/src/pages/ResetPassword/ResetPasswordConfirmed/index.tsx b/packages/fxa-settings/src/pages/ResetPassword/ResetPasswordConfirmed/index.tsx index 5b36993cc1b..18a3ce1ecd0 100644 --- a/packages/fxa-settings/src/pages/ResetPassword/ResetPasswordConfirmed/index.tsx +++ b/packages/fxa-settings/src/pages/ResetPassword/ResetPasswordConfirmed/index.tsx @@ -6,10 +6,8 @@ import React from 'react'; import { RouteComponentProps } from '@reach/router'; import AppLayout from '../../../components/AppLayout'; import { ResetPasswordConfirmedProps } from './interfaces'; -import { - CheckmarkCircleFullIcon, - PasswordSuccessImage, -} from '../../../components/images'; +import { PasswordSuccessImage } from '../../../components/images'; +import { CheckmarkCircleFullGreenIcon } from '../../../components/Icons'; import { FtlMsg } from 'fxa-react/lib/utils'; import Banner, { BannerType } from '../../../components/Banner'; @@ -26,7 +24,10 @@ const ResetPasswordConfirmed = ({ )}

- +

Your password has been reset