From f649828d80da3f08d273dfbb8fb8716bcb329c8e Mon Sep 17 00:00:00 2001 From: ivic00 Date: Sat, 15 Feb 2025 00:34:42 +0100 Subject: [PATCH] fixes, deleteFamily function, household signup --- app/(unauth)/household_page.tsx | 87 + app/_layout.tsx | 2 + components/pages/brain_dump/AddBrainDump.tsx | 87 +- components/pages/brain_dump/DumpList.tsx | 12 +- components/pages/feedback/AddFeedback.tsx | 32 +- components/pages/feedback/Feedback.tsx | 2 +- components/pages/feedback/FeedbackList.tsx | 32 +- components/pages/grocery/GroceryList.tsx | 77 +- components/pages/grocery/GroceryWrapper.tsx | 5 - .../user_components/DeleteProfileDialogs.tsx | 4 +- components/pages/todos/ToDoItem.tsx | 3 +- firebase/functions/index.js | 20 +- firebase/functions/yarn.lock | 2887 +++++++++++++---- hooks/firebase/useDeleteFamily.ts | 7 + 14 files changed, 2559 insertions(+), 698 deletions(-) create mode 100644 app/(unauth)/household_page.tsx diff --git a/app/(unauth)/household_page.tsx b/app/(unauth)/household_page.tsx new file mode 100644 index 0000000..dcf8c8a --- /dev/null +++ b/app/(unauth)/household_page.tsx @@ -0,0 +1,87 @@ +import { SafeAreaView } from "react-native-safe-area-context"; +import { Button, Text, View, TextField } from "react-native-ui-lib"; +import React, { useState } from "react"; +import { useRouter } from "expo-router"; +import { StyleSheet } from "react-native"; +import { useAuthContext } from "@/contexts/AuthContext"; +import { useUpdateHouseholdName } from "@/hooks/firebase/useUpdateHouseholdName"; + +export default function NewHouseholdScreen() { + const router = useRouter(); + const { user, profileData } = useAuthContext(); + const [householdName, setHouseholdName] = useState(""); + const { mutateAsync: newHousehold } = useUpdateHouseholdName(); + + const handleContinue = async () => { + try { + if(profileData?.familyId) + newHousehold({familyId: profileData?.familyId, name: householdName}).then(() => router.push("/(unauth)/cal_sync")); + } catch (error) { + console.error("Error saving household name:", error); + } + }; + + return ( + + + + + Name your household + + + Give your family group a unique name! + + + + + + + + + + +