diff options
author | Ivan Chen <ivan@thetaggid.com> | 2021-01-15 19:27:03 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-15 19:27:03 -0500 |
commit | 1803da7388902db45ad37fbac509604ae632bdb5 (patch) | |
tree | a786919f9bc42f7797367d55ed8f1e099134f368 /src/components/taggs/Tagg.tsx | |
parent | 4d9efafeb4243e20e1fc936c27b9055c7ec82f8a (diff) | |
parent | cc52dabaaf529763e9c1c4683ba94ed55c5671a8 (diff) |
Merge pull request #176 from IvanIFChen/tma498-update-error-strings
[TMA-498] Update Error Strings
Diffstat (limited to 'src/components/taggs/Tagg.tsx')
-rw-r--r-- | src/components/taggs/Tagg.tsx | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/components/taggs/Tagg.tsx b/src/components/taggs/Tagg.tsx index 12172df9..82ac07df 100644 --- a/src/components/taggs/Tagg.tsx +++ b/src/components/taggs/Tagg.tsx @@ -17,6 +17,11 @@ import { } from '../../services'; import {SmallSocialIcon, SocialIcon, SocialLinkModal} from '../common'; import {UserType} from '../../types'; +import { + ERROR_LINK, + ERROR_UNABLE_TO_FIND_PROFILE, + SUCCESS_LINK, +} from '../../constants/strings'; interface TaggProps { social: string; @@ -56,7 +61,7 @@ const Tagg: React.FC<TaggProps> = ({ show auth browser case !integrated_social: show modal - Tagg's "Tagg" will use the Ring instead of PurpleRing + Tagg's "Tagg" will use the Ring instead of PurpleRing */ const modalOrAuthBrowserOrPass = async () => { @@ -71,7 +76,7 @@ const Tagg: React.FC<TaggProps> = ({ if (socialURL) { Linking.openURL(socialURL); } else { - Alert.alert('We were unable to find this profile 😔'); + Alert.alert(ERROR_UNABLE_TO_FIND_PROFILE); } }); } @@ -79,7 +84,9 @@ const Tagg: React.FC<TaggProps> = ({ if (isIntegrated) { handlePressForAuthBrowser(social).then((success) => { setTaggsNeedUpdate(success); - if (success) setSocialDataNeedUpdate(social, ''); + if (success) { + setSocialDataNeedUpdate(social, ''); + } }); } else { setModalVisible(true); @@ -105,13 +112,13 @@ const Tagg: React.FC<TaggProps> = ({ const linkNonIntegratedSocial = async (username: string) => { if (await registerNonIntegratedSocialLink(social, username)) { - Alert.alert(`Successfully linked ${social} 🎉`); + Alert.alert(SUCCESS_LINK(social)); setTaggsNeedUpdate(true); setSocialDataNeedUpdate(social, username); } else { // If we display too fast the alert will get dismissed with the modal setTimeout(() => { - Alert.alert(`Something went wrong, we can't link with ${social} 😔`); + Alert.alert(ERROR_LINK(social)); }, 500); } }; |