diff --git a/components/NewGameBan.tsx b/components/NewGameBan.tsx index 390eac9..58a6cb4 100644 --- a/components/NewGameBan.tsx +++ b/components/NewGameBan.tsx @@ -27,6 +27,7 @@ import { useState } from "react"; export default function (props: { isOpen: boolean; onClose: () => void }) { const actionMap: { [k: string]: number } = {}; const [rows, setRows] = useState([] as JSX.Element[]); + const toast = useToast(); const fileTypes: { [k: string]: string } = { gif: "image/gif", heic: "image/heic", @@ -67,7 +68,7 @@ export default function (props: { isOpen: boolean; onClose: () => void }) { removeUser(user)}>Remove - + , ); } @@ -130,7 +131,7 @@ export default function (props: { isOpen: boolean; onClose: () => void }) { }); if (!submitReq.ok) { - useToast()({ + toast({ description: ((await submitReq.json()) as { error: string }).error, status: "error", title: "Failed to submit report", @@ -162,7 +163,7 @@ export default function (props: { isOpen: boolean; onClose: () => void }) { method: "POST", }); - useToast()({ + toast({ description: "Failed to upload file", status: "error", title: "Error", @@ -179,7 +180,7 @@ export default function (props: { isOpen: boolean; onClose: () => void }) { method: "POST", }); - useToast()({ + toast({ description: "User moderated", status: "success", title: "Success", @@ -209,7 +210,7 @@ export default function (props: { isOpen: boolean; onClose: () => void }) { 0 > 1 || user.match(/\W/) ) { - useToast()({ + toast({ description: "Check the username and try again", duration: 5000, isClosable: true,