Skip to content

Commit 8f43032

Browse files
authored
Merge pull request #20192 from mozilla/FXA-13256
feat(cms): Allow customizing animated SVG colors in Strapi, apply to 3x SVGs
2 parents e51b70a + 6f80baa commit 8f43032

37 files changed

Lines changed: 704 additions & 319 deletions

File tree

libs/shared/cms/src/__generated__/gql.ts

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libs/shared/cms/src/__generated__/graphql.ts

Lines changed: 63 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libs/shared/cms/src/lib/queries/relying-party/factories.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,16 @@ export const RelyingPartyResultFactory = (
9191
header: faker.color.rgb(),
9292
splitLayoutAltText: faker.string.sample(),
9393
},
94+
illustrationsTheme: {
95+
primary: faker.color.rgb(),
96+
primaryAlt: faker.color.rgb(),
97+
secondary: faker.color.rgb(),
98+
accentBg: faker.color.rgb(),
99+
accentFg: faker.color.rgb(),
100+
cloudPrimary: faker.color.rgb(),
101+
cloudShadow: faker.color.rgb(),
102+
hideClouds: faker.datatype.boolean(),
103+
},
94104
pageTitle: faker.string.sample(),
95105
headerLogoUrl: faker.internet.url(),
96106
headerLogoAltText: faker.string.sample(),

libs/shared/cms/src/lib/queries/relying-party/query.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ export const relyingPartyQuery = graphql(`
3434
splitLayout
3535
splitLayoutAltText
3636
}
37+
illustrationsTheme {
38+
primary
39+
primaryAlt
40+
secondary
41+
accentBg
42+
accentFg
43+
cloudPrimary
44+
cloudShadow
45+
hideClouds
46+
}
3747
favicon
3848
headlineFontSize
3949
headlineTextColor

libs/shared/cms/src/lib/queries/relying-party/types.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export interface Shared {
3535
splitLayout: string | null;
3636
splitLayoutAltText: string | null;
3737
};
38+
illustrationsTheme: IllustrationsTheme | null;
3839
pageTitle: string | null;
3940
headerLogoUrl: string | null;
4041
headerLogoAltText: string | null;
@@ -45,6 +46,17 @@ export interface Shared {
4546
additionalAccessibilityInfo: string | null;
4647
}
4748

49+
export interface IllustrationsTheme {
50+
primary: string | null;
51+
primaryAlt: string | null;
52+
secondary: string | null;
53+
accentBg: string | null;
54+
accentFg: string | null;
55+
cloudPrimary: string | null;
56+
cloudShadow: string | null;
57+
hideClouds: boolean | null;
58+
}
59+
4860
export interface FeatureFlags {
4961
syncConfirmedPageHideCTA: boolean | null;
5062
syncHidePromoAfterLogin: boolean | null;

packages/fxa-settings/src/components/App/index.tsx

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -237,16 +237,16 @@ export const App = ({
237237
if (isValidSession) {
238238
setIsSignedIntoFirefoxDesktop(
239239
!!userFromBrowser?.sessionToken &&
240-
integration.isFirefoxDesktopClient()
240+
integration.isFirefoxDesktopClient()
241241
);
242242
const cachedUser = getAccountByUid(userFromBrowser.uid);
243243
// Refresh the token without switching the "current" account.
244244
persistAccount(
245245
cachedUser
246246
? {
247-
...cachedUser,
248-
sessionToken: userFromBrowser.sessionToken,
249-
}
247+
...cachedUser,
248+
sessionToken: userFromBrowser.sessionToken,
249+
}
250250
: userFromBrowser
251251
);
252252
if (!currentAccount()?.uid) {
@@ -568,14 +568,20 @@ const AuthAndAccountSetupRoutes = ({
568568
path="/reset_password/*"
569569
{...{ flowQueryParams, serviceName }}
570570
/>
571-
<ConfirmResetPasswordContainer path="/confirm_reset_password/*" />
571+
<ConfirmResetPasswordContainer
572+
path="/confirm_reset_password/*"
573+
{...{ integration }}
574+
/>
572575
<ResetPasswordRecoveryChoiceContainer path="/reset_password_totp_recovery_choice/*" />
573576
<ResetPasswordRecoveryPhoneContainer
574577
path="/reset_password_recovery_phone/*"
575578
{...{ integration }}
576579
/>
577580
<ConfirmTotpResetPasswordContainer path="/confirm_totp_reset_password/*" />
578-
<ConfirmBackupCodeResetPasswordContainer path="/confirm_backup_code_reset_password/*" />
581+
<ConfirmBackupCodeResetPasswordContainer
582+
path="/confirm_backup_code_reset_password/*"
583+
{...{ integration }}
584+
/>
579585
<CompleteResetPasswordContainer
580586
path="/complete_reset_password/*"
581587
{...{ integration }}
@@ -626,11 +632,21 @@ const AuthAndAccountSetupRoutes = ({
626632
/>
627633
<SigninPasswordlessCodeContainer
628634
path="/oauth/signin_passwordless_code/*"
629-
{...{ integration, serviceName, flowQueryParams, setCurrentSplitLayout }}
635+
{...{
636+
integration,
637+
serviceName,
638+
flowQueryParams,
639+
setCurrentSplitLayout,
640+
}}
630641
/>
631642
<SigninPasswordlessCodeContainer
632643
path="/signin_passwordless_code/*"
633-
{...{ integration, serviceName, flowQueryParams, setCurrentSplitLayout }}
644+
{...{
645+
integration,
646+
serviceName,
647+
flowQueryParams,
648+
setCurrentSplitLayout,
649+
}}
634650
/>
635651
<SigninContainer
636652
path="/oauth/signin/*"

packages/fxa-settings/src/components/PreparedImage/index.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const PreparedImage = (props: PreparedImageProps) => {
3838
return (
3939
<>
4040
{showAriaLabel ? (
41-
<FtlMsg id={props.ariaLabelFtlId} attrs={{ "aria-label": true }}>
41+
<FtlMsg id={props.ariaLabelFtlId} attrs={{ 'aria-label': true }}>
4242
<Image role="img" aria-label={props.ariaLabel} {...{ className }} />
4343
</FtlMsg>
4444
) : (
@@ -53,7 +53,19 @@ export const PreparedImage = (props: PreparedImageProps) => {
5353
);
5454
};
5555

56+
export interface IllustrationsTheme {
57+
primary?: string;
58+
primaryAlt?: string;
59+
secondary?: string;
60+
accentBg?: string;
61+
accentFg?: string;
62+
cloudPrimary?: string;
63+
cloudShadow?: string;
64+
hideClouds?: boolean;
65+
}
66+
5667
export type ImageProps = {
5768
className?: string;
5869
ariaHidden?: boolean;
70+
illustrationsTheme?: IllustrationsTheme;
5971
};

packages/fxa-settings/src/components/images/graphic_backup_codes.min.svg

Lines changed: 1 addition & 1 deletion
Loading

packages/fxa-settings/src/components/images/graphic_backup_codes.svg

Lines changed: 20 additions & 17 deletions
Loading

0 commit comments

Comments
 (0)