File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
apps/web/src/routes/(app)/login Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 6
6
import { inject } from ' @gitbutler/core/context' ;
7
7
import { LOGIN_SERVICE } from ' @gitbutler/shared/login/loginService' ;
8
8
import { WEB_ROUTES_SERVICE } from ' @gitbutler/shared/routing/webRoutes.svelte' ;
9
- import { Button , Textbox } from ' @gitbutler/ui' ;
9
+ import { Button , EmailTextbox , Textbox } from ' @gitbutler/ui' ;
10
10
import { env } from ' $env/dynamic/public' ;
11
11
12
12
let email = $state <string >();
15
15
let error = $state <string >();
16
16
let errorCode = $state <string >();
17
17
18
+ const isFormValid = $derived (!! email && !! password );
19
+
18
20
const loginService = inject (LOGIN_SERVICE );
19
21
const routesService = inject (WEB_ROUTES_SERVICE );
20
22
const authService = inject (AUTH_SERVICE );
70
72
</h1 >
71
73
72
74
<div class =" login-form__inputs" >
73
- <Textbox bind:value ={email } label =" Email" />
75
+ <EmailTextbox
76
+ label =" Email"
77
+ placeholder =" "
78
+ bind:value ={email }
79
+ autocomplete ={false }
80
+ autocorrect ={false }
81
+ spellcheck
82
+ />
74
83
<Textbox bind:value ={password } label =" Password" type =" password" />
75
84
76
85
<div class =" text-12 login-form__password-reset" >
77
86
<a href ={routesService .resetPasswordPath ()}>Forgot password?</a >
78
87
</div >
79
88
</div >
80
89
81
- <Button type =" submit" style =" pop" >Log in</Button >
90
+ <Button type ="submit" style ="pop" disabled ={ ! isFormValid } >Log in</Button >
82
91
83
92
{#if error }
84
93
<div class =" error-message" >
You can’t perform that action at this time.
0 commit comments