diff options
author | Ashm Walia <40498934+ashmgarv@users.noreply.github.com> | 2020-10-24 16:12:39 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-24 19:12:39 -0400 |
commit | 84d283b44f2b6cecb757edcd94e717a36c3ba3c3 (patch) | |
tree | 532a6c415c57b90bb90243b2d99845bb3e93d058 /src/components/profile/FollowUnfollow.tsx | |
parent | 8b680e97ad4689493d2c398281cc0da8e333aa04 (diff) |
[TMA 301] Add follow/unfollow button to profile (#70)
* Follow Unfollow User
* Fixed an issue and moved api call to Content.tsx
* last
* Small changes
Diffstat (limited to 'src/components/profile/FollowUnfollow.tsx')
-rw-r--r-- | src/components/profile/FollowUnfollow.tsx | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/components/profile/FollowUnfollow.tsx b/src/components/profile/FollowUnfollow.tsx new file mode 100644 index 00000000..bb1e9ef7 --- /dev/null +++ b/src/components/profile/FollowUnfollow.tsx @@ -0,0 +1,40 @@ +import * as React from 'react'; +import {StyleSheet, Text} from 'react-native'; +import {TouchableOpacity} from 'react-native-gesture-handler'; + +type FollowUnfollowProps = { + followed: boolean; + handleFollowUnfollow: Function; +}; + +const FollowUnfollow: React.FC<FollowUnfollowProps> = ({ + followed, + handleFollowUnfollow, +}) => { + return ( + <TouchableOpacity + style={styles.button} + onPress={() => handleFollowUnfollow()}> + <Text style={styles.text}>{!followed ? `Follow` : `Unfollow`}</Text> + </TouchableOpacity> + ); +}; + +const styles = StyleSheet.create({ + button: { + justifyContent: 'center', + alignItems: 'center', + width: 110, + height: 40, + borderRadius: 8, + marginTop: '5%', + borderColor: '#698dd3', + backgroundColor: 'white', + borderWidth: 3, + }, + text: { + fontWeight: 'bold', + color: '#698dd3', + }, +}); +export default FollowUnfollow; |