From 408c1c4046d1945ea4d2e857796841368ab1b8e8 Mon Sep 17 00:00:00 2001 From: Shravya Ramesh Date: Wed, 19 May 2021 16:42:45 -0700 Subject: Add new radio button --- src/components/common/TaggRadioButton.tsx | 51 +++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/components/common/TaggRadioButton.tsx (limited to 'src/components/common/TaggRadioButton.tsx') diff --git a/src/components/common/TaggRadioButton.tsx b/src/components/common/TaggRadioButton.tsx new file mode 100644 index 00000000..bd48bd5c --- /dev/null +++ b/src/components/common/TaggRadioButton.tsx @@ -0,0 +1,51 @@ +import React from 'react'; +import {StyleSheet, TouchableOpacity, View} from 'react-native'; + +interface TaggRadioButtonProps { + pressed: boolean; + setPressed: Function; + onPress: Function; +} +const TaggRadioButton: React.FC = ({ + pressed, + setPressed, + onPress, +}) => { + const activeOuterStyle = { + borderColor: pressed ? '#6EE7E7' : '#BEBEBE', + }; + + const activeInnerStyle = { + backgroundColor: pressed ? '#6EE7E7' : 'white', + }; + return ( + { + setPressed(!pressed); + onPress(); + }}> + {pressed && } + + ); +}; + +export default TaggRadioButton; +const styles = StyleSheet.create({ + outer: { + width: 20, + height: 20, + borderWidth: 1.5, + borderRadius: 20, + + backgroundColor: 'white', + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'center', + }, + inner: { + width: 14, + height: 14, + borderRadius: 8, + }, +}); -- cgit v1.2.3-70-g09d2