Skip to content

Commit 8832ef3

Browse files
committed
improved time table colors
1 parent 74ee208 commit 8832ef3

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

library/src/components/timetable/TimeLineTableSimplified.tsx

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ interface TimeLineTableSimplifiedProps<
4646
onGroupClick: ((_: G) => void) | undefined
4747
}
4848

49+
const weekendColor0 = token("elevation.surface.raised.hovered")
50+
const weekendColor1 = token("elevation.surface.raised.pressed")
51+
const dayColor0 = token("elevation.surface")
52+
const dayColor1 = token("elevation.surface.hovered")
53+
4954
/**
5055
* Creates the table rows for the given entries.
5156
*/
@@ -115,10 +120,7 @@ function GroupHeaderTableCell<G extends TimeTableGroup>({
115120
rowSpan={groupRowMax + 1}
116121
className={`${styles.groupHeader}`}
117122
style={{
118-
backgroundColor:
119-
groupNumber % 2 === 0
120-
? token("elevation.surface")
121-
: token("elevation.surface.hovered"),
123+
backgroundColor: groupNumber % 2 === 0 ? dayColor0 : dayColor1,
122124
}}
123125
>
124126
{renderGroup ? renderGroup({ group }) : <Group group={group} />}
@@ -158,11 +160,11 @@ function TableCell({
158160
paddingBottom: isLastGroupRow ? "10px" : undefined,
159161
backgroundColor: isWeekendDay
160162
? groupNumber % 2 === 0
161-
? token("color.background.neutral.hovered")
162-
: token("color.background.neutral.pressed")
163+
? weekendColor0
164+
: weekendColor1
163165
: groupNumber % 2 === 0
164-
? token("elevation.surface")
165-
: token("elevation.surface.hovered"),
166+
? dayColor0
167+
: dayColor1,
166168
cursor:
167169
isWeekendDay && disableWeekendInteractions
168170
? "not-allowed"
@@ -238,11 +240,11 @@ function PlaceholderTableCell<G extends TimeTableGroup>({
238240
const styles: CSSProperties = {
239241
backgroundColor: isWeekendDay
240242
? groupNumber % 2 === 0
241-
? token("color.background.neutral.hovered")
242-
: token("color.background.neutral.pressed")
243+
? weekendColor0
244+
: weekendColor1
243245
: groupNumber % 2 === 0
244-
? token("elevation.surface")
245-
: token("elevation.surface.hovered"),
246+
? dayColor0
247+
: dayColor1,
246248
verticalAlign: "top",
247249
cursor: "pointer",
248250
}

0 commit comments

Comments
 (0)