diff options
author | Ivan Chen <ivan@tagg.id> | 2021-03-25 15:56:03 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-03-25 15:56:03 -0400 |
commit | 40ae1e53f7e2f5a916a41b785980e24e7a5b4c59 (patch) | |
tree | 9ba7e21bb9c5469477412614fdfdf8555d0dd4c7 /src/screens/onboarding/OnboardingStepThree.tsx | |
parent | 76a6ab8c12669865c99e961d93b97613c63da3a5 (diff) |
added UI for university selection
Diffstat (limited to 'src/screens/onboarding/OnboardingStepThree.tsx')
-rw-r--r-- | src/screens/onboarding/OnboardingStepThree.tsx | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/screens/onboarding/OnboardingStepThree.tsx b/src/screens/onboarding/OnboardingStepThree.tsx index 6d379b5e..dffdf2fe 100644 --- a/src/screens/onboarding/OnboardingStepThree.tsx +++ b/src/screens/onboarding/OnboardingStepThree.tsx @@ -1,4 +1,3 @@ -import AsyncStorage from '@react-native-community/async-storage'; import {RouteProp} from '@react-navigation/native'; import {StackNavigationProp} from '@react-navigation/stack'; import moment from 'moment'; @@ -20,20 +19,13 @@ import { RegistrationWizard, TaggDropDown, TaggInput, + UniversitySelection, } from '../../components'; +import {CLASS_YEAR_LIST, genderRegex, TAGG_PURPLE} from '../../constants'; import { - CLASS_YEAR_LIST, - EDIT_PROFILE_ENDPOINT, - genderRegex, - TAGG_PURPLE, -} from '../../constants'; -import { - ERROR_DOUBLE_CHECK_CONNECTION, - ERROR_PROFILE_CREATION_SHORT, ERROR_SELECT_BIRTHDAY, ERROR_SELECT_CLASS_YEAR, ERROR_SELECT_GENDER, - ERROR_SOMETHING_WENT_WRONG_REFRESH, ERROR_UPLOAD_SMALL_PROFILE_PIC, } from '../../constants/strings'; import {OnboardingStackParams} from '../../routes/onboarding'; @@ -62,6 +54,7 @@ const OnboardingStepThree: React.FC<OnboardingStepThreeProps> = ({ let emptyDate: string | undefined; const [form, setForm] = React.useState({ smallPic: '', + university: '', birthdate: emptyDate, gender: '', isValidGender: true, @@ -210,6 +203,10 @@ const OnboardingStepThree: React.FC<OnboardingStepThreeProps> = ({ request.append('university_class', form.classYear); } + if (form.university !== '') { + request.append('university', form.university); + } + if (invalidFields) { return; } @@ -242,6 +239,12 @@ const OnboardingStepThree: React.FC<OnboardingStepThreeProps> = ({ /> </View> <View style={styles.contentContainer}> + <UniversitySelection selected={form.university} setSelected={(selected) => { + setForm({ + ...form, + university: selected + }) + }}/> <TaggDropDown onValueChange={(value: string) => handleClassYearUpdate(value)} items={classYearList} |