Offset starting minutes to now

This commit is contained in:
Milan Paunovic
2024-10-20 14:04:22 +02:00
parent d3dfca9a4f
commit b3fdd52aff
2 changed files with 6 additions and 3 deletions

View File

@ -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}

View File

@ -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>