Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion resources/js/components/ui/avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function AvatarImage({
return (
<AvatarPrimitive.Image
data-slot="avatar-image"
className={cn("aspect-square size-full", className)}
className={cn("aspect-square size-full object-cover", className)}
{...props}
/>
)
Expand Down
19 changes: 7 additions & 12 deletions resources/js/pages/settings/password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import InputError from '@/components/input-error';
import AppLayout from '@/layouts/app-layout';
import SettingsLayout from '@/layouts/settings/layout';
import { type BreadcrumbItem } from '@/types';
import { Transition } from '@headlessui/react';
import { Form, Head } from '@inertiajs/react';
import { useRef } from 'react';
import { toast } from 'sonner';

import HeadingSmall from '@/components/heading-small';
import { Button } from '@/components/ui/button';
Expand Down Expand Up @@ -36,6 +36,11 @@ export default function Password() {
{...PasswordController.update.form()}
options={{
preserveScroll: true,
onSuccess: () => {
toast.success('Password updated', {
description: 'Your password has been updated successfully.',
});
},
}}
resetOnError={['password', 'password_confirmation', 'current_password']}
resetOnSuccess
Expand All @@ -50,7 +55,7 @@ export default function Password() {
}}
className="space-y-6"
>
{({ errors, processing, recentlySuccessful }) => (
{({ errors, processing }) => (
<>
<div className="grid gap-2">
<Label htmlFor="current_password">Current password</Label>
Expand Down Expand Up @@ -101,16 +106,6 @@ export default function Password() {

<div className="flex items-center gap-4">
<Button disabled={processing} data-test="update-password-button">Save password</Button>

<Transition
show={recentlySuccessful}
enter="transition ease-in-out"
enterFrom="opacity-0"
leave="transition ease-in-out"
leaveTo="opacity-0"
>
<p className="text-sm text-neutral-600">Saved</p>
</Transition>
</div>
</>
)}
Expand Down
19 changes: 7 additions & 12 deletions resources/js/pages/settings/profile.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import ProfileController from '@/actions/App/Http/Controllers/Settings/ProfileController';
import { send } from '@/routes/verification';
import { type BreadcrumbItem, type SharedData } from '@/types';
import { Transition } from '@headlessui/react';
import { Form, Head, Link, usePage } from '@inertiajs/react';
import { toast } from 'sonner';

import { AvatarUpload } from '@/components/avatar-upload';
import DeleteUser from '@/components/delete-user';
Expand Down Expand Up @@ -41,10 +41,15 @@ export default function Profile({ mustVerifyEmail, status }: { mustVerifyEmail:
{...ProfileController.update.form()}
options={{
preserveScroll: true,
onSuccess: () => {
toast.success('Profile updated', {
description: 'Your profile has been updated successfully.',
});
},
}}
className="space-y-6"
>
{({ processing, recentlySuccessful, errors }) => (
{({ processing, errors }) => (
<>
<div className="grid gap-2">
<Label htmlFor="name">Name</Label>
Expand Down Expand Up @@ -104,16 +109,6 @@ export default function Profile({ mustVerifyEmail, status }: { mustVerifyEmail:
<Button disabled={processing} data-test="update-profile-button">
Save
</Button>

<Transition
show={recentlySuccessful}
enter="transition ease-in-out"
enterFrom="opacity-0"
leave="transition ease-in-out"
leaveTo="opacity-0"
>
<p className="text-sm text-neutral-600">Saved</p>
</Transition>
</div>
</>
)}
Expand Down
Loading