Skip to content

Commit 993e655

Browse files
authored
Merge branch 'dev' into seoyeon
2 parents 128e8ad + b956770 commit 993e655

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

src/widgets/Week/PeriodBar.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ import { useMemo, useCallback } from "react";
22
import type { Event, CalendarEvent } from "@/util/types";
33
import { clampDate, dayIndexFromWeekStart } from "@/util/weekly_timetable/time";
44
import 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";
610
import type { CSSProperties } from "react";
711

812
type 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 (

0 commit comments

Comments
 (0)