Skip to content

Commit c42cb9f

Browse files
committed
♻️ Refactor useCustomToast
1 parent 40b39fa commit c42cb9f

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

frontend/src/hooks/useCustomToast.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
1-
"use client"
2-
3-
import { toaster } from "@/components/ui/toaster"
1+
import { toast } from "sonner"
42

53
const useCustomToast = () => {
64
const showSuccessToast = (description: string) => {
7-
toaster.create({
8-
title: "Success!",
5+
toast.success("Success!", {
96
description,
10-
type: "success",
117
})
128
}
139

1410
const showErrorToast = (description: string) => {
15-
toaster.create({
16-
title: "Something went wrong!",
11+
toast.error("Something went wrong!", {
1712
description,
18-
type: "error",
1913
})
2014
}
2115

0 commit comments

Comments
 (0)