UNPKG

@100mslive/react-native-room-kit

Version:

100ms Room Kit provides simple & easy to use UI components to build Live Streaming & Video Conferencing experiences in your apps.

41 lines 1.03 kB
import React from 'react'; import { View, StyleSheet, TouchableOpacity } from 'react-native'; export const RadioInput = ({ selected, size = 24, color = 'white', onChange }) => { const outerCircleStyle = { width: size, height: size, borderRadius: size / 2, borderWidth: size / 12, borderColor: color }; const innerCircleStyle = { width: size / 2, height: size / 2, borderRadius: size / 4, backgroundColor: color }; const radio = /*#__PURE__*/React.createElement(View, { style: [styles.outerCircle, outerCircleStyle] }, selected ? /*#__PURE__*/React.createElement(View, { style: innerCircleStyle }) : null); if (typeof onChange !== 'function') { return radio; } return /*#__PURE__*/React.createElement(TouchableOpacity, { onPress: () => onChange(!selected) }, radio); }; const styles = StyleSheet.create({ outerCircle: { alignItems: 'center', justifyContent: 'center', borderStyle: 'solid' } }); //# sourceMappingURL=RadioInput.js.map