mirror of
https://github.com/urosran/cally.git
synced 2025-11-26 16:34:54 +00:00
Offset starting minutes to now
This commit is contained in:
@ -15,6 +15,8 @@ import {CalendarEvent} from "@/components/pages/calendar/interfaces";
|
||||
|
||||
interface EventCalendarProps {
|
||||
calendarHeight: number;
|
||||
// WAS USED FOR SCROLLABLE CALENDARS, PERFORMANCE WAS NOT OPTIMAL
|
||||
calendarWidth: number;
|
||||
}
|
||||
|
||||
const getTotalMinutes = () => {
|
||||
@ -95,8 +97,6 @@ export const EventCalendar: React.FC<EventCalendarProps> = React.memo(({calendar
|
||||
);
|
||||
}
|
||||
|
||||
console.log(offsetMinutes)
|
||||
|
||||
return (
|
||||
<Calendar
|
||||
bodyContainerStyle={styles.calHeader}
|
||||
|
||||
@ -10,11 +10,13 @@ import {EventCalendar} from "@/components/pages/calendar/EventCalendar";
|
||||
|
||||
export const InnerCalendar = () => {
|
||||
const [calendarHeight, setCalendarHeight] = useState(0);
|
||||
const [calendarWidth, setCalendarWidth] = useState(0);
|
||||
const calendarContainerRef = useRef(null);
|
||||
|
||||
const onLayout = (event: LayoutChangeEvent) => {
|
||||
const {height} = event.nativeEvent.layout;
|
||||
const {height, width} = event.nativeEvent.layout;
|
||||
setCalendarHeight(height);
|
||||
setCalendarWidth(width);
|
||||
};
|
||||
|
||||
return (
|
||||
@ -28,6 +30,7 @@ export const InnerCalendar = () => {
|
||||
{calendarHeight > 0 && (
|
||||
<EventCalendar
|
||||
calendarHeight={calendarHeight}
|
||||
calendarWidth={calendarWidth}
|
||||
/>
|
||||
)}
|
||||
</View>
|
||||
|
||||
Reference in New Issue
Block a user