mirror of
https://github.com/urosran/cally.git
synced 2025-11-26 00:24:53 +00:00
Syncing rework
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import React, {useMemo} from "react";
|
||||
import React from "react";
|
||||
import {Drawer} from "expo-router/drawer";
|
||||
import {useSignOut} from "@/hooks/firebase/useSignOut";
|
||||
import {DrawerContentScrollView, DrawerNavigationOptions, DrawerNavigationProp} from "@react-navigation/drawer";
|
||||
@ -64,46 +64,42 @@ export default function TabLayout() {
|
||||
const setUserView = useSetAtom(userSettingsView);
|
||||
const setToDosIndex = useSetAtom(toDosPageIndex);
|
||||
|
||||
const screenOptions = useMemo(
|
||||
() =>
|
||||
({
|
||||
navigation,
|
||||
route,
|
||||
}: {
|
||||
navigation: DrawerNavigationProp<DrawerParamList>;
|
||||
route: RouteProp<DrawerParamList>;
|
||||
}): DrawerNavigationOptions => ({
|
||||
headerShown: true,
|
||||
headerTitleAlign: Device.deviceType === DeviceType.TABLET ? "left" : "center",
|
||||
headerTitleStyle: {
|
||||
fontFamily: "Manrope_600SemiBold",
|
||||
fontSize: Device.deviceType === DeviceType.TABLET ? 22 : 17,
|
||||
},
|
||||
headerLeft: () => (
|
||||
<TouchableOpacity
|
||||
onPress={navigation.toggleDrawer}
|
||||
style={{marginLeft: 16}}
|
||||
>
|
||||
<DrawerIcon/>
|
||||
</TouchableOpacity>
|
||||
),
|
||||
headerRight: () => {
|
||||
const showViewSwitch = ["calendar", "todos", "index"].includes(route.name);
|
||||
const screenOptions = ({
|
||||
navigation,
|
||||
route,
|
||||
}: {
|
||||
navigation: DrawerNavigationProp<DrawerParamList>;
|
||||
route: RouteProp<DrawerParamList>;
|
||||
}): DrawerNavigationOptions => ({
|
||||
headerShown: true,
|
||||
headerTitleAlign: Device.deviceType === DeviceType.TABLET ? "left" : "center",
|
||||
headerTitleStyle: {
|
||||
fontFamily: "Manrope_600SemiBold",
|
||||
fontSize: Device.deviceType === DeviceType.TABLET ? 22 : 17,
|
||||
},
|
||||
headerLeft: () => (
|
||||
<TouchableOpacity
|
||||
onPress={navigation.toggleDrawer}
|
||||
style={{marginLeft: 16}}
|
||||
>
|
||||
<DrawerIcon/>
|
||||
</TouchableOpacity>
|
||||
),
|
||||
headerRight: () => {
|
||||
const showViewSwitch = ["calendar", "todos", "index"].includes(route.name);
|
||||
|
||||
if (Device.deviceType !== DeviceType.TABLET || !showViewSwitch) {
|
||||
return null;
|
||||
}
|
||||
if (Device.deviceType !== DeviceType.TABLET || !showViewSwitch) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return <MemoizedViewSwitch navigation={navigation}/>;
|
||||
},
|
||||
drawerStyle: {
|
||||
width: Device.deviceType === DeviceType.TABLET ? "30%" : "90%",
|
||||
backgroundColor: "#f9f8f7",
|
||||
height: "100%",
|
||||
},
|
||||
}),
|
||||
[]
|
||||
);
|
||||
return <MemoizedViewSwitch navigation={navigation}/>;
|
||||
},
|
||||
drawerStyle: {
|
||||
width: Device.deviceType === DeviceType.TABLET ? "30%" : "90%",
|
||||
backgroundColor: "#f9f8f7",
|
||||
height: "100%",
|
||||
},
|
||||
})
|
||||
|
||||
return (
|
||||
<Drawer
|
||||
|
||||
@ -58,7 +58,7 @@ export default function Screen() {
|
||||
]}
|
||||
tintColor={colorMap.pink}
|
||||
progressBackgroundColor={"white"}
|
||||
refreshing={refreshing || isSyncing}
|
||||
refreshing={isSyncing}
|
||||
onRefresh={onRefresh}
|
||||
style={{
|
||||
position: "absolute",
|
||||
@ -72,7 +72,7 @@ export default function Screen() {
|
||||
}
|
||||
bounces={true}
|
||||
showsVerticalScrollIndicator={false}
|
||||
pointerEvents={refreshing || isSyncing ? "auto" : "none"}
|
||||
pointerEvents={isSyncing ? "auto" : "none"}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user