File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,7 +2,11 @@ import { useMemo, useCallback } from "react";
22import type { Event , CalendarEvent } from "@/util/types" ;
33import { clampDate , dayIndexFromWeekStart } from "@/util/weekly_timetable/time" ;
44import styles from "@styles/PeriodBar.module.css" ;
5- import { CATEGORY_COLORS } from "@/util/constants" ;
5+ import {
6+ CATEGORY_COLORS ,
7+ CATEGORY_OTHER_INDEX ,
8+ CATEGORY_TEXT_COLORS ,
9+ } from "@/util/constants" ;
610import type { CSSProperties } from "react" ;
711
812type Props = {
@@ -149,16 +153,20 @@ export function PeriodBars({
149153 const displayTitle = truncate40 ( b . title ) ;
150154
151155 const categoryId = b . raw . resource . event . eventTypeId ;
152- const color = CATEGORY_COLORS [ categoryId ] ?? "#999" ;
156+ const lineColor =
157+ CATEGORY_COLORS [ categoryId ] ?? CATEGORY_COLORS [ CATEGORY_OTHER_INDEX ] ;
158+ const textColor =
159+ CATEGORY_TEXT_COLORS [ categoryId ] ??
160+ CATEGORY_TEXT_COLORS [ CATEGORY_OTHER_INDEX ] ;
153161
154162 const style : CSSVarStyle = {
155163 left : `${ leftPct } px` ,
156164 width : `${ widthPct } px` ,
157165 bottom : b . lane * ( laneHeight + laneGap ) ,
158166 height : laneHeight ,
159167
160- "--period-line" : color ,
161- "--period-text" : color ,
168+ "--period-line" : lineColor ,
169+ "--period-text" : textColor ,
162170 } ;
163171
164172 return (
You can’t perform that action at this time.
0 commit comments