tablet event and todo filtering

This commit is contained in:
ivic00
2024-12-08 16:49:39 +01:00
parent f382d403cd
commit 3fe46f1954
7 changed files with 198 additions and 134 deletions

View File

@ -320,20 +320,14 @@ export default function TabLayout() {
name="index"
options={{
drawerLabel: "Calendar",
title:
Device.deviceType === DeviceType.TABLET
? "Family Calendar"
: "Calendar",
title: "Calendar",
}}
/>
<Drawer.Screen
name="calendar"
options={{
drawerLabel: "Calendar",
title:
Device.deviceType === DeviceType.TABLET
? "Family Calendar"
: "Calendar",
title: "Calendar",
drawerItemStyle: { display: "none" },
}}
/>

View File

@ -1,4 +1,4 @@
import React from "react";
import React, { useEffect } from "react";
import {RefreshControl, ScrollView, View} from "react-native";
import CalendarPage from "@/components/pages/calendar/CalendarPage";
import TabletCalendarPage from "@/components/pages/(tablet_pages)/calendar/TabletCalendarPage";
@ -6,10 +6,20 @@ import * as Device from "expo-device";
import {DeviceType} from "expo-device";
import {useCalSync} from "@/hooks/useCalSync";
import {colorMap} from "@/constants/colorMap";
import { useSetAtom } from "jotai";
import { selectedUserAtom } from "@/components/pages/calendar/atoms";
import { useAuthContext } from "@/contexts/AuthContext";
export default function Screen() {
const isTablet = Device.deviceType === DeviceType.TABLET;
const {resyncAllCalendars, isSyncing} = useCalSync();
const setSelectedUser = useSetAtom(selectedUserAtom);
const {profileData} = useAuthContext()
useEffect(() => {
if(!isTablet && profileData) setSelectedUser({firstName: profileData.firstName, lastName: profileData.lastName, eventColor: profileData.eventColor})
}, [])
const onRefresh = React.useCallback(async () => {
try {