feat(event-form): replace toast notification with custom ToastInner component
This commit is contained in:
parent
e9f60a0d00
commit
eb725020f5
1 changed files with 11 additions and 5 deletions
|
@ -14,7 +14,7 @@ import {
|
|||
import ParticipantListEntry from '@/components/custom-ui/participantListEntry';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { toast } from 'sonner';
|
||||
import { CalendarCheck } from 'lucide-react';
|
||||
import { ToastInner } from '@/components/misc/toast-inner';
|
||||
|
||||
interface EventFormProps {
|
||||
type: 'create' | 'edit';
|
||||
|
@ -134,10 +134,16 @@ const EventForm: React.FC<EventFormProps> = (props) => {
|
|||
createEvent({ data });
|
||||
}
|
||||
|
||||
toast('Event saved successfully', {
|
||||
description: `Your event "${data.title}" has been saved.`,
|
||||
icon: <CalendarCheck />,
|
||||
});
|
||||
toast.custom((t) => (
|
||||
<ToastInner
|
||||
toastId={t}
|
||||
title='Event saved'
|
||||
description={event?.title}
|
||||
onAction={() => router.push(`/event/${event?.id}`)}
|
||||
variant='success'
|
||||
buttonText='show'
|
||||
/>
|
||||
));
|
||||
|
||||
router.back();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue