diff options
author | Kingsley-swe <71396041+Kingsley-swe@users.noreply.github.com> | 2020-10-24 20:52:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-24 20:52:28 -0400 |
commit | 80a5b47d9fef940604d729ff5c428e16aa4be37a (patch) | |
tree | 8088322f15e89dd7347b1940cc59ad9efc974bfa /src/components/profile/Followers.tsx | |
parent | 84d283b44f2b6cecb757edcd94e717a36c3ba3c3 (diff) |
[TMA 27] Followers list (#69)
* "Followers list "
* Mended followers list
* fix export error
Co-authored-by: Ashm Walia <ashmwalia@outlook.com>
Co-authored-by: Husam Salhab <47015061+hsalhab@users.noreply.github.com>
Diffstat (limited to 'src/components/profile/Followers.tsx')
-rw-r--r-- | src/components/profile/Followers.tsx | 64 |
1 files changed, 64 insertions, 0 deletions
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<ProfilePreviewType>; + sectionTitle: string; +} + +const Followers: React.FC<FollowersListProps> = ({followers}) => { + const navigation = useNavigation(); + return ( + <> + <View style={styles.header}> + <Button + title="X" + buttonStyle={styles.button} + titleStyle={styles.buttonText} + onPress={() => { + navigation.goBack(); + }} + /> + <Text style={styles.title}>{'Followers'}</Text> + </View> + {followers.map((profilePreview) => ( + <ProfilePreview + style={styles.follower} + key={profilePreview.id} + {...{profilePreview}} + isComment={false} + /> + ))} + </> + ); +}; + +const styles = StyleSheet.create({ + header: {flexDirection: 'row'}, + follower: { + marginVertical: 10, + }, + title: { + position: 'relative', + fontSize: 17, + fontWeight: 'bold', + paddingBottom: 10, + paddingTop: 10, + flexGrow: 1, + paddingLeft: '26%', + }, + button: { + backgroundColor: 'transparent', + }, + buttonText: { + color: 'black', + fontSize: 18, + fontWeight: '400', + }, +}); + +export default Followers; |