delete family popups and birthday

This commit is contained in:
ivic00
2025-02-06 22:47:18 +01:00
parent e96210986e
commit 6ada9470c3
8 changed files with 165 additions and 41 deletions

View File

@ -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<Date>(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 = () => {
<KeyboardAvoidingView style={{ width: "100%" }}>
<TextField
marginT-30
marginT-17
autoFocus
placeholder="First name"
value={firstName}
@ -160,6 +176,16 @@ const SignUpPage = () => {
}}
/>
<DateTimePicker
placeholder="Birthday"
value={birthday}
mode="date"
minimumDate={getMinDate()}
maximumDate={getMaxDate()}
onChange={(value) => setBirthday(value)}
style={styles.textfield}
/>
<View
centerV
style={[styles.textfield, { padding: 0, paddingHorizontal: 30 }]}
@ -241,7 +267,7 @@ const SignUpPage = () => {
{isTablet ? (
<View height={50} />
) : (
<View flexG style={{ minHeight: 50 }} />
<View flexG style={{ minHeight: 65 }} />
)}
<View>