diff options
author | Ashm Walia <40498934+ashmgarv@users.noreply.github.com> | 2020-11-10 16:28:15 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-10 19:28:15 -0500 |
commit | 3362da273a4ffcc7d6362278bcb9fd919deda2b9 (patch) | |
tree | 6df5f6a0585fc327b0f378851f770b6d31aefebe /src/components/profile/ToggleButton.tsx | |
parent | 9f048868f560dbd1672c1a504deb383ec601589e (diff) |
[TMA - 388] Block Users (Frontend) (#115)
* initial
* Final
* sc
* sc
* sall change
* Remove follow button when blocked
* Small change
* small changes again
Diffstat (limited to 'src/components/profile/ToggleButton.tsx')
-rw-r--r-- | src/components/profile/ToggleButton.tsx | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/components/profile/ToggleButton.tsx b/src/components/profile/ToggleButton.tsx new file mode 100644 index 00000000..ff14cdde --- /dev/null +++ b/src/components/profile/ToggleButton.tsx @@ -0,0 +1,44 @@ +import * as React from 'react'; +import {StyleSheet, Text} from 'react-native'; +import {TouchableOpacity} from 'react-native-gesture-handler'; +import {getToggleButtonText, SCREEN_HEIGHT, SCREEN_WIDTH} from '../../utils'; + +type ToggleButtonProps = { + toggleState: boolean; + handleToggle: Function; + buttonType: string; +}; + +const ToggleButton: React.FC<ToggleButtonProps> = ({ + toggleState, + handleToggle, + buttonType, +}) => { + return ( + <TouchableOpacity style={styles.button} onPress={() => handleToggle()}> + <Text style={styles.text}> + {getToggleButtonText(buttonType, toggleState)} + </Text> + </TouchableOpacity> + ); +}; + +const styles = StyleSheet.create({ + button: { + justifyContent: 'center', + alignItems: 'center', + width: SCREEN_WIDTH * 0.25, + height: SCREEN_WIDTH * 0.1, + borderRadius: 8, + marginTop: '3%', + borderColor: '#698dd3', + backgroundColor: 'white', + borderWidth: 3, + marginHorizontal: '1%', + }, + text: { + fontWeight: 'bold', + color: '#698dd3', + }, +}); +export default ToggleButton; |