From 52a3fe743e6122d157eaab3ad7bab0c70a96676b Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Thu, 22 Oct 2020 17:42:29 -0400 Subject: [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 --- src/components/onboarding/SocialMediaLinker.tsx | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src/components/onboarding') 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 = ({ social: {label}, }) => { - const [state, setState] = React.useState({ authenticated: false, }); @@ -36,7 +35,7 @@ const SocialMediaLinker: React.FC = ({ 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 = async ( @@ -71,7 +70,7 @@ const SocialMediaLinker: React.FC = ({ 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 = ({ 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 = ({ 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 = ({ }) .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 -- cgit v1.2.3-70-g09d2