Skip to content

Commit c675994

Browse files
committed
Time Table - defaulted to remove time slot header on "days" view
1 parent 8653f9f commit c675994

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

library/src/components/timetable/LPTimeTable.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export interface LPTimeTableProps<
134134
/**
135135
* Show time slot header, when disabled, the header of the single time slots telling the time of the slot is not shown
136136
* (this is useful for a calendar view of days)
137-
* @default true
137+
* @default true if viewType is "hours", else false
138138
*/
139139
showTimeSlotHeader?: boolean
140140

@@ -208,7 +208,7 @@ const LPTimeTableImpl = <G extends TimeTableGroup, I extends TimeSlotBooking>({
208208
placeHolderHeight = "1.5rem",
209209
viewType = "hours",
210210
disableWeekendInteractions = true,
211-
showTimeSlotHeader = true,
211+
showTimeSlotHeader,
212212
hideOutOfRangeMarkers = false,
213213
nowOverwrite,
214214
}: LPTimeTableProps<G, I>) => {
@@ -504,7 +504,11 @@ const LPTimeTableImpl = <G extends TimeTableGroup, I extends TimeSlotBooking>({
504504
startDate={startDate}
505505
endDate={endDate}
506506
timeSlotsPerDay={timeSlotsPerDay}
507-
showTimeSlotHeader={showTimeSlotHeader}
507+
showTimeSlotHeader={
508+
showTimeSlotHeader == undefined
509+
? viewType === "hours"
510+
: showTimeSlotHeader
511+
}
508512
ref={tableHeaderRef}
509513
/>
510514
<tbody ref={tableBodyRef}>

0 commit comments

Comments
 (0)