diff options
| author | Ashm Walia <40498934+ashmgarv@users.noreply.github.com> | 2020-12-30 11:36:44 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-30 14:36:44 -0500 |
| commit | 38661e00281363b0f4ad32f0b29d739e1ca09164 (patch) | |
| tree | 316cd837b6cc6ae24783f1d93d6c9ee7fb898f68 /src/screens/profile | |
| parent | bd2f89805d0bb1c2f1d08fe8d91099aa4f109d35 (diff) | |
[TMA - 457]Change followers to friends (#149)
* One commit to replace followers with friends
* Move block unblock to drawer and some cosmetic changes
* Options to edit own profile when viewing
* Changes for University Class
* Small fix
* Made ProfileOnboarding a scroll view and other small changes
* Small fix
* Small fix thanks to ivan and tanmay
* Add ?
Diffstat (limited to 'src/screens/profile')
| -rw-r--r-- | src/screens/profile/FriendsListScreen.tsx (renamed from src/screens/profile/FollowersListScreen.tsx) | 36 | ||||
| -rw-r--r-- | src/screens/profile/index.ts | 2 |
2 files changed, 13 insertions, 25 deletions
diff --git a/src/screens/profile/FollowersListScreen.tsx b/src/screens/profile/FriendsListScreen.tsx index 874dd01b..f7192d10 100644 --- a/src/screens/profile/FollowersListScreen.tsx +++ b/src/screens/profile/FriendsListScreen.tsx @@ -1,6 +1,6 @@ -import React, {useEffect, useState} from 'react'; +import React, {useState} from 'react'; import {RouteProp} from '@react-navigation/native'; -import {TabsGradient, Followers, CenteredView} from '../../components'; +import {TabsGradient, Friends, CenteredView} from '../../components'; import {ScrollView} from 'react-native-gesture-handler'; import {SCREEN_HEIGHT} from '../../utils'; import {StyleSheet, View} from 'react-native'; @@ -10,28 +10,20 @@ import {EMPTY_PROFILE_PREVIEW_LIST} from '../../store/initialStates'; import {useSelector} from 'react-redux'; import {RootState} from '../../store/rootReducer'; -type FollowersListScreenRouteProp = RouteProp< +type FriendsListScreenRouteProp = RouteProp< ProfileStackParams, - 'FollowersListScreen' + 'FriendsListScreen' >; -interface FollowersListScreenProps { - route: FollowersListScreenRouteProp; +interface FriendsListScreenProps { + route: FriendsListScreenRouteProp; } -const FollowersListScreen: React.FC<FollowersListScreenProps> = ({route}) => { - const {isFollowers, userXId, screenType} = route.params; +const FriendsListScreen: React.FC<FriendsListScreenProps> = ({route}) => { + const {userXId, screenType} = route.params; - const {followers, following} = userXId + const {friends} = userXId ? useSelector((state: RootState) => state.userX[screenType][userXId]) - : useSelector((state: RootState) => state.follow); - - const [list, setList] = useState<ProfilePreviewType[]>( - EMPTY_PROFILE_PREVIEW_LIST, - ); - - useEffect(() => { - setList(isFollowers ? followers : following); - }, [followers, following, setList]); + : useSelector((state: RootState) => state.friends); return ( <CenteredView> @@ -41,11 +33,7 @@ const FollowersListScreen: React.FC<FollowersListScreenProps> = ({route}) => { stickyHeaderIndices={[4]} contentContainerStyle={styles.contentContainer} showsVerticalScrollIndicator={false}> - <Followers - result={list} - sectionTitle={isFollowers ? 'Followers' : 'Following'} - screenType={screenType} - /> + <Friends result={friends} screenType={screenType} /> </ScrollView> <TabsGradient /> </View> @@ -80,4 +68,4 @@ const styles = StyleSheet.create({ }, }); -export default FollowersListScreen; +export default FriendsListScreen; diff --git a/src/screens/profile/index.ts b/src/screens/profile/index.ts index 3bfe5d30..b6a13144 100644 --- a/src/screens/profile/index.ts +++ b/src/screens/profile/index.ts @@ -3,5 +3,5 @@ export {default as SocialMediaTaggs} from './SocialMediaTaggs'; export {default as CaptionScreen} from './CaptionScreen'; export {default as IndividualMoment} from './IndividualMoment'; export {default as MomentCommentsScreen} from './MomentCommentsScreen'; -export {default as FollowersListScreen} from './FollowersListScreen'; +export {default as FriendsListScreen} from './FriendsListScreen'; export {default as EditProfile} from './EditProfile'; |
