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/profile | |
| parent | 1dccfb1d3e9470d81de8d1ec0a0dbb3803372f7d (diff) | |
created strings.ts and linting
Diffstat (limited to 'src/screens/profile')
| -rw-r--r-- | src/screens/profile/CaptionScreen.tsx | 21 | ||||
| -rw-r--r-- | src/screens/profile/EditProfile.tsx | 17 |
2 files changed, 19 insertions, 19 deletions
diff --git a/src/screens/profile/CaptionScreen.tsx b/src/screens/profile/CaptionScreen.tsx index 5537d6bf..bc85d338 100644 --- a/src/screens/profile/CaptionScreen.tsx +++ b/src/screens/profile/CaptionScreen.tsx @@ -1,30 +1,27 @@ +import {RouteProp} from '@react-navigation/native'; +import {StackNavigationProp} from '@react-navigation/stack'; import React from 'react'; import { - StyleSheet, - View, Image, - Alert, Keyboard, - TouchableWithoutFeedback, KeyboardAvoidingView, Platform, + StyleSheet, + TouchableWithoutFeedback, + View, } from 'react-native'; import {Button} from 'react-native-elements'; -import {SearchBackground, TaggBigInput} from '../../components'; -import {SCREEN_WIDTH, StatusBarHeight} from '../../utils'; -import AsyncStorage from '@react-native-community/async-storage'; -import {RouteProp} from '@react-navigation/native'; +import {useDispatch, useSelector} from 'react-redux'; import {MainStackParams} from 'src/routes'; -import {StackNavigationProp} from '@react-navigation/stack'; +import {SearchBackground, TaggBigInput} from '../../components'; import {CaptionScreenHeader} from '../../components/'; -import {MOMENTS_ENDPOINT} from '../../constants'; -import {useDispatch, useSelector} from 'react-redux'; +import {postMoment} from '../../services'; import { loadUserMoments, updateProfileCompletionStage, } from '../../store/actions'; import {RootState} from '../../store/rootReducer'; -import {postMoment} from '../../services'; +import {SCREEN_WIDTH, StatusBarHeight} from '../../utils'; /** * Upload Screen to allow users to upload posts to Tagg diff --git a/src/screens/profile/EditProfile.tsx b/src/screens/profile/EditProfile.tsx index a6849c7a..3fea14bf 100644 --- a/src/screens/profile/EditProfile.tsx +++ b/src/screens/profile/EditProfile.tsx @@ -40,6 +40,12 @@ import {RootState} from '../../store/rootReducer'; import {useDispatch, useSelector} from 'react-redux'; import {loadUserData} from '../../store/actions'; import {BackgroundGradientType} from '../../types'; +import { + ERROR_DOUBLE_CHECK_CONNECTION, + ERROR_SOMETHING_WENT_WRONG_REFRESH, + ERROR_UPLOAD_LARGE_PROFILE_PIC, + ERROR_UPLOAD_SMALL_PROFILE_PIC, +} from '../../constants/strings'; type EditProfileNavigationProp = StackNavigationProp< ProfileStackParams, @@ -250,11 +256,11 @@ const EditProfile: React.FC<EditProfileProps> = ({route, navigation}) => { const handleSubmit = useCallback(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.attemptedSubmit) { @@ -355,13 +361,10 @@ const EditProfile: React.FC<EditProfileProps> = ({route, navigation}) => { 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('Please double-check your network connection and retry.'); + Alert.alert(ERROR_DOUBLE_CHECK_CONNECTION); return { name: 'Profile creation error', description: error, |
