@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.
45 lines • 1.28 kB
JavaScript
import React from 'react';
import { View, Text, StyleSheet, TouchableOpacity } from 'react-native';
import { useHMSRoomStyleSheet } from '../hooks-util';
import { CheckBoxIcon } from '../Icons';
export const CheckboxInputRow = ({
text,
containerStyle,
selected,
disabled,
textStyle,
onChange
}) => {
const hmsRoomStyles = useHMSRoomStyleSheet((theme, typography) => ({
surfaceHighRegularText: {
color: theme.palette.on_surface_high,
fontFamily: `${typography.font_family}-Regular`
}
}));
return /*#__PURE__*/React.createElement(TouchableOpacity, {
disabled: disabled,
style: [styles.container, containerStyle],
onPress: () => onChange(!selected)
}, /*#__PURE__*/React.createElement(View, {
style: styles.radioWrapper
}, /*#__PURE__*/React.createElement(CheckBoxIcon, {
type: selected ? 'checked' : 'unchecked'
})), /*#__PURE__*/React.createElement(Text, {
style: [styles.normalText, hmsRoomStyles.surfaceHighRegularText, textStyle]
}, text));
};
const styles = StyleSheet.create({
container: {
flexDirection: 'row',
alignItems: 'center'
},
radioWrapper: {
padding: 8,
marginRight: 8
},
normalText: {
fontSize: 16,
lineHeight: 24
}
});
//# sourceMappingURL=CheckboxInputRow.js.map