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