From da69eff9058647bcfc90fe95b1eea76a582ddf51 Mon Sep 17 00:00:00 2001
From: Grace Tian <66385449+snowmonkey18@users.noreply.github.com>
Date: Wed, 22 Jan 2025 03:05:10 -0500
Subject: [PATCH 1/4] Add my starred classes
---
package-lock.json | 1 -
src/components/ClassTable.tsx | 69 ++++++++++++++++++++++++++---------
src/lib/state.ts | 31 ++++++++++++++++
src/lib/store.ts | 1 +
4 files changed, 84 insertions(+), 18 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 0838286..f3a1d00 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -530,7 +530,6 @@
},
"node_modules/@clack/prompts/node_modules/is-unicode-supported": {
"version": "1.3.0",
- "extraneous": true,
"inBundle": true,
"license": "MIT",
"engines": {
diff --git a/src/components/ClassTable.tsx b/src/components/ClassTable.tsx
index 0414442..39c2eb9 100644
--- a/src/components/ClassTable.tsx
+++ b/src/components/ClassTable.tsx
@@ -9,7 +9,7 @@ import {
import { Box, Group, Flex, Image, Input } from "@chakra-ui/react";
import React, { useEffect, useMemo, useRef, useState } from "react";
-import { LuPlus, LuMinus, LuSearch } from "react-icons/lu";
+import { LuPlus, LuMinus, LuSearch, LuStar } from "react-icons/lu";
import { InputGroup } from "./ui/input-group";
import { Button, LabelledButton } from "./ui/button";
@@ -201,10 +201,11 @@ function ClassInput(props: {
);
}
-type FilterGroup = Array<[keyof Flags | "fits", string, string?]>;
+type FilterGroup = Array<[keyof Flags | "fits" | "starred", string, React.ReactNode?]>;
/** List of top filter IDs and their displayed names. */
const CLASS_FLAGS_1: FilterGroup = [
+ ["starred", "My starred", ],
["hass", "HASS"],
["cih", "CI-H"],
["fits", "Fits schedule"],
@@ -245,7 +246,7 @@ function ClassFlags(props: {
const { setFlagsFilter, state, updateFilter } = props;
// Map from flag to whether it's on.
- const [flags, setFlags] = useState