From d712854f02509f18a589138f989bdfe5b7f4e559 Mon Sep 17 00:00:00 2001 From: Jake Langlois Date: Thu, 24 Oct 2024 18:07:16 -0400 Subject: [PATCH] general sidebar component --- .../components/Sidebar/GenericSection.tsx | 104 ++++++++++++++++++ .../frontend/components/Sidebar/Sidebar.tsx | 2 + 2 files changed, 106 insertions(+) create mode 100644 packages/frontend/components/Sidebar/GenericSection.tsx diff --git a/packages/frontend/components/Sidebar/GenericSection.tsx b/packages/frontend/components/Sidebar/GenericSection.tsx new file mode 100644 index 000000000..11a144542 --- /dev/null +++ b/packages/frontend/components/Sidebar/GenericSection.tsx @@ -0,0 +1,104 @@ +import { + ChevronDownIcon, + ChevronUpIcon, + SmallCloseIcon, +} from "@chakra-ui/icons"; +import { Box, Flex, Stack, Text } from "@chakra-ui/react"; +import { useState } from "react"; + +interface ClassOptionProps { + type: "NUpath" | "Elective Placeholder"; +} + +const ClassOption: React.FC = ({ type }) => { + return ( + + {type === "NUpath" ? "NUpath" : "Elective Placeholder"} + + ); +}; + +const GenericSection: React.FC = () => { + const [opened, setOpened] = useState(false); + + return ( + + { + setOpened(!opened); + }} + direction="row" + justifyContent="space-between" + alignItems="flex-start" + color="dark.main" + fontWeight="bold" + py="md" + px="md" + margin="0" + backgroundColor="neutral.50" + transition="background-color 0.25s ease" + _hover={{ + backgroundColor: "neutral.100", + }} + _active={{ + backgroundColor: "neutral.200", + }} + display="flex" + position="sticky" + top="0px" + zIndex={1} + > + + + + + + General Placeholders + + + + {opened ? ( + + ) : ( + + )} + + + + {opened && ( + + + + + )} + + + ); +}; + +export default GenericSection; diff --git a/packages/frontend/components/Sidebar/Sidebar.tsx b/packages/frontend/components/Sidebar/Sidebar.tsx index 9917ccbad..a0da73ccd 100644 --- a/packages/frontend/components/Sidebar/Sidebar.tsx +++ b/packages/frontend/components/Sidebar/Sidebar.tsx @@ -31,6 +31,7 @@ import { HelperToolTip } from "../Help"; import NUPathSection from "./NUPathSection"; import DropdownWarning from "./DropdownWarning"; import { NUPathEnum } from "@graduate/common"; +import GenericSection from "./GenericSection"; export enum SidebarValidationStatus { Loading = "Loading", @@ -216,6 +217,7 @@ const Sidebar: React.FC = memo( > {courseData && ( <> +