diff options
author | Ivan Chen <ivan@tagg.id> | 2021-01-11 16:11:11 -0500 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-01-15 14:19:50 -0500 |
commit | 080e76350c2570eeb096fad40fe95f1b766b4539 (patch) | |
tree | bcb9f73f2c192f8c34f2064a5c3fd003756c2823 /src/screens/onboarding/ProfileOnboarding.tsx | |
parent | 1dccfb1d3e9470d81de8d1ec0a0dbb3803372f7d (diff) |
created strings.ts and linting
Diffstat (limited to 'src/screens/onboarding/ProfileOnboarding.tsx')
-rw-r--r-- | src/screens/onboarding/ProfileOnboarding.tsx | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/screens/onboarding/ProfileOnboarding.tsx b/src/screens/onboarding/ProfileOnboarding.tsx index 1f8e58da..d0a63a23 100644 --- a/src/screens/onboarding/ProfileOnboarding.tsx +++ b/src/screens/onboarding/ProfileOnboarding.tsx @@ -32,6 +32,14 @@ import {BackgroundGradientType} from '../../types'; import {PickerSelectProps} from 'react-native-picker-select'; import Animated from 'react-native-reanimated'; import {SCREEN_WIDTH} from '../../utils'; +import { + ERROR_DOUBLE_CHECK_CONNECTION, + ERROR_PROFILE_CREATION, + ERROR_SELECT_CLASS_YEAR, + ERROR_SOMETHING_WENT_WRONG_REFRESH, + ERROR_UPLOAD_LARGE_PROFILE_PIC, + ERROR_UPLOAD_SMALL_PROFILE_PIC, +} from '../../constants/strings'; type ProfileOnboardingScreenRouteProp = RouteProp< OnboardingStackParams, @@ -260,15 +268,15 @@ const ProfileOnboarding: React.FC<ProfileOnboardingProps> = ({ const handleSubmit = async () => { if (!form.largePic) { - Alert.alert('Please select a Header image!'); + Alert.alert(ERROR_UPLOAD_LARGE_PROFILE_PIC); return; } if (!form.smallPic) { - Alert.alert('Please select a Profile Picture!'); + Alert.alert(ERROR_UPLOAD_SMALL_PROFILE_PIC); return; } if (form.classYear === -1) { - Alert.alert('Please select Class Year'); + Alert.alert(ERROR_SELECT_CLASS_YEAR); return; } if (!form.attemptedSubmit) { @@ -363,16 +371,10 @@ const ProfileOnboarding: React.FC<ProfileOnboardingProps> = ({ data.error || 'Something went wrong! ðŸ˜', ); } else { - Alert.alert( - 'Something went wrong! ðŸ˜', - "Would you believe me if I told you that I don't know what happened?", - ); + Alert.alert(ERROR_SOMETHING_WENT_WRONG_REFRESH); } } catch (error) { - Alert.alert( - 'Profile creation failed 😓', - 'Please double-check your network connection and retry.', - ); + Alert.alert(ERROR_PROFILE_CREATION, ERROR_DOUBLE_CHECK_CONNECTION); return { name: 'Profile creation error', description: error, |