diff --git a/app/(unauth)/birthday_page.tsx b/app/(unauth)/birthday_page.tsx
new file mode 100644
index 0000000..3800bc1
--- /dev/null
+++ b/app/(unauth)/birthday_page.tsx
@@ -0,0 +1,117 @@
+import { SafeAreaView } from "react-native-safe-area-context";
+import { Button, Text, View, DateTimePicker } from "react-native-ui-lib";
+import React, { useState } from "react";
+import { useRouter } from "expo-router";
+import { Platform, StyleSheet } from "react-native";
+import { useAuthContext } from "@/contexts/AuthContext";
+import firestore from "@react-native-firebase/firestore";
+import { useUpdateUserData } from "@/hooks/firebase/useUpdateUserData";
+
+export default function BirthdayScreen() {
+ const router = useRouter();
+ const { user } = useAuthContext();
+ const [date, setDate] = useState(new Date());
+ const { mutateAsync: updateUserData } = useUpdateUserData();
+
+ const onDateChange = (event: any, selectedDate?: Date) => {
+ const currentDate = selectedDate || date;
+ setDate(currentDate);
+ };
+
+ const handleContinue = async () => {
+ try {
+ updateUserData({
+ newUserData: {
+ birthday: date,
+ },
+ }).then(() => router.push("/(unauth)/cal_sync"));
+ } catch (error) {
+ console.error("Error saving birthday:", error);
+ }
+ };
+
+ const getMaxDate = () => {
+ const date = new Date();
+ date.setFullYear(date.getFullYear() - 3); // Minimum age: 3 years
+ return date;
+ };
+
+ const getMinDate = () => {
+ const date = new Date();
+ date.setFullYear(date.getFullYear() - 18); // Maximum age: 18 years
+ return date;
+ };
+
+ return (
+
+
+
+
+ When's your birthday?
+
+
+ We'll use this to celebrate your special day!
+
+
+
+
+ {
+ if (date) {
+ const validDate = new Date(date);
+ if (!isNaN(validDate.getTime())) {
+ setDate(validDate);
+ }
+ }
+ }}
+ style={styles.textfield}
+ textAlign="center"
+ />
+
+
+
+
+
+
+
+
+
+ );
+}
+
+const styles = StyleSheet.create({
+ textfield: {
+ backgroundColor: "white",
+ marginVertical: 100,
+ padding: 30,
+ height: 44,
+ borderRadius: 50,
+ fontFamily: "PlusJakartaSans_300Light",
+ fontSize: 15,
+ color: "#919191",
+ alignContent: "center",
+ },
+});
diff --git a/app/(unauth)/get_started.tsx b/app/(unauth)/get_started.tsx
index 1649995..522fd94 100644
--- a/app/(unauth)/get_started.tsx
+++ b/app/(unauth)/get_started.tsx
@@ -49,7 +49,7 @@ export default function Screen() {
const debouncedRouterReplace = useCallback(
debounce(() => {
- router.push("/(unauth)/cal_sync");
+ router.push("/(unauth)/birthday_page");
}, 300),
[]
);
diff --git a/components/pages/calendar/DetailedCalendar.tsx b/components/pages/calendar/DetailedCalendar.tsx
index 0f70837..d54f0ff 100644
--- a/components/pages/calendar/DetailedCalendar.tsx
+++ b/components/pages/calendar/DetailedCalendar.tsx
@@ -80,11 +80,11 @@ export const DetailedCalendar: React.FC = React.memo(({
const renderEvent = useCallback((event: any) => {
const attendees = getAttendees(event);
return (
-
+
);
}, [getAttendees, handlePressEvent]);
diff --git a/components/pages/main/SignUpPage.tsx b/components/pages/main/SignUpPage.tsx
index f23dc16..950e5ba 100644
--- a/components/pages/main/SignUpPage.tsx
+++ b/components/pages/main/SignUpPage.tsx
@@ -4,6 +4,7 @@ import {
ButtonSize,
Checkbox,
Colors,
+ DateTimePicker,
KeyboardAwareScrollView,
LoaderScreen,
Text,
@@ -66,10 +67,25 @@ const SignUpPage = () => {
return "20%"; // non-tablet case, regardless of orientation
};
+ const getMaxDate = () => {
+ const date = new Date();
+ date.setFullYear(date.getFullYear() - 3); // Minimum age: 3 years
+ return date;
+ };
+
+ const getMinDate = () => {
+ const date = new Date();
+ date.setFullYear(date.getFullYear() - 18); // Maximum age: 18 years
+ return date;
+ };
+
+
+ const [birthday, setBirthday] = useState(getMinDate());
+
const router = useRouter();
const handleSignUp = async () => {
- await signUp({ email, password, firstName, lastName });
+ await signUp({ email, password, firstName, lastName, birthday });
if (profileData?.userType === ProfileType.FAMILY_DEVICE) {
router.replace("/(auth)/calendar");
@@ -110,7 +126,7 @@ const SignUpPage = () => {
{
}}
/>
+ setBirthday(value)}
+ style={styles.textfield}
+ />
+
{
{isTablet ? (
) : (
-
+
)}
diff --git a/components/pages/settings/user_components/DeleteProfileDialogs.tsx b/components/pages/settings/user_components/DeleteProfileDialogs.tsx
index 63f5c41..456d24f 100644
--- a/components/pages/settings/user_components/DeleteProfileDialogs.tsx
+++ b/components/pages/settings/user_components/DeleteProfileDialogs.tsx
@@ -1,5 +1,5 @@
-import React, { useState } from "react";
-import { Dialog, Button, Text, View } from "react-native-ui-lib";
+import React, { useEffect, useState } from "react";
+import { Dialog, Button, Text, View, TextField } from "react-native-ui-lib";
import { StyleSheet } from "react-native";
import { Feather } from "@expo/vector-icons";
@@ -8,6 +8,8 @@ interface ConfirmationDialogProps {
onDismiss: () => void;
onFirstYes: () => void;
onConfirm: () => void;
+ isDeleteFamily?: boolean;
+ householdName: string;
}
const DeleteProfileDialogs: React.FC = ({
@@ -15,8 +17,21 @@ const DeleteProfileDialogs: React.FC = ({
onDismiss,
onFirstYes,
onConfirm,
+ isDeleteFamily,
+ householdName,
}) => {
const [confirmationDialog, setConfirmationDialog] = useState(false);
+ const [input, setInput] = useState("");
+ const [isCorrect, setIsCorrect] = useState(true);
+
+ useEffect(() => {
+ setInput("");
+ }, [onDismiss, onConfirm])
+
+ useEffect(() => {
+ setIsCorrect(input === householdName);
+ }, [input])
+
return (
<>
@@ -31,18 +46,33 @@ const DeleteProfileDialogs: React.FC = ({
Are you sure?
-
- This action will permanently delete all your data, you won't be able
- to recover it!
-
+ {isDeleteFamily ? (
+
+ This action will permanently delete all your family profiles and
+ data, you won't be able to recover it!
+
+ ) : (
+
+ This action will permanently delete all your data, you won't be able
+ to recover it!
+
+ )}