-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcalendar-section.tsx
More file actions
48 lines (44 loc) · 1.38 KB
/
calendar-section.tsx
File metadata and controls
48 lines (44 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import WeekCalendar from '@components/calendar/week-calendar';
import type { TabType } from '@components/tab/tab/constants/tab-type';
import TabList from '@components/tab/tab/tab-list';
import CalendarButton from '@pages/home/components/calendar-button';
interface CalendarSectionProps {
activeType: TabType;
onTabChange: (type: TabType) => void;
selectedDate: Date;
onDateChange: (date: Date) => void;
baseWeekDate: Date;
onOpenBottomSheet: () => void;
onWeekChange: (direction: 'prev' | 'next') => void;
}
const CalendarSection = ({
activeType,
onTabChange,
selectedDate,
onDateChange,
baseWeekDate,
onOpenBottomSheet,
onWeekChange,
}: CalendarSectionProps) => {
const handleTabChange = (type: TabType) => {
onTabChange(type);
};
return (
<section className="sticky top-0 z-[var(--z-under-header-section)] bg-gray-black px-[1.6rem] pt-[2.4rem]">
<WeekCalendar
entryDate={new Date()}
baseDate={baseWeekDate}
value={selectedDate}
onChange={(date) => {
onDateChange(date);
}}
onWeekChange={onWeekChange}
/>
<section className="mt-[2.5rem] flex justify-between">
<TabList colorMode="home" activeType={activeType} onTabChange={handleTabChange} />
<CalendarButton onOpenBottomSheet={onOpenBottomSheet} />
</section>
</section>
);
};
export default CalendarSection;