Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Finish base of inactivity notice modal
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent c6c1297 commit c057d2e
Showing 1 changed file with 48 additions and 1 deletion.
49 changes: 48 additions & 1 deletion components/NewInactivityNotice.tsx
@@ -1,25 +1,72 @@
import {
Checkbox,
CheckboxGroup,
Modal,
ModalBody,
ModalCloseButton,
ModalContent,
ModalHeader,
ModalOverlay,
Text,
Textarea,
VStack,
} from "@chakra-ui/react";
import { useState } from "react";

export default function (props: {
departments: string[];
isOpen: boolean;
onClose: () => void;
}) {
const [departments, setDepartments] = useState([] as string[]);
function reset() {
(document.getElementById("start") as HTMLInputElement).value = "";
(document.getElementById("end") as HTMLInputElement).value = "";
(document.getElementById("reason") as HTMLTextAreaElement).value = "";

props.onClose();
}

async function submit() {
const start = (document.getElementById("start") as HTMLInputElement).value;
const end = (document.getElementById("start") as HTMLInputElement).value;
const reason = (document.getElementById("reason") as HTMLTextAreaElement)
.value;
}

return (
<>
<Modal isCentered isOpen={props.isOpen} onClose={props.onClose}>
<ModalOverlay />
<ModalContent>
<ModalHeader>New Inactivity Notice</ModalHeader>
<ModalCloseButton />
<ModalBody></ModalBody>
<ModalBody>
<Text>Start Date</Text>
<input id="start" type="date" />
<br />
<br />
<Text>End Date</Text>
<input id="end" type="date" />
<br />
<br />
<Text>Reason</Text>
<Textarea
id="reason"
placeholder="Your reason for making this inactivity notice"
/>
<br />
<br />
<CheckboxGroup onChange={(a: string[]) => setDepartments(a)}>
<VStack>
{props.departments.map((d) => (
<Checkbox key={d} value={d}>
{d}
</Checkbox>
))}
</VStack>
</CheckboxGroup>
</ModalBody>
</ModalContent>
</Modal>
</>
Expand Down

0 comments on commit c057d2e

Please sign in to comment.