aboutsummaryrefslogtreecommitdiff
path: root/src/screens/profile/EditProfile.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@thetaggid.com>2021-01-15 19:27:03 -0500
committerGitHub <noreply@github.com>2021-01-15 19:27:03 -0500
commit1803da7388902db45ad37fbac509604ae632bdb5 (patch)
treea786919f9bc42f7797367d55ed8f1e099134f368 /src/screens/profile/EditProfile.tsx
parent4d9efafeb4243e20e1fc936c27b9055c7ec82f8a (diff)
parentcc52dabaaf529763e9c1c4683ba94ed55c5671a8 (diff)
Merge pull request #176 from IvanIFChen/tma498-update-error-strings
[TMA-498] Update Error Strings
Diffstat (limited to 'src/screens/profile/EditProfile.tsx')
-rw-r--r--src/screens/profile/EditProfile.tsx17
1 files changed, 10 insertions, 7 deletions
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,