diff options
author | Ivan Chen <ivan@thetaggid.com> | 2020-10-22 17:42:29 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-22 17:42:29 -0400 |
commit | 52a3fe743e6122d157eaab3ad7bab0c70a96676b (patch) | |
tree | 564c5df3864a0d0fe09f7c18613d4cf5a1093170 /src/components/onboarding | |
parent | 08f9aebbaef871629323767c93c9e54cea527bed (diff) |
[TMA-242] Twitter and Facebook Tagg View (#63)
* modified the way we store social media data, initial skeleton
* MVP? Twitter done?
* cleaned up some things
* forgot to lint and cleaned up some more code
* minor change to text display
* fixed some UI bug, linting, and minor adjustment to posts UI
* fixed a couple of things
* added DateLabel, Facebook taggs view, fixed minor stuff
* Some small changes for the PR
* removed unused Feed
Co-authored-by: Ashm Walia <ashmwalia@outlook.com>
Diffstat (limited to 'src/components/onboarding')
-rw-r--r-- | src/components/onboarding/SocialMediaLinker.tsx | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/components/onboarding/SocialMediaLinker.tsx b/src/components/onboarding/SocialMediaLinker.tsx index e7f78834..15afb731 100644 --- a/src/components/onboarding/SocialMediaLinker.tsx +++ b/src/components/onboarding/SocialMediaLinker.tsx @@ -28,7 +28,6 @@ interface SocialMediaLinkerProps extends TouchableOpacityProps { const SocialMediaLinker: React.FC<SocialMediaLinkerProps> = ({ social: {label}, }) => { - const [state, setState] = React.useState({ authenticated: false, }); @@ -36,7 +35,7 @@ const SocialMediaLinker: React.FC<SocialMediaLinkerProps> = ({ const integrated_endpoints: {[label: string]: [string, string]} = { Instagram: [LINK_IG_OAUTH, LINK_IG_ENDPOINT], Facebook: [LINK_FB_OAUTH, LINK_FB_ENDPOINT], - Twitter: [LINK_TWITTER_OAUTH, LINK_TWITTER_ENDPOINT] + Twitter: [LINK_TWITTER_OAUTH, LINK_TWITTER_ENDPOINT], }; const registerSocialLink: (token: string) => Promise<boolean> = async ( @@ -71,7 +70,7 @@ const SocialMediaLinker: React.FC<SocialMediaLinkerProps> = ({ Alert.alert('Coming soon!'); return; } - let url = integrated_endpoints[label][0] + let url = integrated_endpoints[label][0]; // We will need to do an extra step for twitter sign-in if (label === 'Twitter') { @@ -79,10 +78,10 @@ const SocialMediaLinker: React.FC<SocialMediaLinkerProps> = ({ const response = await fetch(url, { method: 'GET', headers: { - Authorization: `Token ${user_token}` - } + Authorization: `Token ${user_token}`, + }, }); - url = response.url + url = response.url; } if (isAvailable) { @@ -90,7 +89,7 @@ const SocialMediaLinker: React.FC<SocialMediaLinkerProps> = ({ ephemeralWebSession: true, }) .then(async (response) => { - console.log(response) + console.log(response); if (response.type === 'success' && response.url) { const success = await registerSocialLink(response.url); if (!success) { @@ -107,9 +106,7 @@ const SocialMediaLinker: React.FC<SocialMediaLinkerProps> = ({ }) .catch((error) => { console.log(error); - Alert.alert( - `Something went wrong, we can't link with ${label} 😔`, - ); + Alert.alert(`Something went wrong, we can't link with ${label} 😔`); }); } else { // Okay... to open an external browser and have it link back to |