mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-03 06:56:15 +00:00
#591 - server-providers
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
import InputError from '@/components/ui/input-error';
|
||||
import { Transition } from '@headlessui/react';
|
||||
import { useForm } from '@inertiajs/react';
|
||||
import { FormEventHandler, useRef } from 'react';
|
||||
|
||||
@ -8,7 +7,8 @@ import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
import { Form, FormField, FormFields } from '@/components/ui/form';
|
||||
import { CheckIcon, LoaderCircleIcon } from 'lucide-react';
|
||||
import { LoaderCircleIcon } from 'lucide-react';
|
||||
import FormSuccessful from '@/components/form-successful';
|
||||
|
||||
export default function UpdatePassword() {
|
||||
const passwordInput = useRef<HTMLInputElement>(null);
|
||||
@ -96,11 +96,9 @@ export default function UpdatePassword() {
|
||||
<CardFooter className="gap-2">
|
||||
<Button form="update-password-form" disabled={processing}>
|
||||
{processing && <LoaderCircleIcon className="animate-spin" />}
|
||||
<FormSuccessful successful={recentlySuccessful} />
|
||||
Save password
|
||||
</Button>
|
||||
<Transition show={recentlySuccessful} enter="transition ease-in-out" enterFrom="opacity-0" leave="transition ease-in-out" leaveTo="opacity-0">
|
||||
<CheckIcon className="text-success" />
|
||||
</Transition>
|
||||
</CardFooter>
|
||||
</Card>
|
||||
);
|
||||
|
@ -4,18 +4,18 @@ import { Input } from '@/components/ui/input';
|
||||
import InputError from '@/components/ui/input-error';
|
||||
import { useForm, usePage } from '@inertiajs/react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Transition } from '@headlessui/react';
|
||||
import type { SharedData } from '@/types';
|
||||
import { FormEventHandler } from 'react';
|
||||
import { Form, FormField, FormFields } from '@/components/ui/form';
|
||||
import { CheckIcon, LoaderCircleIcon } from 'lucide-react';
|
||||
import { LoaderCircleIcon } from 'lucide-react';
|
||||
import FormSuccessful from '@/components/form-successful';
|
||||
|
||||
type ProfileForm = {
|
||||
name: string;
|
||||
email: string;
|
||||
};
|
||||
|
||||
export default function UpdateUser() {
|
||||
export default function UpdateProfile() {
|
||||
const { auth } = usePage<SharedData>().props;
|
||||
|
||||
const { data, setData, patch, errors, processing, recentlySuccessful } = useForm<Required<ProfileForm>>({
|
||||
@ -71,11 +71,9 @@ export default function UpdateUser() {
|
||||
<CardFooter className="gap-2">
|
||||
<Button form="update-profile-form" disabled={processing}>
|
||||
{processing && <LoaderCircleIcon className="animate-spin" />}
|
||||
<FormSuccessful successful={recentlySuccessful} />
|
||||
Save
|
||||
</Button>
|
||||
<Transition show={recentlySuccessful} enter="transition ease-in-out" enterFrom="opacity-0" leave="transition ease-in-out" leaveTo="opacity-0">
|
||||
<CheckIcon className="text-success" />
|
||||
</Transition>
|
||||
</CardFooter>
|
||||
</Card>
|
||||
);
|
@ -2,7 +2,7 @@ import { Head } from '@inertiajs/react';
|
||||
import SettingsLayout from '@/layouts/settings/layout';
|
||||
import Container from '@/components/container';
|
||||
import UpdatePassword from '@/pages/profile/components/update-password';
|
||||
import UpdateUser from '@/pages/profile/components/update-user';
|
||||
import UpdateProfile from '@/pages/profile/components/update-profile';
|
||||
import Heading from '@/components/heading';
|
||||
|
||||
export default function Profile() {
|
||||
@ -11,7 +11,7 @@ export default function Profile() {
|
||||
<Head title="Profile settings" />
|
||||
<Container className="max-w-5xl">
|
||||
<Heading title="Profile settings" description="Manage your profile settings." />
|
||||
<UpdateUser />
|
||||
<UpdateProfile />
|
||||
<UpdatePassword />
|
||||
</Container>
|
||||
</SettingsLayout>
|
||||
|
Reference in New Issue
Block a user