@@ -1,4 +1,5 @@
|
||||
import { participationIdentity } from '@/lib/participation-identity';
|
||||
import { useTempoUi } from '@/components/tempo-brand';
|
||||
import { Form, Head, usePage } from '@inertiajs/react';
|
||||
import InputError from '@/components/input-error';
|
||||
import PasswordInput from '@/components/password-input';
|
||||
@@ -24,11 +25,12 @@ type Props = {
|
||||
};
|
||||
|
||||
export default function Login({ status, canResetPassword, qaAccount }: Props) {
|
||||
const { t } = useTempoUi();
|
||||
// A redirect from another page (e.g. MFA) creates a new Form with empty local errors.
|
||||
const pageErrors = usePage<{ errors: { email?: string } }>().props.errors;
|
||||
return (
|
||||
<>
|
||||
<Head title="Entrar" />
|
||||
<Head title={t('Entrar')} />
|
||||
|
||||
{qaAccount && (
|
||||
<aside
|
||||
@@ -48,9 +50,9 @@ export default function Login({ status, canResetPassword, qaAccount }: Props) {
|
||||
|
||||
{/* @chisel-passkeys */}
|
||||
<PasskeyVerify
|
||||
label="Entrar com chave de acesso"
|
||||
loadingLabel="A autenticar…"
|
||||
separator="Ou continuar com email"
|
||||
label={t('Entrar com chave de acesso')}
|
||||
loadingLabel={t('A autenticar…')}
|
||||
separator={t('Ou continuar com email')}
|
||||
/>
|
||||
{/* @end-chisel-passkeys */}
|
||||
|
||||
@@ -85,7 +87,7 @@ export default function Login({ status, canResetPassword, qaAccount }: Props) {
|
||||
<div className="grid gap-2">
|
||||
<div className="flex items-center">
|
||||
<Label htmlFor="password">
|
||||
Palavra-passe
|
||||
{t('Palavra-passe')}
|
||||
</Label>
|
||||
{canResetPassword && (
|
||||
<TextLink
|
||||
@@ -93,7 +95,7 @@ export default function Login({ status, canResetPassword, qaAccount }: Props) {
|
||||
className="ml-auto text-sm"
|
||||
tabIndex={5}
|
||||
>
|
||||
Esqueceu a palavra-passe?
|
||||
{t('Esqueceu a palavra-passe?')}
|
||||
</TextLink>
|
||||
)}
|
||||
</div>
|
||||
@@ -103,7 +105,7 @@ export default function Login({ status, canResetPassword, qaAccount }: Props) {
|
||||
required
|
||||
tabIndex={2}
|
||||
autoComplete="current-password"
|
||||
placeholder="Palavra-passe"
|
||||
placeholder={t('Palavra-passe')}
|
||||
/>
|
||||
<InputError message={errors.password} />
|
||||
</div>
|
||||
@@ -115,7 +117,7 @@ export default function Login({ status, canResetPassword, qaAccount }: Props) {
|
||||
tabIndex={3}
|
||||
/>
|
||||
<Label htmlFor="remember">
|
||||
Manter sessão iniciada
|
||||
{t('Manter sessão iniciada')}
|
||||
</Label>
|
||||
</div>
|
||||
|
||||
@@ -127,15 +129,15 @@ export default function Login({ status, canResetPassword, qaAccount }: Props) {
|
||||
data-test="login-button"
|
||||
>
|
||||
{processing && <Spinner />}
|
||||
Entrar
|
||||
{t('Entrar')}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{/* @chisel-registration */}
|
||||
<div className="text-muted-foreground text-center text-sm">
|
||||
Ainda não tem conta?{' '}
|
||||
{t('Ainda não tem conta?')}{' '}
|
||||
<TextLink href={register()} tabIndex={5}>
|
||||
Criar conta
|
||||
{t('Criar conta')}
|
||||
</TextLink>
|
||||
</div>
|
||||
{/* @end-chisel-registration */}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { participationIdentity } from '@/lib/participation-identity';
|
||||
import { useTempoUi } from '@/components/tempo-brand';
|
||||
import { Form, Head } from '@inertiajs/react';
|
||||
import InputError from '@/components/input-error';
|
||||
import PasswordInput from '@/components/password-input';
|
||||
@@ -15,9 +16,10 @@ type Props = {
|
||||
};
|
||||
|
||||
export default function Register({ passwordRules }: Props) {
|
||||
const { t } = useTempoUi();
|
||||
return (
|
||||
<>
|
||||
<Head title="Criar conta" />
|
||||
<Head title={t('Criar conta')} />
|
||||
<Form
|
||||
{...store.form()}
|
||||
resetOnSuccess={['password', 'password_confirmation']}
|
||||
@@ -28,7 +30,7 @@ export default function Register({ passwordRules }: Props) {
|
||||
<>
|
||||
<div className="grid gap-6">
|
||||
<div className="grid gap-2">
|
||||
<Label htmlFor="name">Nome</Label>
|
||||
<Label htmlFor="name">{t('Nome')}</Label>
|
||||
<Input
|
||||
id="name"
|
||||
defaultValue={participationIdentity().name}
|
||||
@@ -37,7 +39,7 @@ export default function Register({ passwordRules }: Props) {
|
||||
tabIndex={1}
|
||||
autoComplete="name"
|
||||
name="name"
|
||||
placeholder="Nome completo"
|
||||
placeholder={t('Nome completo')}
|
||||
/>
|
||||
<InputError
|
||||
message={errors.name}
|
||||
@@ -61,14 +63,14 @@ export default function Register({ passwordRules }: Props) {
|
||||
</div>
|
||||
|
||||
<div className="grid gap-2">
|
||||
<Label htmlFor="password">Palavra-passe</Label>
|
||||
<Label htmlFor="password">{t('Palavra-passe')}</Label>
|
||||
<PasswordInput
|
||||
id="password"
|
||||
required
|
||||
tabIndex={3}
|
||||
autoComplete="new-password"
|
||||
name="password"
|
||||
placeholder="Palavra-passe"
|
||||
placeholder={t('Palavra-passe')}
|
||||
passwordrules={passwordRules}
|
||||
/>
|
||||
<InputError message={errors.password} />
|
||||
@@ -76,7 +78,7 @@ export default function Register({ passwordRules }: Props) {
|
||||
|
||||
<div className="grid gap-2">
|
||||
<Label htmlFor="password_confirmation">
|
||||
Confirmar palavra-passe
|
||||
{t('Confirmar palavra-passe')}
|
||||
</Label>
|
||||
<PasswordInput
|
||||
id="password_confirmation"
|
||||
@@ -84,7 +86,7 @@ export default function Register({ passwordRules }: Props) {
|
||||
tabIndex={4}
|
||||
autoComplete="new-password"
|
||||
name="password_confirmation"
|
||||
placeholder="Confirmar palavra-passe"
|
||||
placeholder={t('Confirmar palavra-passe')}
|
||||
passwordrules={passwordRules}
|
||||
/>
|
||||
<InputError
|
||||
@@ -99,14 +101,14 @@ export default function Register({ passwordRules }: Props) {
|
||||
data-test="register-user-button"
|
||||
>
|
||||
{processing && <Spinner />}
|
||||
Criar conta
|
||||
{t('Criar conta')}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className="text-muted-foreground text-center text-sm">
|
||||
Já tem conta?{' '}
|
||||
{t('Já tem conta?')}{' '}
|
||||
<TextLink href={login()} tabIndex={6}>
|
||||
Entrar
|
||||
{t('Entrar')}
|
||||
</TextLink>
|
||||
</div>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user