Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Hopefully fix ui mismatch on strikes page
  • Loading branch information
regalijan committed Dec 6, 2024
1 parent 436427a commit 19a7dbb
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions app/routes/et-members_.strikes_.$uid.tsx
Expand Up @@ -24,7 +24,7 @@ import {
} from "@chakra-ui/react";
import { LoaderFunctionArgs } from "@remix-run/cloudflare";
import { useLoaderData } from "@remix-run/react";
import { useEffect, useState } from "react";
import { useState } from "react";

export async function loader({
context,
Expand Down Expand Up @@ -60,15 +60,11 @@ export async function loader({

export default function () {
const { can_manage, strikes, user } = useLoaderData<typeof loader>();
const [strikeData, setStrikeData] = useState([] as typeof strikes);
const [strikeData, setStrikeData] = useState(strikes);
const toast = useToast();
const [rmStrikeId, setRmStrikeId] = useState("");
const [strikeReason, setStrikeReason] = useState("");

useEffect(() => {
setStrikeData(strikes);
}, []);

async function removeStrike(id: string) {
const removeResp = await fetch(`/api/events-team/strikes/${id}`, {
method: "DELETE",
Expand Down Expand Up @@ -208,10 +204,12 @@ export default function () {
<TableContainer>
<Table variant="simple">
<Thead>
<Th>Time Added</Th>
<Th>Added By</Th>
<Th>Reason</Th>
<Th>Remove</Th>
<Tr>
<Th>Time Added</Th>
<Th>Added By</Th>
<Th>Reason</Th>
<Th>Remove</Th>
</Tr>
</Thead>
<Tbody>
{strikeData.map((strike: { [k: string]: any }) => (
Expand Down

0 comments on commit 19a7dbb

Please sign in to comment.