diff options
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); } }; |