Skip to content

Commit 10c61bf

Browse files
committed
making 'all-day' row sticky
1 parent 145b0e0 commit 10c61bf

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/components/CalendarBody.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const BOX_POSITION_OFFSET = 26;
2626
const HOUR_TO_DECIMAL = 1.666666667;
2727
const MIN_BOX_SIZE = 40;
2828
const TURQUOISE = '#36CFC9';
29+
const ALL_DAY_ROW = 0;
2930

3031
const EventBlock = <T extends GenericEvent>({
3132
event,
@@ -232,6 +233,20 @@ function Calendar<T extends GenericEvent>({
232233
pagination={false}
233234
bordered={true}
234235
showHeader={true}
236+
onRow={(_, rowIndex) => {
237+
if (rowIndex === ALL_DAY_ROW) {
238+
return {
239+
style: {
240+
backgroundColor: 'white',
241+
position: 'sticky',
242+
boxShadow: 'rgba(0, 0, 0, 0.05) -1px 4px 4px ',
243+
zIndex: 1,
244+
top: 0,
245+
},
246+
};
247+
}
248+
return {};
249+
}}
235250
scroll={{
236251
y: 1000,
237252
}}

0 commit comments

Comments
 (0)