aboutsummaryrefslogtreecommitdiff
path: root/src/screens/onboarding/OnboardingStepThree.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/screens/onboarding/OnboardingStepThree.tsx')
-rw-r--r--src/screens/onboarding/OnboardingStepThree.tsx23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/screens/onboarding/OnboardingStepThree.tsx b/src/screens/onboarding/OnboardingStepThree.tsx
index 120380c1..81f4dc97 100644
--- a/src/screens/onboarding/OnboardingStepThree.tsx
+++ b/src/screens/onboarding/OnboardingStepThree.tsx
@@ -26,11 +26,12 @@ import {
ERROR_SELECT_BIRTHDAY,
ERROR_SELECT_CLASS_YEAR,
ERROR_SELECT_GENDER,
+ ERROR_SELECT_UNIVERSITY,
ERROR_UPLOAD_SMALL_PROFILE_PIC,
} from '../../constants/strings';
import {OnboardingStackParams} from '../../routes/onboarding';
import {patchEditProfile} from '../../services';
-import {BackgroundGradientType} from '../../types';
+import {BackgroundGradientType, UniversityType} from '../../types';
import {normalize, SCREEN_HEIGHT, SCREEN_WIDTH} from '../../utils';
type OnboardingStepThreeRouteProp = RouteProp<
@@ -52,9 +53,10 @@ const OnboardingStepThree: React.FC<OnboardingStepThreeProps> = ({
}) => {
const {userId, username} = route.params;
let emptyDate: string | undefined;
+ let emptyUniversity: UniversityType | undefined;
const [form, setForm] = React.useState({
smallPic: '',
- university: '',
+ university: emptyUniversity,
birthdate: emptyDate,
gender: '',
isValidGender: true,
@@ -158,7 +160,7 @@ const OnboardingStepThree: React.FC<OnboardingStepThreeProps> = ({
Alert.alert(ERROR_SELECT_CLASS_YEAR);
return;
}
- if (form.university === '') {
+ if (!form.university) {
Alert.alert(ERROR_SELECT_UNIVERSITY);
return;
}
@@ -243,12 +245,15 @@ const OnboardingStepThree: React.FC<OnboardingStepThreeProps> = ({
/>
</View>
<View style={styles.contentContainer}>
- <UniversitySelection selected={form.university} setSelected={(selected) => {
- setForm({
- ...form,
- university: selected
- })
- }}/>
+ <UniversitySelection
+ selected={form.university}
+ setSelected={(selected) => {
+ setForm({
+ ...form,
+ university: selected,
+ });
+ }}
+ />
<TaggDropDown
onValueChange={(value: string) => handleClassYearUpdate(value)}
items={classYearList}