Skip to content

Commit 057bf2b

Browse files
authored
Merge pull request #19450 from mozilla/add-fallback-separator-text
task(settings): add fallback text for linked account 3rd-party auth
2 parents 0e43225 + d5930f0 commit 057bf2b

2 files changed

Lines changed: 18 additions & 12 deletions

File tree

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

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export type ThirdPartyAuthProps = {
2222
viewName?: string;
2323
deeplink?: string;
2424
flowQueryParams?: QueryParams;
25-
separatorTextId?: string;
25+
separatorType?: 'or' | 'signInWith';
2626
};
2727

2828
/**
@@ -37,7 +37,7 @@ const ThirdPartyAuth = ({
3737
viewName = 'unknown',
3838
deeplink,
3939
flowQueryParams,
40-
separatorTextId,
40+
separatorType = 'or',
4141
}: ThirdPartyAuthProps) => {
4242
const config = useConfig();
4343

@@ -55,11 +55,21 @@ const ThirdPartyAuth = ({
5555
<>
5656
<div className="text-sm flex items-center justify-center my-6">
5757
<div className="flex-1 h-px bg-grey-300 divide-x"></div>
58-
<FtlMsg id={separatorTextId || 'third-party-auth-options-or'}>
59-
<div className="mx-4 text-base text-grey-300 font-extralight">
60-
or
61-
</div>
62-
</FtlMsg>
58+
{(() => {
59+
const id =
60+
separatorType === 'signInWith'
61+
? 'third-party-auth-options-sign-in-with'
62+
: 'third-party-auth-options-or';
63+
const defaultText =
64+
separatorType === 'signInWith' ? 'Sign in with' : 'or';
65+
return (
66+
<FtlMsg id={id}>
67+
<div className="mx-4 text-base text-grey-300 font-extralight">
68+
{defaultText}
69+
</div>
70+
</FtlMsg>
71+
);
72+
})()}
6373
<div className="flex-1 h-px bg-grey-300 divide-x"></div>
6474
</div>
6575
</>

packages/fxa-settings/src/pages/Signin/index.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -509,11 +509,7 @@ const Signin = ({
509509
{!hideThirdPartyAuth && (
510510
<ThirdPartyAuth
511511
showSeparator={true}
512-
separatorTextId={
513-
hasLinkedAccountAndNoPassword
514-
? 'third-party-auth-options-sign-in-with'
515-
: undefined
516-
}
512+
separatorType={hasLinkedAccountAndNoPassword ? 'signInWith' : undefined}
517513
{...{ viewName, flowQueryParams }}
518514
/>
519515
)}

0 commit comments

Comments
 (0)