From f5063b0cffc017d7e24572c9766d69308c38ba96 Mon Sep 17 00:00:00 2001 From: AngelaZQ1 Date: Thu, 8 Feb 2024 16:59:47 -0500 Subject: [PATCH] styling --- .../components/Sidebar/NUPathSection.tsx | 62 ++++++++++--------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/packages/frontend/components/Sidebar/NUPathSection.tsx b/packages/frontend/components/Sidebar/NUPathSection.tsx index b7ddaf8dc..48d37390f 100644 --- a/packages/frontend/components/Sidebar/NUPathSection.tsx +++ b/packages/frontend/components/Sidebar/NUPathSection.tsx @@ -15,19 +15,20 @@ interface NUPathSectionProps { loading?: boolean; } -const nupathDisplayNames: [nupath: string, display: 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.AD, "Analyzing/Using Data (AD)"], - [NUPathEnum.DD, "Difference and Diversity (DD)"], - [NUPathEnum.ER, "Ethical Reasoning (ER)"], - [NUPathEnum.WF, "First Year Writing (WF)"], - [NUPathEnum.WI, "Writing Intensive (WI)"], - [NUPathEnum.WD, "Advanced Writing in the Disciplines (WD)"], - [NUPathEnum.EX, "Integration Experience (EX)"], - [NUPathEnum.CE, "Capstone Experience (CE)"], +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 grey = "neutral.400"; const green = "states.success.main"; @@ -65,7 +66,7 @@ const NUPathSection: React.FC = ({ return ( @@ -81,10 +82,10 @@ const NUPathSection: React.FC = ({ py="md" px="md" margin="0" - backgroundColor="neutral.main" + backgroundColor="neutral.50" transition="background-color 0.25s ease" _hover={{ - backgroundColor: "neutral.900", + backgroundColor: "neutral.100", }} _active={{ backgroundColor: "neutral.200", @@ -171,7 +172,9 @@ const NUPathSection: React.FC = ({ @@ -183,17 +186,17 @@ const NUPathSection: React.FC = ({ )} {opened && !loading && ( - + Complete the following NUpath requirements. <> - {nupathDisplayNames.map(([nupath, displayName], idx) => { + {nupathAbbreviations.map(([nupath, abbreviation], idx) => { const numTaken = nupathMap[nupath] || 0; return ( ); @@ -207,14 +210,14 @@ const NUPathSection: React.FC = ({ }; interface NUPathRequirementProps { + abbreviation: string; nupath: string; - displayName: string; numTaken: number; } const NUPathRequirement: React.FC = ({ + abbreviation, nupath, - displayName, numTaken, }) => { const isSatisfied = @@ -222,10 +225,7 @@ const NUPathRequirement: React.FC = ({ (nupath !== NUPathEnum.WI && numTaken >= 1); return ( - <> - - {displayName} {numTaken} {String(isSatisfied)} - + = ({ width="18px" height="18px" display="flex" + position="relative" transition="background 0.25s ease, color 0.25s ease, border 0.25s ease" transitionDelay="0.1s" alignItems="center" @@ -243,6 +244,7 @@ const NUPathRequirement: React.FC = ({ p="xs" > = ({ /> - + + {abbreviation} + + {nupath} + ); };