aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-02-18 19:08:16 -0500
committerIvan Chen <ivan@tagg.id>2021-02-18 19:08:16 -0500
commitcd10595e8675c8bcf32399a910f90a626d706f3a (patch)
tree3b42405eb871c965abb599f58098119e079d0d52 /src/components
parent0c1b1831392825556d9731f95561da2ef413dd4b (diff)
pagination mostly working
Diffstat (limited to 'src/components')
-rw-r--r--src/components/suggestedPeople/MutualFriends.tsx24
1 files changed, 8 insertions, 16 deletions
diff --git a/src/components/suggestedPeople/MutualFriends.tsx b/src/components/suggestedPeople/MutualFriends.tsx
index f99279c0..283ee6c5 100644
--- a/src/components/suggestedPeople/MutualFriends.tsx
+++ b/src/components/suggestedPeople/MutualFriends.tsx
@@ -1,29 +1,21 @@
import React, {useState} from 'react';
import {SafeAreaView, StyleSheet, Text, View} from 'react-native';
+import {normalize} from 'react-native-elements';
import {ScrollView, TouchableOpacity} from 'react-native-gesture-handler';
-import {useSelector} from 'react-redux';
-import {ScreenType} from '../../types';
import {BottomDrawer, TabsGradient} from '../../components';
-import {RootState} from '../../store/rootReducer';
+import {ProfilePreviewType, ScreenType} from '../../types';
import {isIPhoneX, SCREEN_HEIGHT, SCREEN_WIDTH} from '../../utils';
import {ProfilePreview} from '../profile';
-import {normalize} from 'react-native-elements';
-const MutualFriends: React.FC = () => {
- // Requires user id of profile being viewed
- const userXId = '53a7df9c-c3b2-4b1c-b197-7b1149ecfc8d';
-
- // Fetch mutual friends of user X
- let {friends} = userXId
- ? useSelector((state: RootState) => state.userX[ScreenType.Search][userXId])
- : useSelector((state: RootState) => state.friends);
+interface MutualFriendsProps {
+ user: ProfilePreviewType;
+ friends: ProfilePreviewType[];
+}
+const MutualFriends: React.FC<MutualFriendsProps> = ({user, friends}) => {
// Getting list of first 4 friends to display on suggested people screen
const friendsPreview = friends.slice(0, 4);
- // Extract username of user whose profile is being viewed
- const username = '@' + '12345678901234';
-
// Count to be displayed after + symbol
const count = friends.length - friendsPreview.length;
@@ -61,7 +53,7 @@ const MutualFriends: React.FC = () => {
<View style={styles.headerTextContainer}>
<Text style={styles.headerTitle}>Mutual Friends</Text>
<Text style={styles.headerDescription} numberOfLines={2}>
- {username} and you are both friends with
+ @{user.username} and you are both friends with
</Text>
</View>
</View>