- A adesão à autenticação de dois factores passa a mostrar o código QR (endpoint do Fortify) com a chave manual como alternativa; antes só havia a chave para escrever à mão. - Definições, perfil, aparência, apagar conta e o botão de mostrar palavra-passe estavam em inglês (texto do kit inicial). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
106 lines
3.6 KiB
TypeScript
106 lines
3.6 KiB
TypeScript
import { Form, Head, usePage } from '@inertiajs/react';
|
|
import ProfileController from '@/actions/App/Http/Controllers/Settings/ProfileController';
|
|
import DeleteUser from '@/components/delete-user';
|
|
import Heading from '@/components/heading';
|
|
import InputError from '@/components/input-error';
|
|
import { Button } from '@/components/ui/button';
|
|
import { Input } from '@/components/ui/input';
|
|
import { Label } from '@/components/ui/label';
|
|
import { edit } from '@/routes/profile';
|
|
import type { Auth } from '@/types';
|
|
|
|
type PageProps = {
|
|
auth: Auth;
|
|
};
|
|
|
|
export default function Profile() {
|
|
const { auth } = usePage<PageProps>().props;
|
|
|
|
return (
|
|
<>
|
|
<Head title="Perfil" />
|
|
|
|
<h1 className="sr-only">Perfil</h1>
|
|
|
|
<div className="space-y-6">
|
|
<Heading
|
|
variant="small"
|
|
title="Perfil"
|
|
description="Actualize o seu nome e endereço de email"
|
|
/>
|
|
|
|
<Form
|
|
{...ProfileController.update.form()}
|
|
options={{
|
|
preserveScroll: true,
|
|
}}
|
|
className="space-y-6"
|
|
>
|
|
{({ processing, errors }) => (
|
|
<>
|
|
<div className="grid gap-2">
|
|
<Label htmlFor="name">Nome</Label>
|
|
|
|
<Input
|
|
id="name"
|
|
className="mt-1 block w-full"
|
|
defaultValue={auth.user.name}
|
|
name="name"
|
|
required
|
|
autoComplete="name"
|
|
placeholder="Nome completo"
|
|
/>
|
|
|
|
<InputError
|
|
className="mt-2"
|
|
message={errors.name}
|
|
/>
|
|
</div>
|
|
|
|
<div className="grid gap-2">
|
|
<Label htmlFor="email">Endereço de email</Label>
|
|
|
|
<Input
|
|
id="email"
|
|
type="email"
|
|
className="mt-1 block w-full"
|
|
defaultValue={auth.user.email}
|
|
name="email"
|
|
required
|
|
autoComplete="username"
|
|
placeholder="Endereço de email"
|
|
/>
|
|
|
|
<InputError
|
|
className="mt-2"
|
|
message={errors.email}
|
|
/>
|
|
</div>
|
|
|
|
<div className="flex items-center gap-4">
|
|
<Button
|
|
disabled={processing}
|
|
data-test="update-profile-button"
|
|
>
|
|
Guardar
|
|
</Button>
|
|
</div>
|
|
</>
|
|
)}
|
|
</Form>
|
|
</div>
|
|
|
|
<DeleteUser />
|
|
</>
|
|
);
|
|
}
|
|
|
|
Profile.layout = {
|
|
breadcrumbs: [
|
|
{
|
|
title: 'Perfil',
|
|
href: edit(),
|
|
},
|
|
],
|
|
};
|