Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix various components
  • Loading branch information
regalijan committed May 12, 2024
1 parent 0a68358 commit 1c1b5c7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
4 changes: 3 additions & 1 deletion components/AppealCard.tsx
Expand Up @@ -127,7 +127,9 @@ export default function (props: AppealCardProps & { port?: MessagePort }) {
</Stack>
</CardBody>
<CardFooter pb="4px">
<Box display={props.open ? undefined : "none"}>
<Box
display={typeof props.approved === "number" ? "none" : "undefined"}
>
<Button colorScheme="red" onClick={() => showModal("Deny")}>
Deny
</Button>
Expand Down
20 changes: 17 additions & 3 deletions components/InactivityNoticeCard.tsx
Expand Up @@ -94,11 +94,13 @@ export default function (
</Text>
</Box>
) : null}
{props.decisions ? (
{Object.keys(props.decisions as { [k: string]: boolean }).length ? (
<Box>
<Heading size="xs">Decisions</Heading>
<UnorderedList>
{Object.entries(props.decisions).map(([dept, accepted]) => (
{Object.entries(
props.decisions as { [k: string]: boolean },
).map(([dept, accepted]) => (
<ListItem>
<Stack alignItems="center" direction="row">
<Text>{dept}:&nbsp;</Text>
Expand All @@ -111,7 +113,19 @@ export default function (
) : null}
</Stack>
</CardBody>
<CardFooter display={props.open ? undefined : "none"} pb="4px">
<CardFooter
display={
props.departments.length !==
Object.values(
props.decisions as {
[k: string]: boolean;
},
).length
? undefined
: "none"
}
pb="4px"
>
<Box>
<Button
colorScheme="red"
Expand Down
1 change: 1 addition & 0 deletions index.d.ts
Expand Up @@ -20,6 +20,7 @@ declare global {
type RequestContext = EventContext<Env, string, { [k: string]: any }>;

interface AppealCardProps {
approved: number | null;
ban_reason: string;
created_at: number;
id: string;
Expand Down

0 comments on commit 1c1b5c7

Please sign in to comment.