@@ -19,6 +19,7 @@ export interface EmailAuthProps {
19
19
setDefaultEmail : ( email : string ) => void
20
20
setDefaultPassword : ( password : string ) => void
21
21
supabaseClient : SupabaseClient
22
+ showLinks ?: boolean
22
23
redirectTo ?: RedirectTo
23
24
magicLink ?: boolean
24
25
i18n : I18nVariables
@@ -41,6 +42,7 @@ function EmailAuth({
41
42
setDefaultEmail,
42
43
setDefaultPassword,
43
44
supabaseClient,
45
+ showLinks = true ,
44
46
redirectTo,
45
47
magicLink,
46
48
i18n,
@@ -49,7 +51,6 @@ function EmailAuth({
49
51
const isMounted = useRef < boolean > ( true )
50
52
const [ email , setEmail ] = useState ( defaultEmail )
51
53
const [ password , setPassword ] = useState ( defaultPassword )
52
- const [ rememberMe , setRememberMe ] = useState ( false )
53
54
const [ error , setError ] = useState ( '' )
54
55
const [ loading , setLoading ] = useState ( false )
55
56
const [ message , setMessage ] = useState ( '' )
@@ -120,6 +121,7 @@ function EmailAuth({
120
121
< Input
121
122
type = "email"
122
123
name = "email"
124
+ placeholder = { i18n ?. [ authView ] ?. email_input_placeholder }
123
125
defaultValue = { email }
124
126
onChange = { ( e : React . ChangeEvent < HTMLInputElement > ) =>
125
127
setEmail ( e . target . value )
@@ -135,6 +137,7 @@ function EmailAuth({
135
137
< Input
136
138
type = "password"
137
139
name = "password"
140
+ placeholder = { i18n ?. [ authView ] ?. password_input_placeholder }
138
141
defaultValue = { password }
139
142
onChange = { ( e : React . ChangeEvent < HTMLInputElement > ) =>
140
143
setPassword ( e . target . value )
@@ -156,55 +159,57 @@ function EmailAuth({
156
159
{ i18n ?. [ authView ] ?. button_label }
157
160
</ Button >
158
161
159
- < Container direction = "vertical" gap = "small" appearance = { appearance } >
160
- { authView === VIEWS . SIGN_IN && magicLink && (
161
- < Anchor
162
- href = "#auth-magic-link"
163
- onClick = { ( e : React . MouseEvent < HTMLAnchorElement > ) => {
164
- e . preventDefault ( )
165
- setAuthView ( VIEWS . MAGIC_LINK )
166
- } }
167
- appearance = { appearance }
168
- >
169
- { i18n ?. magic_link ?. link_text }
170
- </ Anchor >
171
- ) }
172
- { authView === VIEWS . SIGN_IN && (
173
- < Anchor
174
- href = "#auth-forgot-password"
175
- onClick = { ( e : React . MouseEvent < HTMLAnchorElement > ) => {
176
- e . preventDefault ( )
177
- setAuthView ( VIEWS . FORGOTTEN_PASSWORD )
178
- } }
179
- appearance = { appearance }
180
- >
181
- { i18n ?. forgotten_password ?. link_text }
182
- </ Anchor >
183
- ) }
184
- { authView === VIEWS . SIGN_IN ? (
185
- < Anchor
186
- href = "#auth-sign-up"
187
- onClick = { ( e : React . MouseEvent < HTMLAnchorElement > ) => {
188
- e . preventDefault ( )
189
- handleViewChange ( VIEWS . SIGN_UP )
190
- } }
191
- appearance = { appearance }
192
- >
193
- { i18n ?. sign_up ?. link_text }
194
- </ Anchor >
195
- ) : (
196
- < Anchor
197
- href = "#auth-sign-in"
198
- onClick = { ( e : React . MouseEvent < HTMLAnchorElement > ) => {
199
- e . preventDefault ( )
200
- handleViewChange ( VIEWS . SIGN_IN )
201
- } }
202
- appearance = { appearance }
203
- >
204
- { i18n ?. sign_in ?. link_text }
205
- </ Anchor >
206
- ) }
207
- </ Container >
162
+ { showLinks && (
163
+ < Container direction = "vertical" gap = "small" appearance = { appearance } >
164
+ { authView === VIEWS . SIGN_IN && magicLink && (
165
+ < Anchor
166
+ href = "#auth-magic-link"
167
+ onClick = { ( e : React . MouseEvent < HTMLAnchorElement > ) => {
168
+ e . preventDefault ( )
169
+ setAuthView ( VIEWS . MAGIC_LINK )
170
+ } }
171
+ appearance = { appearance }
172
+ >
173
+ { i18n ?. magic_link ?. link_text }
174
+ </ Anchor >
175
+ ) }
176
+ { authView === VIEWS . SIGN_IN && (
177
+ < Anchor
178
+ href = "#auth-forgot-password"
179
+ onClick = { ( e : React . MouseEvent < HTMLAnchorElement > ) => {
180
+ e . preventDefault ( )
181
+ setAuthView ( VIEWS . FORGOTTEN_PASSWORD )
182
+ } }
183
+ appearance = { appearance }
184
+ >
185
+ { i18n ?. forgotten_password ?. link_text }
186
+ </ Anchor >
187
+ ) }
188
+ { authView === VIEWS . SIGN_IN ? (
189
+ < Anchor
190
+ href = "#auth-sign-up"
191
+ onClick = { ( e : React . MouseEvent < HTMLAnchorElement > ) => {
192
+ e . preventDefault ( )
193
+ handleViewChange ( VIEWS . SIGN_UP )
194
+ } }
195
+ appearance = { appearance }
196
+ >
197
+ { i18n ?. sign_up ?. link_text }
198
+ </ Anchor >
199
+ ) : (
200
+ < Anchor
201
+ href = "#auth-sign-in"
202
+ onClick = { ( e : React . MouseEvent < HTMLAnchorElement > ) => {
203
+ e . preventDefault ( )
204
+ handleViewChange ( VIEWS . SIGN_IN )
205
+ } }
206
+ appearance = { appearance }
207
+ >
208
+ { i18n ?. sign_in ?. link_text }
209
+ </ Anchor >
210
+ ) }
211
+ </ Container >
212
+ ) }
208
213
</ Container >
209
214
{ message && < Message appearance = { appearance } > { message } </ Message > }
210
215
{ error && (
0 commit comments