mirror of
https://github.com/urosran/cally.git
synced 2025-11-27 00:44:54 +00:00
delete family popups and birthday
This commit is contained in:
@ -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>
|
||||
|
||||
Reference in New Issue
Block a user