import {View} from "react-native-ui-lib"; import React, {useCallback, useRef, useState} from "react"; import {LayoutChangeEvent} from "react-native"; import CalendarViewSwitch from "@/components/pages/calendar/CalendarViewSwitch"; import {AddEventDialog} from "@/components/pages/calendar/AddEventDialog"; import {ManuallyAddEventModal} from "@/components/pages/calendar/ManuallyAddEventModal"; import {EventCalendar} from "@/components/pages/calendar/EventCalendar"; export const InnerCalendar = () => { const [calendarWidth, setCalendarWidth] = useState(0); const calendarContainerRef = useRef(null); const hasSetInitialSize = useRef(false); const onLayout = useCallback((event: LayoutChangeEvent) => { if (!hasSetInitialSize.current) { const width = event.nativeEvent.layout.width; setCalendarWidth(width); hasSetInitialSize.current = true; } }, []); return ( <> ) }