Skip to content

Commit dc29cf6

Browse files
committed
feat: refactor notification functions to streamline toast message handling
1 parent fe86208 commit dc29cf6

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/components/island/Island.hook.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,34 +34,34 @@ export const addIslandNotification = (toast: IslandNotificationProps) => {
3434
export const addIslandInfoNotification = (toast: Partial<IslandNotificationProps>) => {
3535
useIsland.getState().addToast({
3636
icon: <IconInfoCircle color={"#70ffb2"} size={16}/>,
37+
...toast,
3738
message: <Text c={"#70ffb2"}>{toast.message}</Text>,
38-
...toast
3939
})
4040
}
4141

4242
export const addIslandSuccessNotification = (toast: Partial<IslandNotificationProps>) => {
4343
useIsland.getState().addToast({
4444
icon: <IconCircleCheck color={"#29BF12"} size={16}/>,
45-
message: <Text c={"#29BF12"}>{toast.message}</Text>,
4645
index: 1,
47-
...toast
46+
...toast,
47+
message: <Text c={"#29BF12"}>{toast.message}</Text>,
4848
})
4949
}
5050

5151
export const addIslandWarningNotification = (toast: Partial<IslandNotificationProps>) => {
5252
useIsland.getState().addToast({
5353
icon: <IconAlertCircle color={"#FFBE0B"} size={16}/>,
54-
message: <Text c={"#FFBE0B"}>{toast.message}</Text>,
5554
index: 2,
56-
...toast
55+
...toast,
56+
message: <Text c={"#FFBE0B"}>{toast.message}</Text>,
5757
})
5858
}
5959

6060
export const addIslandErrorNotification = (toast: Partial<IslandNotificationProps>) => {
6161
useIsland.getState().addToast({
6262
icon: <IconCircleX color={"#D90429"} size={16}/>,
63-
message: <Text c={"#D90429"}>{toast.message}</Text>,
6463
index: 3,
65-
...toast
64+
...toast,
65+
message: <Text c={"#D90429"}>{toast.message}</Text>,
6666
})
6767
}

0 commit comments

Comments
 (0)