Skip to content

Commit 8c47428

Browse files
Add more fixes based on requested changes
1 parent ae49de0 commit 8c47428

File tree

3 files changed

+19
-40
lines changed

3 files changed

+19
-40
lines changed

lib/ts/recipe/webauthn/components/themes/signUp/featureBlocks.tsx

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,23 @@ import { useTranslation } from "../../../../../translation/translationContext";
2121

2222
import type { FeatureBlockDetailProps } from "../../../types";
2323

24-
enum FeatureBlockIcon {
25-
FingerPrint,
26-
MultipleDevices,
27-
Security,
28-
}
29-
30-
const featureBlockIcons = [FingerPrintIcon, MultipleDevicesIcon, SecurityIcon];
24+
const blockDetails = [
25+
{
26+
title: "WEBAUTHN_FEATURE_BLOCK_NO_NEED_TO_REMEMBER_PASSWORD",
27+
subText: "WEBAUTHN_FEATURE_BLOCK_NO_NEED_TO_REMEMBER_PASSWORD_DETAIL",
28+
icon: <FingerPrintIcon />,
29+
},
30+
{
31+
title: "WEBAUTHN_FEATURE_BLOCK_WORKS_ON_ALL_DEVICES",
32+
subText: "WEBAUTHN_FEATURE_BLOCK_WORKS_ON_ALL_DEVICES_DETAIL",
33+
icon: <MultipleDevicesIcon />,
34+
},
35+
{
36+
title: "WEBAUTHN_FEATURE_BLOCK_KEEP_ACCOUNT_SAFER",
37+
subText: "WEBAUTHN_FEATURE_BLOCK_KEEP_ACCOUNT_SAFER_DETAIL",
38+
icon: <SecurityIcon />,
39+
},
40+
];
3141

3242
export const PasskeyFeatureBlock = withOverride(
3343
"PasskeyFeatureBlock",
@@ -46,27 +56,9 @@ export const PasskeyFeatureBlock = withOverride(
4656
);
4757

4858
export const PasskeyFeatureBlocks = withOverride("PasskeyFeatureBlocks", function PasskeyFeatureBlocks(): JSX.Element {
49-
const blockDetails: Record<FeatureBlockIcon, FeatureBlockDetailProps> = {
50-
[FeatureBlockIcon.FingerPrint]: {
51-
title: "WEBAUTHN_FEATURE_BLOCK_NO_NEED_TO_REMEMBER_PASSWORD",
52-
subText: "WEBAUTHN_FEATURE_BLOCK_NO_NEED_TO_REMEMBER_PASSWORD_DETAIL",
53-
icon: featureBlockIcons[0](),
54-
},
55-
[FeatureBlockIcon.MultipleDevices]: {
56-
title: "WEBAUTHN_FEATURE_BLOCK_WORKS_ON_ALL_DEVICES",
57-
subText: "WEBAUTHN_FEATURE_BLOCK_WORKS_ON_ALL_DEVICES_DETAIL",
58-
icon: featureBlockIcons[1](),
59-
},
60-
[FeatureBlockIcon.Security]: {
61-
title: "WEBAUTHN_FEATURE_BLOCK_KEEP_ACCOUNT_SAFER",
62-
subText: "WEBAUTHN_FEATURE_BLOCK_KEEP_ACCOUNT_SAFER_DETAIL",
63-
icon: featureBlockIcons[2](),
64-
},
65-
};
66-
6759
return (
6860
<div data-supertokens="passkeyFeatureBlocksContainer">
69-
{Object.values(blockDetails).map((blockDetail) => (
61+
{blockDetails.forEach((blockDetail) => (
7062
<PasskeyFeatureBlock {...blockDetail} />
7163
))}
7264
</div>

lib/ts/recipe/webauthn/components/themes/styles.css

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
}
1515

1616
[data-supertokens~="continueWithoutPasskey"] [data-supertokens~="continueWithoutPasskeyLabel"] {
17-
font-family: Arial;
1817
font-size: 14px;
1918
font-weight: 700;
2019
line-height: 21px;
@@ -29,7 +28,6 @@
2928
padding: 14px;
3029
background: #ff95001a;
3130
color: #7c603e;
32-
font-family: Arial;
3331
font-size: 14px;
3432
font-weight: 400;
3533
line-height: 20px;
@@ -47,7 +45,6 @@
4745
[data-supertokens~="passkeyConfirmationContainer"]
4846
[data-supertokens~="passkeyConfirmationEmailContainer"]
4947
[data-supertokens~="continueWithLabel"] {
50-
font-family: Arial;
5148
font-size: 12px;
5249
font-weight: 400;
5350
line-height: 13.8px;
@@ -60,7 +57,6 @@
6057
[data-supertokens~="passkeyConfirmationContainer"]
6158
[data-supertokens~="passkeyConfirmationEmailContainer"]
6259
[data-supertokens~="enteredEmailId"] {
63-
font-family: Arial;
6460
font-size: 14px;
6561
font-weight: 700;
6662
line-height: 16.1px;
@@ -91,7 +87,6 @@
9187
[data-supertokens~="passkeyFeatureBlock"]
9288
[data-supertokens~="passkeyFeatureBlockDetails"]
9389
[data-supertokens~="passkeyFeatureBlockTitle"] {
94-
font-family: Arial;
9590
font-size: 14px;
9691
font-weight: 700;
9792
line-height: 16.1px;
@@ -106,7 +101,6 @@
106101
[data-supertokens~="passkeyFeatureBlock"]
107102
[data-supertokens~="passkeyFeatureBlockDetails"]
108103
[data-supertokens~="passkeyFeatureBlockSubText"] {
109-
font-family: Arial;
110104
font-size: 12px;
111105
font-weight: 400;
112106
line-height: 13.8px;
@@ -123,7 +117,6 @@
123117
background-color: #fceaeb;
124118
color: #cf3644;
125119
padding: 10px;
126-
font-family: Arial;
127120
font-size: 14px;
128121
font-weight: 400;
129122
line-height: 16.59px;
@@ -140,7 +133,6 @@
140133
[data-supertokens~="somethingWentWrongErrorDetailsContainer"]
141134
[data-supertokens~="label"] {
142135
margin-top: 4px;
143-
font-family: Arial;
144136
font-size: 24px;
145137
font-weight: 500;
146138
line-height: 40px;
@@ -154,7 +146,6 @@
154146
[data-supertokens~="somethingWentWrongContainer"]
155147
[data-supertokens~="somethingWentWrongErrorDetailsContainer"]
156148
[data-supertokens~="errorDetails"] {
157-
font-family: Arial;
158149
font-size: 14px;
159150
font-weight: 400;
160151
line-height: 21px;
@@ -172,7 +163,6 @@
172163
[data-supertokens~="somethingWentWrongContainer"]
173164
[data-supertokens~="goBackButtonContainer"]
174165
[data-supertokens~="errorGoBackLabel"] {
175-
font-family: Arial;
176166
font-size: 14px;
177167
font-weight: 500;
178168
line-height: 21px;
@@ -197,7 +187,6 @@
197187
[data-supertokens~="passkeyRecoverAccountFormSubHeader"] {
198188
width: 75%;
199189
margin: 0 auto;
200-
font-family: Arial;
201190
font-size: 14px;
202191
font-weight: 400;
203192
line-height: 16.1px;
@@ -214,7 +203,6 @@
214203

215204
[data-supertokens~="passkeyEmailSentContainer"] [data-supertokens~="emailSentDescription"] {
216205
margin: 0 auto;
217-
font-family: Arial;
218206
font-size: 14px;
219207
font-weight: 400;
220208
line-height: 16.1px;
@@ -234,7 +222,6 @@
234222
[data-supertokens~="header"]
235223
[data-supertokens~="headerText"] {
236224
margin-top: 20px;
237-
font-family: Poppins;
238225
font-size: 20px;
239226
font-weight: 700;
240227
line-height: 30px;

lib/ts/recipe/webauthn/components/themes/translations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const defaultTranslationsWebauthn = {
2323
"The request either timed out, was canceled or the device is already registered. Please try again or try using another device.",
2424
WEBAUTHN_ERROR_GO_BACK_BUTTON_LABEL: "Go back",
2525
WEBAUTHN_UNRECOVERABLE_ERROR: "Something went wrong",
26-
WEBAUTHN_UNRECOVERABLE_ERROR_DETAILS: "something went wrong with your current session. please try again.",
26+
WEBAUTHN_UNRECOVERABLE_ERROR_DETAILS: "Something went wrong with your current session. please try again.",
2727
WEBAUTHN_EMAIL_SENT_LABEL: "Email sent",
2828
WEBAUTHN_EMAIL_SENT_LABEL_PRE_EMAIL: "Account recovery email has been sent to ",
2929
WEBAUTHN_EMAIL_SENT_LABEL_POST_EMAIL: ", if it exists in our system.",

0 commit comments

Comments
 (0)