1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
import React from 'react';
import {
View,
StyleSheet,
TouchableOpacity,
TouchableOpacityProps,
} from 'react-native';
interface RadioCheckboxProps extends TouchableOpacityProps {
checked: boolean;
}
const RadioCheckbox: React.FC<RadioCheckboxProps> = (props) => {
return (
<TouchableOpacity {...props}>
<View style={styles.outerCircle}>
{props.checked && <View style={styles.innerCircle} />}
</View>
</TouchableOpacity>
);
};
const styles = StyleSheet.create({
outerCircle: {
width: 23,
height: 23,
borderRadius: 11.5,
borderWidth: 1,
borderColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
innerCircle: {
width: 17,
height: 17,
borderRadius: 8.5,
backgroundColor: '#04ffff',
},
});
export default RadioCheckbox;
|