diff --git a/app/(auth)/calendar/index.tsx b/app/(auth)/calendar/index.tsx index c13e298..a552a63 100644 --- a/app/(auth)/calendar/index.tsx +++ b/app/(auth)/calendar/index.tsx @@ -5,6 +5,7 @@ import {Button, Picker, PickerModes, SegmentedControl, Text, View} from "react-n import {MaterialIcons} from "@expo/vector-icons"; import {AddEventDialog} from "@/components/pages/calendar/AddEventDialog"; import {useGetEvents} from "@/hooks/firebase/useGetEvents"; +import { useAuthContext } from "@/contexts/AuthContext"; const modeMap = new Map([ [0, "day"], @@ -18,6 +19,7 @@ const months = [ ]; export default function Screen() { + const { profileData } = useAuthContext(); const [calendarHeight, setCalendarHeight] = useState(0); const [mode, setMode] = useState<"week" | "month" | "day">("week"); const [selectedDate, setSelectedDate] = useState(new Date()); @@ -52,7 +54,7 @@ export default function Screen() { return ( - Welcome Dalia + Welcome {profileData?.firstName} Let's get your week started! diff --git a/app/(auth)/todos/index.tsx b/app/(auth)/todos/index.tsx index af1215d..7ccb813 100644 --- a/app/(auth)/todos/index.tsx +++ b/app/(auth)/todos/index.tsx @@ -2,24 +2,18 @@ import AddChore from "@/components/pages/todos/AddChore"; import ProgressCard from "@/components/pages/todos/ProgressCard"; import ToDoItem from "@/components/pages/todos/ToDoItem"; import ToDosList from "@/components/pages/todos/ToDosList"; +import ToDosPage from "@/components/pages/todos/ToDosPage"; import HeaderTemplate from "@/components/shared/HeaderTemplate"; import { useAuthContext } from "@/contexts/AuthContext"; import { ToDosContextProvider, useToDosContext } from "@/contexts/ToDosContext"; import { AntDesign } from "@expo/vector-icons"; import { ScrollView } from "react-native-gesture-handler"; -import { Button, ButtonSize, View } from "react-native-ui-lib"; +import { Button, ButtonSize, View, Text } from "react-native-ui-lib"; export default function Screen() { return ( - - - - - - - - + ); } diff --git a/components/pages/grocery/GroceryList.tsx b/components/pages/grocery/GroceryList.tsx index 25106e7..6f1cd24 100644 --- a/components/pages/grocery/GroceryList.tsx +++ b/components/pages/grocery/GroceryList.tsx @@ -12,6 +12,7 @@ import HeaderTemplate from "@/components/shared/HeaderTemplate"; import CategoryDropdown from "./CategoryDropdown"; import { MaterialIcons } from "@expo/vector-icons"; import EditGroceryItem from "./EditGroceryItem"; +import { ProfileType, useAuthContext } from "@/contexts/AuthContext"; const GroceryList = () => { const { @@ -21,6 +22,7 @@ const GroceryList = () => { setIsAddingGrocery, addGrocery, } = useGroceryContext(); + const { profileData } = useAuthContext(); const [approvedGroceries, setapprovedGroceries] = useState( groceries.filter((item) => item.approved === true) ); @@ -47,18 +49,18 @@ const GroceryList = () => { ); useEffect(() => { - if(submit){ + if (submit) { if (title?.length > 2 && title?.length <= 25) { addGrocery({ id: 0, title: title, category: category, - approved: false, + approved: profileData?.userType === ProfileType.PARENT ? true : false, recurring: false, frequency: GroceryFrequency.Never, bought: false, }); - + setIsAddingGrocery(false); setSubmitted(false); setTitle(""); @@ -172,7 +174,7 @@ const GroceryList = () => { setCategory: setCategory, category: category, setTitle: setTitle, - setSubmit: setSubmitted + setSubmit: setSubmitted, }} /> )} diff --git a/components/pages/main/SignUpPage.tsx b/components/pages/main/SignUpPage.tsx index d15459c..92e38da 100644 --- a/components/pages/main/SignUpPage.tsx +++ b/components/pages/main/SignUpPage.tsx @@ -1,145 +1,150 @@ -import React, {useState} from "react"; -import {Button, ButtonSize, Text, TextField, View,} from "react-native-ui-lib"; -import {useSignUp} from "@/hooks/firebase/useSignUp"; -import {ProfileType} from "@/contexts/AuthContext"; -import {StyleSheet} from "react-native"; -import {AntDesign} from "@expo/vector-icons"; +import React, { useState } from "react"; +import { + Button, + ButtonSize, + Checkbox, + Text, + TextField, + TouchableOpacity, + View, +} from "react-native-ui-lib"; +import { useSignUp } from "@/hooks/firebase/useSignUp"; +import { ProfileType } from "@/contexts/AuthContext"; +import { StyleSheet } from "react-native"; +import { AntDesign } from "@expo/vector-icons"; const SignUpPage = (props: { unsetRegister: () => any }) => { - const [email, setEmail] = useState(""); - const [firstName, setFirstName] = useState(""); - const [lastName, setLastName] = useState(""); - const [password, setPassword] = useState(""); - const [isParent, setIsParent] = useState(true); - const [isChild, setIsChild] = useState(false); - const [isCaregiver, setIsCaregiver] = useState(false); - const [profileType, setProfileType] = useState( - ProfileType.PARENT - ); - const {mutateAsync: signUp} = useSignUp(); + const [email, setEmail] = useState(""); + const [firstName, setFirstName] = useState(""); + const [lastName, setLastName] = useState(""); + const [password, setPassword] = useState(""); - const handleSignUp = async () => { - await signUp({email, password, firstName, lastName}); - }; + const [isPasswordVisible, setIsPasswordVisible] = useState(false); + const [allowFaceID, setAllowFaceID] = useState(false); + const [acceptTerms, setAcceptTerms] = useState(false); + const { mutateAsync: signUp } = useSignUp(); - return ( - - - Get started with Kali - - Please enter your details. - - - - - + {children} ); diff --git a/components/pages/todos/ToDoItem.tsx b/components/pages/todos/ToDoItem.tsx index 9207cc0..1d0e926 100644 --- a/components/pages/todos/ToDoItem.tsx +++ b/components/pages/todos/ToDoItem.tsx @@ -10,7 +10,6 @@ const ToDoItem = (props: { item: IToDo }) => { centerV paddingV-10 paddingH-10 - marginH-25 marginV-10 style={{ borderRadius: 22, diff --git a/components/pages/todos/ToDosPage.tsx b/components/pages/todos/ToDosPage.tsx new file mode 100644 index 0000000..e3cc100 --- /dev/null +++ b/components/pages/todos/ToDosPage.tsx @@ -0,0 +1,76 @@ +import { View, Text, Button, ButtonSize } from "react-native-ui-lib"; +import React, { useState } from "react"; +import HeaderTemplate from "@/components/shared/HeaderTemplate"; +import AddChore from "./AddChore"; +import ProgressCard from "./ProgressCard"; +import ToDosList from "./ToDosList"; +import { ScrollView } from "react-native"; +import { StyleSheet } from "react-native"; +import { TouchableOpacity } from "react-native-gesture-handler"; +import { ProfileType, useAuthContext } from "@/contexts/AuthContext"; +import FamilyChoresProgress from "./family-chores/FamilyChoresProgress"; +import UserChoresProgress from "./user-chores/UserChoresProgress"; + +const ToDosPage = () => { + const [pageIndex, setPageIndex] = useState(0); + const { profileData } = useAuthContext(); + const pageLink = ( + setPageIndex(1)}> + View family progress + + ); + return ( + + {pageIndex == 0 && ( + + + + + {profileData?.userType == ProfileType.CHILD && ( + + setPageIndex(2)} + > + + View your full progress report here + + + } + /> + + )} + + + + {profileData?.userType == ProfileType.PARENT && } + + )} + {pageIndex == 1 && } + {pageIndex == 2 && } + + ); +}; + +const styles = StyleSheet.create({ + linkBtn: { + backgroundColor: "transparent", + padding: 0, + }, +}); + +export default ToDosPage; diff --git a/components/pages/todos/family-chores/FamilyChart.tsx b/components/pages/todos/family-chores/FamilyChart.tsx new file mode 100644 index 0000000..7737adc --- /dev/null +++ b/components/pages/todos/family-chores/FamilyChart.tsx @@ -0,0 +1,87 @@ +import React from "react"; +import { View } from "react-native"; +import { BarChart } from "react-native-gifted-charts"; + +const FamilyChart = () => { + // Define the data for the bars + const data = [ + { + value: 600, // Total value of the bar + stacks: [ + { value: 290, color: "#e7d526" }, // First part of the bar + { value: 310, color: "#00a8b6" }, // Second part of the bar + ], + label: "M", + }, + { + value: 400, + stacks: [ + { value: 190, color: "#e7d526" }, + { value: 210, color: "#00a8b6" }, + ], + label: "Tu", + }, + { + value: 400, + stacks: [ + { value: 210, color: "#e7d526" }, + { value: 190, color: "#00a8b6" }, + ], + label: "W", + }, + { + value: 800, + stacks: [ + { value: 410, color: "#e7d526" }, + { value: 390, color: "#00a8b6" }, + ], + label: "Th", + }, + { + value: 600, + stacks: [ + { value: 220, color: "#e7d526" }, + { value: 380, color: "#00a8b6" }, + ], + label: "F", + }, + { + value: 200, + stacks: [ + { value: 160, color: "#e7d526" }, + { value: 40, color: "#00a8b6" }, + ], + label: "Sa", + }, + { + value: 200, + stacks: [ + { value: 160, color: "#e7d526" }, + { value: 40, color: "#00a8b6" }, + ], + label: "Su", + }, + ]; + + return ( + + ); +}; + +export default FamilyChart; diff --git a/components/pages/todos/family-chores/FamilyChoresProgress.tsx b/components/pages/todos/family-chores/FamilyChoresProgress.tsx new file mode 100644 index 0000000..dedbcc5 --- /dev/null +++ b/components/pages/todos/family-chores/FamilyChoresProgress.tsx @@ -0,0 +1,67 @@ +import { View, Text } from "react-native-ui-lib"; +import React from "react"; +import { StyleSheet } from "react-native"; +import FamilyChart from "./FamilyChart"; +import { TouchableOpacity } from "react-native-ui-lib/src/incubator"; + +const FamilyChoresProgress = ({ + setPageIndex, +}: { + setPageIndex: (value: number) => void; +}) => { + return ( + + setPageIndex(0)}> + Back to ToDos + + + Family Chores Progress Report + + + Points earned this week + + + + + + + + + + Chore Tracker + + + + + x/y chores completed + + + + + + x/y chores completed + + + + ); +}; +const styles = StyleSheet.create({ + pfpSmall: { + width: 30, + aspectRatio: 1, + borderRadius: 50, + marginHorizontal: 2, + }, + pfpBig: { + width: 50, + aspectRatio: 1, + borderRadius: 50, + }, + card: { + backgroundColor: "white", + borderRadius: 20, + padding: 20, + }, +}); + +export default FamilyChoresProgress; diff --git a/components/pages/todos/user-chores/UserChart.tsx b/components/pages/todos/user-chores/UserChart.tsx new file mode 100644 index 0000000..5ef602b --- /dev/null +++ b/components/pages/todos/user-chores/UserChart.tsx @@ -0,0 +1,66 @@ +import React from "react"; +import { View } from "react-native"; +import { BarChart } from "react-native-gifted-charts"; + +const UserChart = () => { + const barColor = "#05a8b6" + const data = [ + { + value: 290, // Direct value of the bar + frontColor: barColor, // Color of the bar + label: "M", + }, + { + value: 190, + frontColor: barColor, + label: "Tu", + }, + { + value: 210, + frontColor: barColor, + label: "W", + }, + { + value: 410, + frontColor: barColor, + label: "Th", + }, + { + value: 220, + frontColor: barColor, + label: "F", + }, + { + value: 160, + frontColor: barColor, + label: "Sa", + }, + { + value: 160, + frontColor: barColor, + label: "Su", + }, + ]; + + return ( + + ); +}; + +export default UserChart; diff --git a/components/pages/todos/user-chores/UserChoresProgress.tsx b/components/pages/todos/user-chores/UserChoresProgress.tsx new file mode 100644 index 0000000..1023d4f --- /dev/null +++ b/components/pages/todos/user-chores/UserChoresProgress.tsx @@ -0,0 +1,152 @@ +import { + View, + Text, + ProgressBar, + Button, + ButtonSize, + Modal, + Dialog, +} from "react-native-ui-lib"; +import React, { useState } from "react"; +import { StyleSheet } from "react-native"; +import { TouchableOpacity } from "react-native-ui-lib/src/incubator"; +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"; + +const UserChoresProgress = ({ + setPageIndex, +}: { + setPageIndex: (value: number) => void; +}) => { + const [modalVisible, setModalVisible] = useState(false); + return ( + + + setPageIndex(0)}> + Back to ToDos + + + Your To Dos Progress Report + + + Daily Goal + + + + Points Earned This Week + + + + + + Total Reward Points +