-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(playground): extract texts from pages, set autoComplete fiel…
…ds, add forget password link etc
- Loading branch information
Showing
6 changed files
with
71 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ import { Button } from '../ui/button' | |
import { Loader } from '../ui/loader' | ||
import { TenantFormError, TenantFormField } from './common' | ||
import { dict } from '../../dict' | ||
import { Link } from '@contember/interface' | ||
|
||
export const LoginFormFields = () => { | ||
const form = useLoginForm() | ||
|
@@ -17,21 +18,26 @@ export const LoginFormFields = () => { | |
|
||
<TenantFormField | ||
form={form} messages={dict.tenant.login.errorMessages} field="email" | ||
type="email" required autoFocus={form.state === 'initial'} readOnly={form.state === 'otp-required'} placeholder="[email protected]" | ||
type="email" required autoFocus={form.state === 'initial'} readOnly={form.state === 'otp-required'} placeholder="[email protected]" autoComplete="email" | ||
> | ||
{dict.tenant.login.email} | ||
</TenantFormField> | ||
|
||
<TenantFormField | ||
form={form} messages={dict.tenant.login.errorMessages} field="password" | ||
form={form} messages={dict.tenant.login.errorMessages} field="password" autoComplete="current-password" | ||
type="password" required readOnly={form.state === 'otp-required'} | ||
> | ||
{dict.tenant.login.password} | ||
<Link to="resetRequest"> | ||
<a className="float-end underline text-gray-600 text-sm font-normal"> | ||
{dict.tenant.login.forgotPassword} | ||
</a> | ||
</Link> | ||
</TenantFormField> | ||
|
||
{(form.state === 'otp-required' || fieldErrors.includes('otpToken')) && ( | ||
<TenantFormField | ||
form={form} messages={dict.tenant.login.errorMessages} field="otpToken" | ||
form={form} messages={dict.tenant.login.errorMessages} field="otpToken" autoComplete="one-time-code" | ||
type="text" required autoFocus maxLength={6} | ||
> | ||
{dict.tenant.login.otpToken} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters