Skip to content

Commit 6add6f1

Browse files
Added a dark mode (DONE) (#153)
* template colors but fully working and implemented
1 parent 3405e08 commit 6add6f1

22 files changed

Lines changed: 275 additions & 225 deletions

entrypoints/components/audit-card.tsx

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ const DegreeAuditCard: React.FC<DegreeAuditCardProps> = ({
3232
<div
3333
className={`relative rounded-[8px] px-4 py-[12px] w-full transition-all duration-200 cursor-pointer ${
3434
isSelected
35-
? "bg-[var(--color-dap-orange)] border border-[var(--color-dap-orange)]"
36-
: "bg-[#FAFAF9] border border-[var(--color-dap-border)]"
35+
? "bg-dap-orange border border-dap-orange"
36+
: "bg-background border border-dap-border"
3737
}`}
3838
onClick={() => {
3939
setMenuOpen(false);
@@ -44,7 +44,7 @@ const DegreeAuditCard: React.FC<DegreeAuditCardProps> = ({
4444
{/* Title */}
4545
<div
4646
className={`font-bold text-[18px] leading-tight ${
47-
isSelected ? "text-white" : "text-[var(--color-dap-orange)]"
47+
isSelected ? "text-white" : "text-dap-orange"
4848
}`}
4949
>
5050
{title}
@@ -54,12 +54,12 @@ const DegreeAuditCard: React.FC<DegreeAuditCardProps> = ({
5454
{/* Percentage Badge */}
5555
<div
5656
className={`rounded-[8px] px-3 py-2 flex items-center justify-center ${
57-
isSelected ? "bg-white" : "bg-[var(--color-dap-orange)]"
57+
isSelected ? "bg-background" : "bg-dap-orange"
5858
}`}
5959
>
6060
<span
6161
className={`text-base font-bold leading-tight ${
62-
isSelected ? "text-[var(--color-dap-orange)]" : "text-white"
62+
isSelected ? "text-dap-orange" : "text-white"
6363
}`}
6464
>
6565
{percentage}%
@@ -68,9 +68,7 @@ const DegreeAuditCard: React.FC<DegreeAuditCardProps> = ({
6868

6969
<button
7070
type="button"
71-
className={
72-
isSelected ? "text-white" : "text-[var(--color-dap-orange)]"
73-
}
71+
className={isSelected ? "text-white" : "text-dap-orange"}
7472
onClick={(e) => {
7573
e.stopPropagation();
7674
setMenuOpen((prev) => !prev);
@@ -85,18 +83,18 @@ const DegreeAuditCard: React.FC<DegreeAuditCardProps> = ({
8583

8684
{menuOpen && (
8785
<div
88-
className="absolute right-0 top-full z-30 mt-2 min-w-[180px] rounded-[8px] border border-[var(--color-dap-border)] bg-white p-2 shadow-lg"
86+
className="absolute right-0 top-full z-30 mt-2 min-w-[180px] rounded-[8px] border border-dap-border bg-background p-2 shadow-lg"
8987
onClick={(e) => e.stopPropagation()}
9088
>
91-
<button className="flex w-full items-center gap-2 rounded-md px-2 py-2 text-left text-[15px] text-[var(--color-dap-dark-alt)] hover:bg-gray-50">
89+
<button className="flex w-full items-center gap-2 rounded-md px-2 py-2 text-left text-[15px] hover:bg-hover-bg">
9290
<PencilSimpleLine size={20} className="shrink-0" />
9391
<span>Rename</span>
9492
</button>
95-
<button className="flex w-full items-center gap-2 rounded-md px-2 py-2 text-left text-[15px] text-[var(--color-dap-dark-alt)] hover:bg-gray-50">
93+
<button className="flex w-full items-center gap-2 rounded-md px-2 py-2 text-left text-[15px] hover:bg-hover-bg">
9694
<CopySimple size={20} className="shrink-0" />
9795
<span>Duplicate</span>
9896
</button>
99-
<button className="flex w-full items-center gap-2 rounded-md px-2 py-2 text-left text-[15px] text-[#c63636] hover:bg-red-50">
97+
<button className="flex w-full items-center gap-2 rounded-md px-2 py-2 text-left text-[15px] text-[#c63636] hover:bg-hover-bg">
10098
<Trash size={20} className="shrink-0" />
10199
<span>Delete Audit</span>
102100
</button>
@@ -116,15 +114,15 @@ export const DegreeAuditCardPopup: React.FC<DegreeAuditCardProps> = ({
116114
percentage = 90,
117115
}) => {
118116
return (
119-
<div className="bg-[#FAFAF9] rounded border border-[var(--color-dap-border)] px-3 py-[12px] w-full transition-all duration-200 cursor-pointer">
117+
<div className="bg-background rounded border border-dap-border px-3 py-[12px] w-full transition-all duration-200 cursor-pointer">
120118
<div className="flex items-center justify-between">
121119
{/* Title */}
122-
<div className="font-bold text-[18px] leading-tight text-[var(--color-dap-orange)]">
120+
<div className="font-bold text-[18px] leading-tight text-dap-orange">
123121
{title}
124122
</div>
125123

126124
{/* Percentage Badge */}
127-
<div className="bg-[var(--color-dap-orange)] rounded-md px-3 py-2 flex items-center justify-center">
125+
<div className="bg-dap-orange rounded-md px-3 py-2 flex items-center justify-center">
128126
<span className="text-white text-base font-bold leading-tight">
129127
{percentage}%
130128
</span>

entrypoints/components/banner.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import { AnimatePresence, motion } from "framer-motion";
1+
import { getAuditHistory } from "@/lib/backend/storage";
2+
import { XIcon } from "@phosphor-icons/react";
23
import { useEffect, useState } from "react";
4+
import noiseTexture from "../../assets/noise-texture.svg";
35
import ArrowTopRightIcon from "../../assets/svgs/arrow-top-right";
46
import DAPLogo from "../../assets/svgs/dap-logo";
57
import gridBg from "../../public/Grid.png";
6-
import noiseTexture from "../../assets/noise-texture.svg";
7-
import { XIcon } from "@phosphor-icons/react";
8-
import { getAuditHistory } from "@/lib/backend/storage";
98

109
const TryDAPBanner = () => {
1110
const [isOpen, setIsOpen] = useState(true);
@@ -90,7 +89,7 @@ const TryDAPBanner = () => {
9089
</p>
9190
</div>
9291
<button
93-
className="flex items-center gap-2 text-black absolute right-12 top-[55%] -translate-y-1/2 bg-white rounded-md px-4 py-2 cursor-pointer transition-all duration-300 ease-in-out transform scale-100 origin-center z-10 h-[44px]"
92+
className="flex items-center gap-2 absolute right-12 top-[55%] -translate-y-1/2 bg-background rounded-md px-4 py-2 cursor-pointer transition-all duration-300 ease-in-out transform scale-100 origin-center z-10 h-[44px]"
9493
onClick={handleTryItNow}
9594
>
9695
<ArrowTopRightIcon className="w-6 h-6" />
@@ -107,9 +106,9 @@ const TryDAPBanner = () => {
107106
</button>
108107
</div>
109108

110-
<div className="w-full h-[12px] bg-[var(--color-dap-orange-light)]" />
109+
<div className="w-full h-[12px] bg-dap-orange-light" />
111110

112-
<div className="w-full h-[6px] bg-[var(--color-dap-yellow)]" />
111+
<div className="w-full h-[6px] bg-dap-yellow" />
113112
</div>
114113
)}
115114
</div>

entrypoints/components/common/button.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ const styleMap: Record<
1818
none: "bg-transparent text-dap-primary border-transparent",
1919
},
2020
white: {
21-
solid: "bg-white text-black border-transparent",
21+
solid: "bg-background text-text border-transparent",
2222
outline: "bg-transparent text-white border-white",
2323
none: "bg-transparent text-white border-transparent",
2424
},
2525
black: {
26-
solid: "bg-gray-800 text-white border-transparent",
27-
outline: "bg-transparent text-gray-800 border-gray-800",
28-
none: "bg-transparent text-gray-800 border-transparent",
26+
solid: "bg-text text-background border-transparent",
27+
outline: "bg-transparent text-text border-text",
28+
none: "bg-transparent text-text border-transparent",
2929
},
3030
};
3131

@@ -149,7 +149,7 @@ export const ToggleSwitch = forwardRef<HTMLButtonElement, ToggleSwitchProps>(
149149
>
150150
<span
151151
className={cn(
152-
"inline-block rounded-full bg-white shadow-sm transform transition-transform duration-200 ease-in-out",
152+
"inline-block rounded-full bg-background shadow-sm transform transition-transform duration-200 ease-in-out",
153153
currentSize.thumb,
154154
currentSize.translate,
155155
)}

entrypoints/components/common/modal.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React from "react";
21
import { XIcon } from "@phosphor-icons/react";
2+
import React from "react";
33
import { cn } from "~/lib/utils";
44

55
type ModalSize = "sm" | "md" | "lg" | "xl" | "full";
@@ -52,7 +52,7 @@ export default function Modal({
5252
>
5353
<div
5454
className={cn(
55-
"bg-white rounded-lg shadow-xl w-full mx-4 overflow-hidden",
55+
"bg-background rounded-lg shadow-xl w-full mx-4 overflow-hidden",
5656
sizeClasses[size],
5757
className,
5858
)}
@@ -61,9 +61,7 @@ export default function Modal({
6161
{/* Header */}
6262
{showHeader && (
6363
<div className="flex items-center justify-between p-4 border-b border-gray-200">
64-
<h2 className="text-xl font-bold text-[var(--color-dap-dark)]">
65-
{title}
66-
</h2>
64+
<h2 className="text-xl font-bold text-dap-dark">{title}</h2>
6765
<button
6866
onClick={onClose}
6967
className="p-1 hover:bg-gray-100 rounded-full transition-colors"

entrypoints/components/common/select-dropdown.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { CaretDown } from "@phosphor-icons/react";
2-
import { useState, useRef, useEffect } from "react";
1+
import { CaretDownIcon } from "@phosphor-icons/react";
2+
import { useEffect, useRef, useState } from "react";
33
import { cn } from "~/lib/utils";
44

55
type SelectDropdownProps = {
@@ -44,14 +44,14 @@ export default function SelectDropdown({
4444
onClick={() => !disabled && setIsOpen(!isOpen)}
4545
disabled={disabled}
4646
className={cn(
47-
"w-full flex items-center justify-between px-3 py-2 border border-dap-border rounded-lg text-base bg-white cursor-pointer transition-all disabled:opacity-50 disabled:cursor-not-allowed",
47+
"w-full flex items-center justify-between px-3 py-2 border border-dap-border rounded-lg text-base bg-background cursor-pointer transition-all disabled:opacity-50 disabled:cursor-not-allowed",
4848
isOpen && "ring-2 ring-dap-orange border-transparent",
4949
)}
5050
>
51-
<span className={value ? "text-gray-900" : "text-gray-500"}>
51+
<span className={value ? "text-text" : "text-gray-500"}>
5252
{value || placeholder}
5353
</span>
54-
<CaretDown
54+
<CaretDownIcon
5555
size={20}
5656
className={cn(
5757
"text-gray-500 transition-transform",
@@ -61,7 +61,7 @@ export default function SelectDropdown({
6161
</button>
6262

6363
{isOpen && (
64-
<div className="absolute left-0 right-0 mt-2 bg-white border border-dap-border rounded-lg shadow-lg z-10 max-h-60 overflow-y-auto">
64+
<div className="absolute left-0 right-0 mt-2 bg-background border border-dap-border rounded-lg shadow-lg z-10 max-h-60 overflow-y-auto">
6565
<div className="p-2 space-y-1">
6666
{options.map((option) => (
6767
<button
@@ -72,10 +72,7 @@ export default function SelectDropdown({
7272
setIsOpen(false);
7373
}}
7474
className={cn(
75-
"w-full text-left px-4 py-3 rounded-lg text-base transition-colors",
76-
value === option
77-
? "bg-gray-100 text-gray-900"
78-
: "text-gray-700 hover:bg-gray-50",
75+
"w-full text-left px-4 py-3 rounded-lg text-base transition-colors text-text hover:bg-hover-bg",
7976
)}
8077
>
8178
{option}

entrypoints/components/course-add-modal.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { searchCatalogCourses } from "@/lib/backend/db";
21
import { getCurrentSemester } from "@/lib/backend/audit-scraper";
2+
import { searchCatalogCourses } from "@/lib/backend/db";
33
import type {
44
CatalogCourse,
55
CourseCode,
@@ -99,12 +99,12 @@ function DivisionToggle({
9999
>
100100
<div
101101
className={cn(
102-
"w-5 h-5 rounded-full transform transition-transform duration-200 absolute top-1/2 -translate-y-1/2 bg-white",
102+
"w-5 h-5 rounded-full transform transition-transform duration-200 absolute top-1/2 -translate-y-1/2 bg-background",
103103
checked ? "translate-x-[24px]" : "translate-x-1",
104104
)}
105105
/>
106106
</button>
107-
<span className="text-base text-gray-900">{label}</span>
107+
<span className="text-base text-text">{label}</span>
108108
</div>
109109
);
110110
}
@@ -423,12 +423,12 @@ function FulfillingCoursesContent({
423423
value={query}
424424
onChange={(event) => setQuery(event.target.value)}
425425
placeholder="Search fulfilling courses"
426-
className="w-full h-12 px-4 border border-[#E5E1DA] rounded-md text-base font-semibold placeholder:text-gray-400 focus:outline-none focus:ring-2 focus:ring-[#579D42] focus:border-transparent transition-all"
426+
className="w-full h-12 px-4 border border-dap-border rounded-md text-base font-semibold placeholder:text-gray-400 focus:outline-none focus:ring-2 focus:ring-dap-orange focus:border-transparent transition-all"
427427
/>
428428

429429
<div className="mt-4 space-y-3 max-h-[500px] overflow-y-auto pr-1">
430430
{isLoading ? (
431-
<div className="flex items-center gap-2 text-gray-600">
431+
<div className="flex items-center gap-2 text-muted">
432432
<CircleNotchIcon className="h-5 w-5 animate-spin" />
433433
<span>Loading fulfilling courses...</span>
434434
</div>
@@ -443,7 +443,7 @@ function FulfillingCoursesContent({
443443
key={course.uniqueId}
444444
onClick={() => setSelectedCourseId(course.uniqueId)}
445445
className={cn(
446-
"w-full min-h-[70px] grid grid-cols-[22px_1fr] items-stretch overflow-hidden rounded-md border bg-white text-left transition-colors",
446+
"w-full min-h-[70px] grid grid-cols-[22px_1fr] items-stretch overflow-hidden rounded-md border bg-background text-left transition-colors",
447447
isSelected
448448
? "border-2 border-[#579D42]"
449449
: "border-[#E5E1DA] hover:border-gray-300",
@@ -457,24 +457,24 @@ function FulfillingCoursesContent({
457457
/>
458458
</div>
459459
<div className="px-3 py-3">
460-
<p className="text-base font-semibold text-gray-900 leading-tight">
460+
<p className="text-base font-semibold leading-tight">
461461
{courseCode}
462462
</p>
463-
<p className="mt-2 text-sm font-medium text-black leading-tight">
463+
<p className="mt-2 text-sm font-medium leading-tight">
464464
{course.fullName}
465465
</p>
466466
</div>
467467
</button>
468468
);
469469
})
470470
) : (
471-
<div className="min-h-[180px] rounded-md border border-dashed border-[#E5E1DA] bg-[#FAFAF9] px-6 py-8 flex flex-col items-center justify-center text-center">
472-
<p className="text-lg font-semibold text-gray-900">
471+
<div className="min-h-[180px] rounded-md border border-dashed border-dap-border bg-background px-6 py-8 flex flex-col items-center justify-center text-center">
472+
<p className="text-lg font-semibold text-text">
473473
{hasSearchQuery
474474
? "No matching fulfilling courses"
475475
: "No fulfilling courses found"}
476476
</p>
477-
<p className="mt-2 text-sm text-gray-600">
477+
<p className="mt-2 text-sm text-muted">
478478
{hasSearchQuery
479479
? "Try a different course number, title, or instructor."
480480
: "This requirement does not have any catalog matches yet."}
@@ -578,13 +578,13 @@ export default function CourseAddModal({
578578
>
579579
<div
580580
className={cn(
581-
"bg-white rounded-md border border-dap-border shadow-2xl w-full max-w-[550px] max-h-[90vh] mx-4 transform transition-all duration-200 overflow-hidden",
581+
"bg-background rounded-md border border-dap-border shadow-2xl w-full max-w-[550px] max-h-[90vh] mx-4 transform transition-all duration-200 overflow-hidden",
582582
isOpen ? "scale-100 opacity-100" : "scale-95 opacity-0",
583583
)}
584584
onClick={(e) => e.stopPropagation()}
585585
>
586586
<div className="px-7 pt-7 pb-7">
587-
<h2 className="text-3xl leading-none font-bold text-gray-900 mb-8">
587+
<h2 className="text-3xl leading-none font-bold text-text mb-8">
588588
Fulfilling courses
589589
</h2>
590590
<FulfillingCoursesContent

entrypoints/components/course-card.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const CourseCardVisual = forwardRef<
4545
{...rest}
4646
ref={ref}
4747
className={cn(
48-
"bg-white rounded-md flex items-stretch overflow-hidden border-2 border-dap-border transition-all duration-200 hover:shadow-md hover:border-gray-300 cursor-pointer",
48+
"bg-background rounded-md flex items-stretch overflow-hidden border-2 border-dap-border transition-all duration-200 hover:shadow-md hover:border-gray-300 cursor-pointer",
4949
className,
5050
)}
5151
>
@@ -57,7 +57,7 @@ const CourseCardVisual = forwardRef<
5757
) : null}
5858
</div>
5959
<div className="py-3 px-3 flex-1">
60-
<p className="text-gray-900 font-semibold text-sm">{fullName}</p>
60+
<p className="text-text font-semibold text-sm">{fullName}</p>
6161
<p className="text-gray-500 text-xs">{courseName}</p>
6262
</div>
6363
{type === "add" && (

entrypoints/degree-audit/components/degree-audit-page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { CourseSearchPanel } from "@/entrypoints/components/course-add-modal";
44
import "@/entrypoints/styles/content.css";
55
import { formatMajorLabel } from "@/lib/utils";
66
import { useAuditContext } from "../providers/audit-provider";
7-
import { SimpleDegreeCompletionDonut } from "./degree-completion-donut";
7+
import DegreeCompletionDonut from "./degree-completion-donut";
88
import { CreditHourTotalsCard, GPATotalsCard } from "./gpa-credit-cards";
99
import RequirementBreakdown, {
1010
UnifiedDegreeCard,
@@ -38,12 +38,12 @@ const SidePanel = () => {
3838

3939
return (
4040
<VStack
41-
className="self-start sticky top-0 z-20 bg-white"
41+
className="self-start sticky top-0 z-20 bg-background"
4242
y="stretch"
4343
x="center"
4444
>
45-
<SimpleDegreeCompletionDonut size={300} />
46-
<div className="w-sm mt-10 p-3 rounded-lg border border-gray-200 bg-[#FAFAF9]">
45+
<DegreeCompletionDonut size={300} />
46+
<div className="w-sm mt-10 p-3 rounded-lg border border-gray-200 bg-background">
4747
<CourseSearchPanel />
4848
</div>
4949
<VStack gap={4} className="w-sm mt-4">

0 commit comments

Comments
 (0)