Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/components/CourseNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,19 @@ export default function CourseNode({ data }: NodeProps<CourseNodeType>) {
const { selectedCourse, highlightedSet } = useExplorerStore();
const dimmed = selectedCourse !== null && !highlightedSet.has(data.code);

const year = data.code.charAt(5);

const borderColour =
year === "1" ? "border-green-500" :
year === "2" ? "border-blue-500" :
year === "3" ? "border-yellow-500" :
year === "4" ? "border-red-500" :
"border-gray-300";


return (
<div
className="flex flex-col justify-center rounded border border-gray-300 bg-white px-3 py-2 shadow-sm transition-opacity duration-150"
className={`flex flex-col justify-center rounded border ${borderColour} bg-white px-3 py-2 shadow-sm transition-opacity duration-150`}
style={{ width: 180, height: 60, opacity: dimmed ? 0.25 : 1 }}
>
<Handle type="target" position={Position.Top} />
Expand Down
Loading