aboutsummaryrefslogtreecommitdiff
path: root/src/components/onboarding/SocialMediaLinker.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/onboarding/SocialMediaLinker.tsx')
-rw-r--r--src/components/onboarding/SocialMediaLinker.tsx17
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