aboutsummaryrefslogtreecommitdiff
path: root/src/screens
diff options
context:
space:
mode:
Diffstat (limited to 'src/screens')
-rw-r--r--src/screens/profile/SocialMediaTaggs.tsx33
1 files changed, 10 insertions, 23 deletions
diff --git a/src/screens/profile/SocialMediaTaggs.tsx b/src/screens/profile/SocialMediaTaggs.tsx
index 0ac6d1ef..2a319326 100644
--- a/src/screens/profile/SocialMediaTaggs.tsx
+++ b/src/screens/profile/SocialMediaTaggs.tsx
@@ -1,17 +1,18 @@
import {RouteProp} from '@react-navigation/native';
-import React from 'react';
-import {Alert, ScrollView, StatusBar, StyleSheet, View} from 'react-native';
+import React, {useEffect, useState} from 'react';
+import {ScrollView, StatusBar, StyleSheet, View} from 'react-native';
import LinearGradient from 'react-native-linear-gradient';
-import {AVATAR_GRADIENT} from '../../constants';
import {
SocialMediaInfo,
TabsGradient,
TaggPost,
TwitterTaggPost,
} from '../../components';
-import {AuthContext, ProfileStackParams, ProfileContext} from '../../routes';
+import {AVATAR_GRADIENT} from '../../constants';
+import {AuthContext, ProfileContext, ProfileStackParams} from '../../routes';
+import {loadSocialPosts} from '../../services';
+import {SimplePostType, SocialAccountType, TwitterPostType} from '../../types';
import {headerBarHeightWithImage, SCREEN_HEIGHT} from '../../utils';
-import {SimplePostType, TwitterPostType} from '../../types';
type SocialMediaTaggsRouteProp = RouteProp<
ProfileStackParams,
@@ -22,17 +23,6 @@ interface SocialMediaTaggsProps {
route: SocialMediaTaggsRouteProp;
}
-/**
- * Social media taggs screen for a user's social media
- * includes:
- * + tagg profile pic
- * + username from social media
- * + post
- * + caption
- * + sharebutton + number of shares
- * + date posted
- * + dark background
- */
const SocialMediaTaggs: React.FC<SocialMediaTaggsProps> = ({route}) => {
const {socialMediaType, isProfileView} = route.params;
const context = isProfileView
@@ -42,11 +32,8 @@ const SocialMediaTaggs: React.FC<SocialMediaTaggsProps> = ({route}) => {
profile: {name},
socialAccounts,
} = context;
-
-
- const handle = socialAccounts[socialMediaType].handle;
- const posts = socialAccounts[socialMediaType].posts || [];
const headerHeight = headerBarHeightWithImage();
+ let accountData = socialAccounts[socialMediaType];
return (
<LinearGradient
@@ -65,15 +52,15 @@ const SocialMediaTaggs: React.FC<SocialMediaTaggsProps> = ({route}) => {
<SocialMediaInfo
fullname={name}
type={socialMediaType}
- handle={handle}
+ handle={accountData.handle}
/>
- {(posts as Array<
+ {(accountData.posts as Array<
SimplePostType | TwitterPostType
>).map((post, index) =>
socialMediaType === 'Twitter' ? (
<TwitterTaggPost
key={index}
- ownerHandle={handle || '_'}
+ ownerHandle={accountData.handle || '_'}
post={post as TwitterPostType}
/>
) : (