diff --git a/app/(auth)/_layout.tsx b/app/(auth)/_layout.tsx index 662daa9..2edaa4e 100644 --- a/app/(auth)/_layout.tsx +++ b/app/(auth)/_layout.tsx @@ -23,8 +23,9 @@ import NavToDosIcon from "@/assets/svgs/NavToDosIcon"; import NavBrainDumpIcon from "@/assets/svgs/NavBrainDumpIcon"; import NavCalendarIcon from "@/assets/svgs/NavCalendarIcon"; import NavSettingsIcon from "@/assets/svgs/NavSettingsIcon"; -import {useAtom, useSetAtom} from "jotai"; +import { useAtom, useSetAtom } from "jotai"; import { + isFamilyViewAtom, settingsPageIndex, toDosPageIndex, userSettingsView, @@ -32,6 +33,7 @@ import { export default function TabLayout() { const { mutateAsync: signOut } = useSignOut(); + const setIsFamilyView = useSetAtom(isFamilyViewAtom); const setPageIndex = useSetAtom(settingsPageIndex); const setUserView = useSetAtom(userSettingsView); const setToDosIndex = useSetAtom(toDosPageIndex); @@ -79,6 +81,7 @@ export default function TabLayout() { setPageIndex(0); setToDosIndex(0); setUserView(true); + setIsFamilyView(false); }} icon={} /> @@ -91,6 +94,7 @@ export default function TabLayout() { setPageIndex(0); setToDosIndex(0); setUserView(true); + setIsFamilyView(false); }} icon={} /> @@ -118,6 +122,7 @@ export default function TabLayout() { setPageIndex(0); setToDosIndex(0); setUserView(true); + setIsFamilyView(false); }} icon={} /> @@ -130,6 +135,7 @@ export default function TabLayout() { setPageIndex(0); setToDosIndex(0); setUserView(true); + setIsFamilyView(false); }} icon={} /> @@ -142,6 +148,7 @@ export default function TabLayout() { setPageIndex(0); setToDosIndex(0); setUserView(true); + setIsFamilyView(false); }} label={"Manage Settings"} labelStyle={styles.label} diff --git a/app/(unauth)/cal_sync.tsx b/app/(unauth)/cal_sync.tsx new file mode 100644 index 0000000..0e9f15b --- /dev/null +++ b/app/(unauth)/cal_sync.tsx @@ -0,0 +1,246 @@ +import {SafeAreaView} from "react-native-safe-area-context"; +import {Button, Text, View} from "react-native-ui-lib"; +import React from "react"; +import {useCalSync} from "@/hooks/useCalSync"; +import GoogleIcon from "@/assets/svgs/GoogleIcon"; +import AppleIcon from "@/assets/svgs/AppleIcon"; +import OutlookIcon from "@/assets/svgs/OutlookIcon"; +import {useAuthContext} from "@/contexts/AuthContext"; +import {StyleSheet} from "react-native"; + +export default function Screen() { + const {profileData, setRedirectOverride} = useAuthContext() + const {handleStartGoogleSignIn, handleAppleSignIn, handleMicrosoftSignIn} = useCalSync() + + const hasSomeCalendarsSynced = + !!profileData?.appleAccounts || !!profileData?.microsoftAccounts || !!profileData?.googleAccounts + + return ( + + + + + Let's get started! + + + Add your calendar below to sync events to your Cally calendar + + + + + {!profileData?.googleAccounts && ( +