Skip to content

Commit b04f8ce

Browse files
committed
make vars less confusing
1 parent 3169ddb commit b04f8ce

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

src/components/ClassTable.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ import { HydrantContext } from "../lib/hydrant";
4646
import type { State } from "../lib/state";
4747
import { ColorClasses } from "../lib/colors";
4848

49-
import tableClasses from "./ClassTable.module.css";
49+
import classes from "./ClassTable.module.css";
5050

5151
const hydrantTheme = themeQuartz.withParams({
5252
accentColor: "var(--chakra-colors-fg)",
@@ -482,7 +482,6 @@ const StarButton = ({
482482
/** The table of all classes, along with searching and filtering with flags. */
483483
export function ClassTable() {
484484
const { state } = useContext(HydrantContext);
485-
const { classes } = state;
486485

487486
const gridRef = useRef<AgGridReact<ClassTableRow>>(null);
488487

@@ -534,7 +533,7 @@ export function ClassTable() {
534533
comparator: classSort,
535534
initialSort,
536535
maxWidth: 93,
537-
cellClass: tableClasses["underline-on-hover"],
536+
cellClass: classes["underline-on-hover"],
538537
...sortProps,
539538
},
540539
{
@@ -574,15 +573,15 @@ export function ClassTable() {
574573
// Setup rows
575574
const rowData: ClassTableRow[] = useMemo(
576575
() =>
577-
Array.from(classes.values(), (cls) => ({
576+
Array.from(state.classes.values(), (cls) => ({
578577
number: cls.number,
579578
rating: cls.evals.rating.slice(0, 3), // remove the "/7.0" if exists
580579
hours: cls.evals.hours,
581580
name: cls.name,
582581
class: cls,
583582
inCharge: cls.description.inCharge,
584583
})),
585-
[classes],
584+
[state.classes],
586585
);
587586

588587
const [inputFilter, setInputFilter] = useState<ClassFilter | null>(null);
@@ -614,7 +613,7 @@ export function ClassTable() {
614613
<AgGridReact<ClassTableRow>
615614
theme={hydrantTheme}
616615
ref={gridRef}
617-
rowClass={tableClasses.row}
616+
rowClass={classes.row}
618617
defaultColDef={defaultColDef}
619618
columnDefs={columnDefs}
620619
rowData={rowData}

src/lib/colors.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import type { ColorMode } from "../components/ui/color-mode";
22
import type { Activity } from "./activity";
33

4-
import colorClasses from "./colors.module.css";
4+
import classes from "./colors.module.css";
55

66
export const ColorClasses = {
7-
Muted: colorClasses.muted,
8-
Success: colorClasses.success,
9-
Warning: colorClasses.warning,
10-
Error: colorClasses.error,
11-
Normal: colorClasses.normal,
7+
Muted: classes.muted,
8+
Success: classes.success,
9+
Warning: classes.warning,
10+
Error: classes.error,
11+
Normal: classes.normal,
1212
} as const;
1313

1414
/** The type of color schemes. */

0 commit comments

Comments
 (0)