diff options
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/suggestedPeople/MutualFriends.tsx | 24 |
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> |