Skip to content

Commit

Permalink
Abstract into another function
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonLim8890 committed Apr 10, 2024
1 parent 36eb895 commit c38ab10
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 42 deletions.
40 changes: 40 additions & 0 deletions packages/frontend/components/Sidebar/DropdownWarning.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import React from "react";
import { InfoIcon } from "@chakra-ui/icons";
import {
Accordion,
AccordionItem,
AccordionButton,
AccordionIcon,
AccordionPanel,
Text,
} from "@chakra-ui/react";

const DropdownWarning = () => {
return (
<Accordion pb="sm" allowToggle>
<AccordionItem
borderRadius="lg"
backgroundColor="informationBadge.back"
border="1px #5F6CF6 solid"
>
<AccordionButton>
<InfoIcon mr="xs" color="informationBadge.main" />
<Text fontWeight="semibold" textAlign="left" fontSize="md" flex="1">
Heads up!
</Text>
<AccordionIcon color="informationBadge.main" />
</AccordionButton>
<AccordionPanel>
<Text fontSize="sm">
This is our representation of the degree audit. It may not be fully
accurate. Kindly always reference the actual degree audit for
validating your graduation eligibility. We are actively working to
improve this.
</Text>
</AccordionPanel>
</AccordionItem>
</Accordion>
);
};

export default DropdownWarning;
45 changes: 3 additions & 42 deletions packages/frontend/components/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
import {
Accordion,
AccordionButton,
AccordionIcon,
AccordionItem,
AccordionPanel,
Badge,
Box,
Flex,
Heading,
Link,
Stack,
Text,
} from "@chakra-ui/react";
import { Badge, Box, Flex, Heading, Link, Stack, Text } from "@chakra-ui/react";
import {
MajorValidationError,
MajorValidationResult,
Expand Down Expand Up @@ -43,6 +30,7 @@ import { useFetchCourses, useMajor } from "../../hooks";
import { HelperToolTip } from "../Help";
import NUPathSection from "./NUPathSection";
import { InfoIcon } from "@chakra-ui/icons";

Check failure on line 32 in packages/frontend/components/Sidebar/Sidebar.tsx

View workflow job for this annotation

GitHub Actions / Run linting for all packages

'InfoIcon' is defined but never used. Allowed unused vars must match /^_/u
import DropdownWarning from "./DropdownWarning";

export enum SidebarValidationStatus {
Loading = "Loading",
Expand Down Expand Up @@ -360,34 +348,7 @@ const SidebarContainer: React.FC<PropsWithChildren<SidebarContainerProps>> = ({
</Text>
)}
</Box>
<Accordion pb="sm" allowToggle>
<AccordionItem
borderRadius="lg"
backgroundColor="informationBadge.back"
border="1px #5F6CF6 solid"
>
<AccordionButton>
<InfoIcon mr="xs" color="informationBadge.main" />
<Text
fontWeight="semibold"
textAlign="left"
fontSize="md"
flex="1"
>
Heads up!
</Text>
<AccordionIcon color="informationBadge.main" />
</AccordionButton>
<AccordionPanel>
<Text fontSize="sm">
This is our representation of the degree audit. It may not be
fully accurate. Kindly always reference the actual degree audit
for validating your graduation eligibility. We are actively
working to improve this.
</Text>
</AccordionPanel>
</AccordionItem>
</Accordion>
<DropdownWarning />
{creditsTaken !== undefined && (
<Flex mb="sm" alignItems="baseline" columnGap="xs">
<Text
Expand Down

0 comments on commit c38ab10

Please sign in to comment.