Skip to content

Commit

Permalink
fix: styling fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
porcellus committed Apr 30, 2024
1 parent 353dae8 commit 9388af9
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 9 deletions.
6 changes: 5 additions & 1 deletion lib/build/index2.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/build/passwordlessprebuiltui.js

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/build/thirdpartyprebuiltui.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function AuthPageTheme(props: AuthPageThemeProps): JSX.Element {
);
}
return (
<div data-supertokens="container auth-page">
<div data-supertokens={`container authPage ${props.factorIds.length > 1 ? "multiFactor" : "singleFactor"}`}>
<div data-supertokens="row">
<AuthPageHeader
factorIds={props.factorIds}
Expand Down
4 changes: 4 additions & 0 deletions lib/ts/recipe/passwordless/components/themes/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,7 @@
[data-supertokens~="continueWithPasswordlessButtonWrapper"] {
margin: 9px 0;
}

[data-supertokens~="continueWithSupertokensLink"] {
margin-top: 9px;
}
9 changes: 9 additions & 0 deletions lib/ts/recipe/thirdparty/components/themes/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
color: black;
}

[data-supertokens~="multiFactor"] [data-supertokens~="button"][data-supertokens~="providerButton"] {
margin: auto;
max-width: 240px;
}

[data-supertokens~="button"][data-supertokens~="providerButton"]:hover {
filter: none;
background-color: #fafafa;
Expand All @@ -27,6 +32,10 @@
margin-left: 66px;
}

[data-supertokens~="multiFactor"] [data-supertokens~="providerButtonLeft"] {
margin-left: 30px;
}

[data-supertokens~="providerButtonLogo"] {
height: 30px;
display: flex;
Expand Down
25 changes: 25 additions & 0 deletions stories/authPage.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export type Args = {

const meta: Meta<Args> = {
title: "Auth page",
parameters: {
// Sets the delay (in milliseconds). This will make sure
chromatic: { delay: 300 },
},
render: (args, { loaded: { path, funcOverrides } }) => {
const { prebuiltUIs, key } = useMemo(() => {
const { prebuiltUIs, recipeList, defaultToSignUp } = buildInit(unflattenArgs(args), funcOverrides);
Expand All @@ -45,6 +49,27 @@ const meta: Meta<Args> = {

return (
<ErrorBoundary key={key}>
<style>
{`
*, *::before, *::after {
animation-delay: -1s !important;
animation-duration: 0s !important;
animation-iteration-count: 1 !important;
background-attachment: initial !important;
scroll-behavior: auto !important;
transition-duration: 0s !important;
transition: none !important;
}
img, video, iframe {
background: blue !important;
filter: brightness(1) contrast(0) !important;
}
svg {
shape-rendering: geometricPrecision !important;
}`}
</style>
<RoutingComponent
key={key}
path={args.path ?? path ?? "/auth"}
Expand Down
4 changes: 2 additions & 2 deletions test/end-to-end/mfa.factorscreen.otp.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
"[data-supertokens~=pwless-mfa][data-supertokens~=footer] [data-supertokens~=secondaryText]:nth-child(1)"
);
await Promise.all([logoutButton.click(), page.waitForNavigation({ waitUntil: "networkidle0" })]);
await waitForSTElement(page, "[data-supertokens~=auth-page]");
await waitForSTElement(page, "[data-supertokens~=authPage]");
assert.strictEqual(await page.url(), `${TEST_CLIENT_BASE_URL}/auth/`);
});

Expand All @@ -466,7 +466,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
"[data-supertokens~=pwless-mfa][data-supertokens~=otpFooter] [data-supertokens~=secondaryText]:nth-child(1)"
);
await Promise.all([logoutButton.click(), page.waitForNavigation({ waitUntil: "networkidle0" })]);
await waitForSTElement(page, "[data-supertokens~=auth-page]");
await waitForSTElement(page, "[data-supertokens~=authPage]");
assert.strictEqual(await page.url(), `${TEST_CLIENT_BASE_URL}/auth/`);

// This part checks that the login attempt info has been cleared
Expand Down
4 changes: 2 additions & 2 deletions test/end-to-end/mfa.factorscreen.totp.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
"[data-supertokens~=totp-mfa][data-supertokens~=deviceSetupFooter] [data-supertokens~=secondaryText]:nth-child(1)"
);
await Promise.all([logoutButton.click(), page.waitForNavigation({ waitUntil: "networkidle0" })]);
await waitForSTElement(page, "[data-supertokens~=auth-page]");
await waitForSTElement(page, "[data-supertokens~=authPage]");
assert.strictEqual(await page.url(), `${TEST_CLIENT_BASE_URL}/auth/`);
});

Expand All @@ -438,7 +438,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
"[data-supertokens~=totp-mfa][data-supertokens~=codeVerificationFooter] [data-supertokens~=secondaryText]:nth-child(1)"
);
await Promise.all([logoutButton.click(), page.waitForNavigation({ waitUntil: "networkidle0" })]);
await waitForSTElement(page, "[data-supertokens~=auth-page]");
await waitForSTElement(page, "[data-supertokens~=authPage]");
assert.strictEqual(await page.url(), `${TEST_CLIENT_BASE_URL}/auth/`);
});
});
Expand Down

0 comments on commit 9388af9

Please sign in to comment.