aboutsummaryrefslogtreecommitdiff
path: root/src/screens
diff options
context:
space:
mode:
authorGeorge Rusu <56009869+grusu6928@users.noreply.github.com>2020-10-25 15:21:38 -0700
committerGitHub <noreply@github.com>2020-10-25 18:21:38 -0400
commit9da19cdcb6c7596d60afde6d0d559f06a24a0627 (patch)
tree8f11b6e0a5fcdc2eb983d498fa7b016d4daf44ba /src/screens
parent44a25bfabd356f5eee5ec4f580452407a7e40246 (diff)
[TMA-237] Added modal for user registration and redirect (#61)
* move async-storage * removed lock files * added lock files to gitignore * added the wrong file to gitignore * added modal for user registration and redirect * api call to get list of linked socials for each user to display appropriate icon * fixed indentation and linting * refactored modal and browser sign-in * now dynamically adding linked and unlinked taggs, added a bunch of TODOs for tomorrow * added svg icons * done? finished taggs bar UI and all the navigations including modal * fixed some bugs and added more TODOs * fixed some bugs and refactored posts fetching logic * fixed taggs bar bug * done, it will update everything correctly * added comments * added tiktok Co-authored-by: hsalhab <husam_salhab@brown.edu> Co-authored-by: george <grus6928@gmail.com> Co-authored-by: Ivan Chen <ivan@thetaggid.com>
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}
/>
) : (