Skip to content
This repository was archived by the owner on Oct 23, 2025. It is now read-only.

Commit 5607ea4

Browse files
fix: view layout alignment (#220)
* added Container component * Add changeset file to bump the package version --------- Co-authored-by: Andrew Smith <a.smith@silentworks.co.uk>
1 parent a80400e commit 5607ea4

File tree

3 files changed

+58
-49
lines changed

3 files changed

+58
-49
lines changed

.changeset/selfish-crews-tie.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@supabase/auth-ui-react': patch
3+
---
4+
5+
Fix view layout alignment

packages/react/src/components/Auth/Auth.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,16 @@ function Auth({
168168
)
169169
case VIEWS.FORGOTTEN_PASSWORD:
170170
return (
171-
<ForgottenPassword
172-
appearance={appearance}
173-
supabaseClient={supabaseClient}
174-
setAuthView={setAuthView}
175-
redirectTo={redirectTo}
176-
showLinks={showLinks}
177-
i18n={i18n}
178-
/>
171+
<Container>
172+
<ForgottenPassword
173+
appearance={appearance}
174+
supabaseClient={supabaseClient}
175+
setAuthView={setAuthView}
176+
redirectTo={redirectTo}
177+
showLinks={showLinks}
178+
i18n={i18n}
179+
/>
180+
</Container>
179181
)
180182

181183
case VIEWS.MAGIC_LINK:

packages/react/src/components/Auth/interfaces/ForgottenPassword.tsx

Lines changed: 43 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -48,49 +48,51 @@ function ForgottenPassword({
4848

4949
return (
5050
<form id="auth-forgot-password" onSubmit={handlePasswordReset}>
51-
<Container gap="large" direction="vertical" appearance={appearance}>
52-
<div>
53-
<Label htmlFor="email" appearance={appearance}>
54-
{labels?.email_label}
55-
</Label>
56-
<Input
57-
id="email"
58-
name="email"
59-
type="email"
60-
autoFocus
61-
placeholder={labels?.email_input_placeholder}
62-
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
63-
setEmail(e.target.value)
64-
}
65-
appearance={appearance}
66-
/>
67-
</div>
68-
<Button
69-
type="submit"
70-
color="primary"
71-
loading={loading}
72-
appearance={appearance}
73-
>
74-
{loading ? labels?.loading_button_label : labels?.button_label}
75-
</Button>
76-
{showLinks && (
77-
<Anchor
78-
href="#auth-sign-in"
79-
onClick={(e: React.MouseEvent<HTMLAnchorElement>) => {
80-
e.preventDefault()
81-
setAuthView(VIEWS.SIGN_IN)
82-
}}
51+
<Container direction="vertical" gap="large" appearance={appearance}>
52+
<Container gap="large" direction="vertical" appearance={appearance}>
53+
<div>
54+
<Label htmlFor="email" appearance={appearance}>
55+
{labels?.email_label}
56+
</Label>
57+
<Input
58+
id="email"
59+
name="email"
60+
type="email"
61+
autoFocus
62+
placeholder={labels?.email_input_placeholder}
63+
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
64+
setEmail(e.target.value)
65+
}
66+
appearance={appearance}
67+
/>
68+
</div>
69+
<Button
70+
type="submit"
71+
color="primary"
72+
loading={loading}
8373
appearance={appearance}
8474
>
85-
{i18n?.sign_in?.link_text}
86-
</Anchor>
87-
)}
88-
{message && <Message appearance={appearance}>{message}</Message>}
89-
{error && (
90-
<Message color="danger" appearance={appearance}>
91-
{error}
92-
</Message>
93-
)}
75+
{loading ? labels?.loading_button_label : labels?.button_label}
76+
</Button>
77+
{showLinks && (
78+
<Anchor
79+
href="#auth-sign-in"
80+
onClick={(e: React.MouseEvent<HTMLAnchorElement>) => {
81+
e.preventDefault()
82+
setAuthView(VIEWS.SIGN_IN)
83+
}}
84+
appearance={appearance}
85+
>
86+
{i18n?.sign_in?.link_text}
87+
</Anchor>
88+
)}
89+
{message && <Message appearance={appearance}>{message}</Message>}
90+
{error && (
91+
<Message color="danger" appearance={appearance}>
92+
{error}
93+
</Message>
94+
)}
95+
</Container>
9496
</Container>
9597
</form>
9698
)

0 commit comments

Comments
 (0)