diff --git a/.idea/git_toolbox_blame.xml b/.idea/git_toolbox_blame.xml new file mode 100644 index 0000000..7dc1249 --- /dev/null +++ b/.idea/git_toolbox_blame.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..55001da --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/.idea/jsLinters/eslint.xml b/.idea/jsLinters/eslint.xml new file mode 100644 index 0000000..541945b --- /dev/null +++ b/.idea/jsLinters/eslint.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/app.json b/app.json index 928f636..476fa76 100644 --- a/app.json +++ b/app.json @@ -17,7 +17,10 @@ "bundleIdentifier": "com.cally.app", "googleServicesFile": "./ios/GoogleService-Info.plist", "buildNumber": "74", - "usesAppleSignIn": true + "usesAppleSignIn": true, + "infoPlist": { + "ITSAppUsesNonExemptEncryption": false + } }, "android": { "adaptiveIcon": { diff --git a/app/(auth)/_layout.tsx b/app/(auth)/_layout.tsx index 394628a..7e31eff 100644 --- a/app/(auth)/_layout.tsx +++ b/app/(auth)/_layout.tsx @@ -1,15 +1,9 @@ -import React, { useEffect } from "react"; -import { Drawer } from "expo-router/drawer"; -import { useSignOut } from "@/hooks/firebase/useSignOut"; -import { DrawerContentScrollView } from "@react-navigation/drawer"; -import { - Button, - ButtonSize, - Text, - TouchableOpacity, - View, -} from "react-native-ui-lib"; -import { ImageBackground, StyleSheet } from "react-native"; +import React, {useMemo} from "react"; +import {Drawer} from "expo-router/drawer"; +import {useSignOut} from "@/hooks/firebase/useSignOut"; +import {DrawerContentScrollView, DrawerNavigationOptions, DrawerNavigationProp} from "@react-navigation/drawer"; +import {Button, ButtonSize, Text, TouchableOpacity, View,} from "react-native-ui-lib"; +import {ImageBackground, StyleSheet} from "react-native"; import DrawerButton from "@/components/shared/DrawerButton"; import NavGroceryIcon from "@/assets/svgs/NavGroceryIcon"; import NavToDosIcon from "@/assets/svgs/NavToDosIcon"; @@ -17,127 +11,169 @@ import NavBrainDumpIcon from "@/assets/svgs/NavBrainDumpIcon"; import NavCalendarIcon from "@/assets/svgs/NavCalendarIcon"; import NavSettingsIcon from "@/assets/svgs/NavSettingsIcon"; import ViewSwitch from "@/components/pages/(tablet_pages)/ViewSwitch"; -import { useSetAtom } from "jotai"; +import {useSetAtom} from "jotai"; import { - isFamilyViewAtom, - settingsPageIndex, - toDosPageIndex, - userSettingsView, + isFamilyViewAtom, + settingsPageIndex, + toDosPageIndex, + userSettingsView, } from "@/components/pages/calendar/atoms"; import Ionicons from "@expo/vector-icons/Ionicons"; import * as Device from "expo-device"; -import { DeviceType } from "expo-device"; +import {DeviceType} from "expo-device"; import FeedbackNavIcon from "@/assets/svgs/FeedbackNavIcon"; import DrawerIcon from "@/assets/svgs/DrawerIcon"; +import {RouteProp} from "@react-navigation/core"; +type DrawerParamList = { + index: undefined; + calendar: undefined; + todos: undefined; +}; + +type NavigationProp = DrawerNavigationProp; + +interface ViewSwitchProps { + navigation: NavigationProp; +} + +interface HeaderRightProps { + routeName: keyof DrawerParamList; + navigation: NavigationProp; +} + +const MemoizedViewSwitch = React.memo(({navigation}) => ( + + + +)); + +const HeaderRight = React.memo(({routeName, navigation}) => { + const showViewSwitch = ["calendar", "todos", "index"].includes(routeName); + + if (Device.deviceType !== DeviceType.TABLET || !showViewSwitch) { + return null; + } + + return ; +}); export default function TabLayout() { - const { mutateAsync: signOut } = useSignOut(); - const setIsFamilyView = useSetAtom(isFamilyViewAtom); - const setPageIndex = useSetAtom(settingsPageIndex); - const setUserView = useSetAtom(userSettingsView); - const setToDosIndex = useSetAtom(toDosPageIndex); + const {mutateAsync: signOut} = useSignOut(); + const setIsFamilyView = useSetAtom(isFamilyViewAtom); + const setPageIndex = useSetAtom(settingsPageIndex); + const setUserView = useSetAtom(userSettingsView); + const setToDosIndex = useSetAtom(toDosPageIndex); - return ( - ({ - headerShown: true, - headerTitleAlign: - Device.deviceType === DeviceType.TABLET ? "left" : "center", - headerTitleStyle: { - fontFamily: "Manrope_600SemiBold", - fontSize: Device.deviceType === DeviceType.TABLET ? 22 : 17, - }, - headerLeft: (props) => ( - - - - ), - headerRight: () => { - // Only show ViewSwitch on calendar and todos pages - const showViewSwitch = ["calendar", "todos", "index"].includes( - route.name - ); - return Device.deviceType === DeviceType.TABLET && showViewSwitch ? ( - - - - ) : null; - }, - drawerStyle: { - width: Device.deviceType === DeviceType.TABLET ? "30%" : "90%", - backgroundColor: "#f9f8f7", - height: "100%", - }, - })} - drawerContent={(props) => { - return ( - - - - Welcome to Cally - - - - { - props.navigation.navigate("calendar"); - setPageIndex(0); - setToDosIndex(0); - setUserView(true); - setIsFamilyView(false); - }} - icon={} - /> - { - props.navigation.navigate("grocery"); - setPageIndex(0); - setToDosIndex(0); - setUserView(true); - setIsFamilyView(false); - }} - icon={} - /> - { - props.navigation.navigate("feedback"); - setPageIndex(0); - setToDosIndex(0); - setUserView(true); - setIsFamilyView(false); - }} - icon={} - /> - - - {/* + ({ + navigation, + route, + }: { + navigation: DrawerNavigationProp; + route: RouteProp; + }): DrawerNavigationOptions => ({ + headerShown: true, + headerTitleAlign: Device.deviceType === DeviceType.TABLET ? "left" : "center", + headerTitleStyle: { + fontFamily: "Manrope_600SemiBold", + fontSize: Device.deviceType === DeviceType.TABLET ? 22 : 17, + }, + headerLeft: () => ( + + + + ), + headerRight: () => { + const showViewSwitch = ["calendar", "todos", "index"].includes(route.name); + + if (Device.deviceType !== DeviceType.TABLET || !showViewSwitch) { + return null; + } + + return ; + }, + drawerStyle: { + width: Device.deviceType === DeviceType.TABLET ? "30%" : "90%", + backgroundColor: "#f9f8f7", + height: "100%", + }, + }), + [] + ); + + return ( + { + return ( + + + + Welcome to Cally + + + + { + props.navigation.navigate("calendar"); + setPageIndex(0); + setToDosIndex(0); + setUserView(true); + setIsFamilyView(false); + }} + icon={} + /> + { + props.navigation.navigate("grocery"); + setPageIndex(0); + setToDosIndex(0); + setUserView(true); + setIsFamilyView(false); + }} + icon={} + /> + { + props.navigation.navigate("feedback"); + setPageIndex(0); + setToDosIndex(0); + setUserView(true); + setIsFamilyView(false); + }} + icon={} + /> + + + {/* } />*/} - { - props.navigation.navigate("todos"); - setPageIndex(0); - setToDosIndex(0); - setUserView(true); - setIsFamilyView(false); - }} - icon={} - /> - { - props.navigation.navigate("brain_dump"); - setPageIndex(0); - setToDosIndex(0); - setUserView(true); - setIsFamilyView(false); - }} - icon={} - /> - { - props.navigation.navigate("notifications"); - setPageIndex(0); - setToDosIndex(0); - setUserView(true); - setIsFamilyView(false); - }} - icon={ - - } - /> - - - - - {isVisible && ( - - )} - - ); + + + + {isVisible && ( + + )} + + ); }; export default AddChore; const styles = StyleSheet.create({ - gradient: { - height: 150, - position: "absolute", - bottom: 0, - width: "100%", - justifyContent: "center", - alignItems: "center", - }, - buttonContainer: { - width: "100%", - alignItems: "center", - }, - button: { - backgroundColor: "rgb(253, 23, 117)", - height: 53.26, - borderRadius: 30, - width: 335, - }, + gradient: { + height: 150, + position: "absolute", + bottom: 0, + width: "100%", + justifyContent: "center", + alignItems: "center", + }, + buttonContainer: { + width: "100%", + alignItems: "center", + }, + button: { + backgroundColor: "rgb(253, 23, 117)", + height: 53.26, + borderRadius: 30, + width: 335, + }, }); diff --git a/components/pages/todos/ProgressCard.tsx b/components/pages/todos/ProgressCard.tsx index c82d1aa..d73d8c9 100644 --- a/components/pages/todos/ProgressCard.tsx +++ b/components/pages/todos/ProgressCard.tsx @@ -1,44 +1,43 @@ -import { View, Text, Button } from "react-native-ui-lib"; +import {Text, View} from "react-native-ui-lib"; import React from "react"; -import { Fontisto } from "@expo/vector-icons"; -import { ProgressBar } from "react-native-ui-lib/src/components/progressBar"; -import { useToDosContext } from "@/contexts/ToDosContext"; +import {ProgressBar} from "react-native-ui-lib/src/components/progressBar"; +import {useToDosContext} from "@/contexts/ToDosContext"; import FireworksOrangeIcon from "@/assets/svgs/FireworksOrangeIcon"; -const ProgressCard = ({children}: {children?: React.ReactNode}) => { - const { maxPoints } = useToDosContext(); - return ( - - - - - You have earned XX points this week!{" "} - - - - - 0 - {maxPoints} - - - {children} - - - ); +const ProgressCard = ({children}: { children?: React.ReactNode }) => { + const {maxPoints} = useToDosContext(); + return ( + + + + + You have earned XX points this week!{" "} + + + + + 0 + {maxPoints} + + + {children} + + + ); }; export default ProgressCard; diff --git a/components/pages/todos/family-chores/FamilyChart.tsx b/components/pages/todos/family-chores/FamilyChart.tsx index 7737adc..87add82 100644 --- a/components/pages/todos/family-chores/FamilyChart.tsx +++ b/components/pages/todos/family-chores/FamilyChart.tsx @@ -1,5 +1,4 @@ import React from "react"; -import { View } from "react-native"; import { BarChart } from "react-native-gifted-charts"; const FamilyChart = () => { diff --git a/components/pages/todos/user-chores/UserChart.tsx b/components/pages/todos/user-chores/UserChart.tsx index 5ef602b..eeed824 100644 --- a/components/pages/todos/user-chores/UserChart.tsx +++ b/components/pages/todos/user-chores/UserChart.tsx @@ -1,5 +1,4 @@ import React from "react"; -import { View } from "react-native"; import { BarChart } from "react-native-gifted-charts"; const UserChart = () => { diff --git a/components/pages/todos/user-chores/UserChoresProgress.tsx b/components/pages/todos/user-chores/UserChoresProgress.tsx index f4cec19..8cc04f3 100644 --- a/components/pages/todos/user-chores/UserChoresProgress.tsx +++ b/components/pages/todos/user-chores/UserChoresProgress.tsx @@ -1,191 +1,181 @@ -import { - View, - Text, - ProgressBar, - Button, - ButtonSize, - Modal, - Dialog, - TouchableOpacity, -} from "react-native-ui-lib"; -import React, { useState } from "react"; -import { StyleSheet } from "react-native"; +import {Button, ButtonSize, Dialog, ProgressBar, Text, TouchableOpacity, View,} from "react-native-ui-lib"; +import React, {useState} from "react"; +import {StyleSheet} from "react-native"; import UserChart from "./UserChart"; import ProgressCard from "../ProgressCard"; -import { AntDesign, Feather, Ionicons } from "@expo/vector-icons"; -import { ScrollView } from "react-native-gesture-handler"; -import { PanViewDirectionsEnum } from "react-native-ui-lib/src/incubator/panView"; +import {AntDesign, Ionicons} from "@expo/vector-icons"; +import {ScrollView} from "react-native-gesture-handler"; import FireworksOrangeIcon from "@/assets/svgs/FireworksOrangeIcon"; const UserChoresProgress = ({ - setPageIndex, -}: { - setPageIndex: (value: number) => void; + setPageIndex, + }: { + setPageIndex: (value: number) => void; }) => { - const [modalVisible, setModalVisible] = useState(false); - return ( - - - setPageIndex(0)}> - - - - Return to To Do's - - - - - - Your To Do's Progress Report - - - - - Daily Goal - - - - - - Points Earned This Week - - - - - - - - Total Reward Points - -