aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components/profile/FriendsCount.tsx8
-rw-r--r--src/screens/suggestedPeople/SPBody.tsx10
2 files changed, 10 insertions, 8 deletions
diff --git a/src/components/profile/FriendsCount.tsx b/src/components/profile/FriendsCount.tsx
index a733823f..4790743b 100644
--- a/src/components/profile/FriendsCount.tsx
+++ b/src/components/profile/FriendsCount.tsx
@@ -1,11 +1,11 @@
+import {useNavigation} from '@react-navigation/native';
import React from 'react';
-import {View, Text, StyleSheet, ViewProps} from 'react-native';
+import {StyleSheet, Text, View, ViewProps} from 'react-native';
import {TouchableOpacity} from 'react-native-gesture-handler';
-import {useNavigation} from '@react-navigation/native';
-import {RootState} from '../../store/rootReducer';
import {useSelector, useStore} from 'react-redux';
+import {RootState} from '../../store/rootReducer';
import {ScreenType} from '../../types';
-import {canViewProfile, canViewProfileFoo, normalize} from '../../utils';
+import {canViewProfile, normalize} from '../../utils';
interface FriendsCountProps extends ViewProps {
userXId: string | undefined;
diff --git a/src/screens/suggestedPeople/SPBody.tsx b/src/screens/suggestedPeople/SPBody.tsx
index f38945f7..297f76c0 100644
--- a/src/screens/suggestedPeople/SPBody.tsx
+++ b/src/screens/suggestedPeople/SPBody.tsx
@@ -4,10 +4,12 @@ import {StyleSheet, Text, View} from 'react-native';
import {Image} from 'react-native-animatable';
import {TouchableOpacity} from 'react-native-gesture-handler';
import Animated from 'react-native-reanimated';
+import {useStore} from 'react-redux';
import RequestedButton from '../../assets/ionicons/requested-button.svg';
import {TaggsBar} from '../../components';
import {BadgesDropdown, MutualFriends} from '../../components/suggestedPeople';
import {BADGE_DATA} from '../../constants/badges';
+import {RootState} from '../../store/rootReducer';
import {
ProfilePreviewType,
ScreenType,
@@ -39,7 +41,6 @@ const SPBody: React.FC<SPBodyProps> = ({
suggested_people_url,
friendship,
badges,
- is_private,
},
itemIndex,
onAddFriend,
@@ -55,6 +56,7 @@ const SPBody: React.FC<SPBodyProps> = ({
}[]
>([]);
const navigation = useNavigation();
+ const state: RootState = useStore().getState();
useEffect(() => {
const newBadges: {badge: UniversityBadge; img: any}[] = [];
const findBadgeIcons = (badge: UniversityBadge) => {
@@ -165,9 +167,9 @@ const SPBody: React.FC<SPBodyProps> = ({
whiteRing={true}
linkedSocials={social_links}
allowNavigation={canViewProfile(
- loggedInUserId === user.id,
- is_private,
- friendship.status === 'friends',
+ state,
+ loggedInUserId === user.id ? undefined : user.id,
+ screenType,
)}
/>
<View style={styles.marginManager}>