From 80a5b47d9fef940604d729ff5c428e16aa4be37a Mon Sep 17 00:00:00 2001 From: Kingsley-swe <71396041+Kingsley-swe@users.noreply.github.com> Date: Sat, 24 Oct 2020 20:52:28 -0400 Subject: [TMA 27] Followers list (#69) * "Followers list " * Mended followers list * fix export error Co-authored-by: Ashm Walia Co-authored-by: Husam Salhab <47015061+hsalhab@users.noreply.github.com> --- src/components/profile/Content.tsx | 5 +- src/components/profile/FollowCount.tsx | 30 +++++++-- src/components/profile/Followers.tsx | 64 +++++++++++++++++++ src/components/profile/ProfileHeader.tsx | 9 ++- src/components/profile/index.ts | 1 + src/routes/profile/Profile.tsx | 6 ++ src/routes/profile/ProfileStack.tsx | 3 + src/screens/onboarding/Login.tsx | 1 + src/screens/profile/FollowersListScreen.tsx | 99 +++++++++++++++++++++++++++++ src/screens/profile/index.ts | 1 + 10 files changed, 208 insertions(+), 11 deletions(-) create mode 100644 src/components/profile/Followers.tsx create mode 100644 src/screens/profile/FollowersListScreen.tsx (limited to 'src') diff --git a/src/components/profile/Content.tsx b/src/components/profile/Content.tsx index 8a3c36ff..50e9d627 100644 --- a/src/components/profile/Content.tsx +++ b/src/components/profile/Content.tsx @@ -158,9 +158,8 @@ const Content: React.FC = ({y, isProfileView}) => { showsVerticalScrollIndicator={false} scrollEventThrottle={1} stickyHeaderIndices={[2, 4]}> - - - + + = ({style, mode, count}) => { +const FollowCount: React.FC = ({ + style, + mode, + count, + isProfileView, +}) => { const displayed: string = count < 5e3 ? `${count}` @@ -15,13 +23,21 @@ const FollowCount: React.FC = ({style, mode, count}) => { : count < 1e6 ? `${(count / 1e3).toFixed(0)}k` : `${count / 1e6}m`; + const navigation = useNavigation(); return ( - - {displayed} - - {mode === 'followers' ? 'Followers' : 'Following'} - - + + navigation.navigate('FollowersListScreen', { + isProfileView: isProfileView, + }) + }> + + {displayed} + + {mode === 'followers' ? 'Followers' : 'Following'} + + + ); }; diff --git a/src/components/profile/Followers.tsx b/src/components/profile/Followers.tsx new file mode 100644 index 00000000..e0fee303 --- /dev/null +++ b/src/components/profile/Followers.tsx @@ -0,0 +1,64 @@ +import React from 'react'; +import {View, StyleSheet, ViewProps, Text} from 'react-native'; +import {ProfilePreviewType} from '../../types'; +import {ProfilePreview} from '..'; +import {useNavigation} from '@react-navigation/native'; +import {Button} from 'react-native-elements'; + +interface FollowersListProps { + followers: Array; + sectionTitle: string; +} + +const Followers: React.FC = ({followers}) => { + const navigation = useNavigation(); + return ( + <> + +