Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix invalid hook call
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent dc8aae1 commit afa5a4b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions components/NewGameBan.tsx
Expand Up @@ -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",
Expand Down Expand Up @@ -67,7 +68,7 @@ export default function (props: { isOpen: boolean; onClose: () => void }) {
<Td>
<Link onClick={() => removeUser(user)}>Remove</Link>
</Td>
</Tr>
</Tr>,
);
}

Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -179,7 +180,7 @@ export default function (props: { isOpen: boolean; onClose: () => void }) {
method: "POST",
});

useToast()({
toast({
description: "User moderated",
status: "success",
title: "Success",
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit afa5a4b

Please sign in to comment.