Skip to content

Commit

Permalink
use nupath display name
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelaZQ1 committed Feb 8, 2024
1 parent a6211ab commit adb5021
Showing 1 changed file with 37 additions and 29 deletions.
66 changes: 37 additions & 29 deletions packages/frontend/components/Sidebar/NUPathSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,24 @@ interface NUPathSectionProps {
dndIdPrefix: string;
loading?: boolean;
}

const nupathAbbreviations: [nupath: string, abbreviation: string][] = [
[NUPathEnum.ND, "ND"],
[NUPathEnum.EI, "EI"],
[NUPathEnum.IC, "IC"],
[NUPathEnum.FQ, "FQ"],
[NUPathEnum.SI, "SI"],
[NUPathEnum.AD, "AD"],
[NUPathEnum.DD, "DD"],
[NUPathEnum.ER, "ER"],
[NUPathEnum.WF, "WF"],
[NUPathEnum.WD, "WD"],
[NUPathEnum.WI, "WI"],
[NUPathEnum.EX, "EX"],
[NUPathEnum.CE, "CE"],
const nuPathDisplayAndAbbr: [
nupath: string,
displayName: string,
abbreviation: string
][] = [
[NUPathEnum.ND, "Natural and Designed World", "ND"],
[NUPathEnum.EI, "Creative Expression/Innovation", "EI"],
[NUPathEnum.IC, "Interpreting Culture", "IC"],
[NUPathEnum.FQ, "Formal and Quantitative Reasoning", "FQ"],
[NUPathEnum.SI, "Societies and Institutions", "SI"],
[NUPathEnum.AD, "Analyzing/Using Data", "AD"],
[NUPathEnum.DD, "Difference and Diversity", "DD"],
[NUPathEnum.ER, "Ethical Reasoning", "ER"],
[NUPathEnum.WF, "First Year Writing", "WF"],
[NUPathEnum.WD, "Advanced Writing in the Disciplines", "WD"],
[NUPathEnum.WI, "Writing Intensive", "WI"],
[NUPathEnum.EX, "Integration Experience", "EX"],
[NUPathEnum.CE, "Capstone Experience", "CE"],
];
const grey = "neutral.400";
const green = "states.success.main";
Expand Down Expand Up @@ -191,17 +194,20 @@ const NUPathSection: React.FC<NUPathSectionProps> = ({
Complete the following NUpath requirements.
</Text>
<>
{nupathAbbreviations.map(([nupath, abbreviation], idx) => {
const numTaken = nupathMap[nupath] || 0;
return (
<NUPathRequirement
key={idx}
abbreviation={abbreviation}
nupath={nupath}
numTaken={numTaken}
/>
);
})}
{nuPathDisplayAndAbbr.map(
([nupath, displayName, abbreviation], idx) => {
const numTaken = nupathMap[nupath] || 0;
return (
<NUPathRequirement
key={idx}
nupath={nupath}
abbreviation={abbreviation}
displayName={displayName}
numTaken={numTaken}
/>
);
}
)}
</>
</Box>
)}
Expand All @@ -211,14 +217,16 @@ const NUPathSection: React.FC<NUPathSectionProps> = ({
};

interface NUPathRequirementProps {
abbreviation: string;
nupath: string;
abbreviation: string;
displayName: string;
numTaken: number;
}

const NUPathRequirement: React.FC<NUPathRequirementProps> = ({
abbreviation,
nupath,
abbreviation,
displayName,
numTaken,
}) => {
const isWI = nupath === NUPathEnum.WI;
Expand Down Expand Up @@ -264,7 +272,7 @@ const NUPathRequirement: React.FC<NUPathRequirementProps> = ({
{abbreviation}
</Text>
<Text fontSize="sm" mr="4xs">
{nupath}
{displayName}
</Text>
{isWI && <HelperToolTip label="Complete 2 Writing Intensive courses" />}
</Flex>
Expand Down

0 comments on commit adb5021

Please sign in to comment.