aboutsummaryrefslogtreecommitdiff
path: root/src/components/profile/FollowCount.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/profile/FollowCount.tsx')
-rw-r--r--src/components/profile/FollowCount.tsx7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/components/profile/FollowCount.tsx b/src/components/profile/FollowCount.tsx
index 80d56de4..3e270428 100644
--- a/src/components/profile/FollowCount.tsx
+++ b/src/components/profile/FollowCount.tsx
@@ -2,6 +2,7 @@ import React from 'react';
import {View, Text, StyleSheet, ViewProps} from 'react-native';
import {TouchableOpacity} from 'react-native-gesture-handler';
import {useNavigation} from '@react-navigation/native';
+import {AuthContext, ProfileContext} from '../../routes';
interface FollowCountProps extends ViewProps {
mode: 'followers' | 'following';
@@ -15,6 +16,10 @@ const FollowCount: React.FC<FollowCountProps> = ({
count,
isProfileView,
}) => {
+ const {followers, following} = isProfileView
+ ? React.useContext(ProfileContext)
+ : React.useContext(AuthContext);
+
const navigation = useNavigation();
const displayed: string =
count < 5e3
@@ -28,8 +33,8 @@ const FollowCount: React.FC<FollowCountProps> = ({
<TouchableOpacity
onPress={() =>
navigation.push('FollowersListScreen', {
- isProfileView: isProfileView,
isFollowers: mode === 'followers',
+ list: mode === 'followers' ? followers : following,
})
}>
<View style={[styles.container, style]}>