aboutsummaryrefslogtreecommitdiff
path: root/src/components/profile/ToggleButton.tsx
diff options
context:
space:
mode:
authorAshm Walia <40498934+ashmgarv@users.noreply.github.com>2020-12-30 11:36:44 -0800
committerGitHub <noreply@github.com>2020-12-30 14:36:44 -0500
commit38661e00281363b0f4ad32f0b29d739e1ca09164 (patch)
tree316cd837b6cc6ae24783f1d93d6c9ee7fb898f68 /src/components/profile/ToggleButton.tsx
parentbd2f89805d0bb1c2f1d08fe8d91099aa4f109d35 (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/components/profile/ToggleButton.tsx')
-rw-r--r--src/components/profile/ToggleButton.tsx23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/components/profile/ToggleButton.tsx b/src/components/profile/ToggleButton.tsx
index 88eb9f8a..df7380d7 100644
--- a/src/components/profile/ToggleButton.tsx
+++ b/src/components/profile/ToggleButton.tsx
@@ -1,8 +1,8 @@
import * as React from 'react';
import {StyleSheet, Text} from 'react-native';
import {TouchableOpacity} from 'react-native-gesture-handler';
-import { TAGG_TEXT_LIGHT_BLUE } from '../../constants';
-import {getToggleButtonText, SCREEN_HEIGHT, SCREEN_WIDTH} from '../../utils';
+import {TAGG_TEXT_LIGHT_BLUE} from '../../constants';
+import {getToggleButtonText, SCREEN_WIDTH} from '../../utils';
type ToggleButtonProps = {
toggleState: boolean;
@@ -15,9 +15,15 @@ const ToggleButton: React.FC<ToggleButtonProps> = ({
handleToggle,
buttonType,
}) => {
+ const buttonColor = toggleState
+ ? styles.buttonColorToggled
+ : styles.buttonColor;
+ const textColor = toggleState ? styles.textColorToggled : styles.textColor;
return (
- <TouchableOpacity style={styles.button} onPress={() => handleToggle()}>
- <Text style={styles.text}>
+ <TouchableOpacity
+ style={[styles.button, buttonColor]}
+ onPress={() => handleToggle()}>
+ <Text style={[styles.text, textColor]}>
{getToggleButtonText(buttonType, toggleState)}
</Text>
</TouchableOpacity>
@@ -30,15 +36,18 @@ const styles = StyleSheet.create({
alignItems: 'center',
width: SCREEN_WIDTH * 0.25,
height: SCREEN_WIDTH * 0.1,
- borderRadius: 8,
borderColor: TAGG_TEXT_LIGHT_BLUE,
- backgroundColor: 'white',
borderWidth: 3,
marginRight: '2%',
},
text: {
fontWeight: 'bold',
- color: TAGG_TEXT_LIGHT_BLUE,
},
+ buttonColor: {
+ backgroundColor: TAGG_TEXT_LIGHT_BLUE,
+ },
+ textColor: {color: 'white'},
+ buttonColorToggled: {backgroundColor: 'white'},
+ textColorToggled: {color: TAGG_TEXT_LIGHT_BLUE},
});
export default ToggleButton;