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.

46 lines 1.36 kB
// @ts-ignore - Ignoring React import as it is generating error while running prepack script import React from 'react'; import { StyleSheet, Text, TouchableOpacity, ActivityIndicator } from 'react-native'; import { COLORS } from '../utils/theme'; const CustomButton = ({ loading = false, disabled = false, title, onPress, textStyle, viewStyle, LeftIcon, RightIcon }) => { const onButtonPress = () => { onPress(); }; return /*#__PURE__*/React.createElement(TouchableOpacity, { disabled: disabled || loading, style: [styles.buttonConatiner, viewStyle, disabled && styles.disabled, loading && styles.opacity], onPress: onButtonPress }, loading ? /*#__PURE__*/React.createElement(ActivityIndicator, { color: COLORS.WHITE }) : /*#__PURE__*/React.createElement(React.Fragment, null, LeftIcon, title && /*#__PURE__*/React.createElement(Text, { style: [textStyle, disabled && styles.disabledText] }, title), RightIcon)); }; const styles = StyleSheet.create({ buttonConatiner: { width: '100%', height: 48, flexDirection: 'row' }, disabled: { backgroundColor: COLORS.SECONDARY.DISABLED, borderColor: COLORS.SECONDARY.DISABLED }, disabledText: { color: COLORS.TEXT.DISABLED_ACCENT }, opacity: { opacity: 0.5 } }); export { CustomButton }; //# sourceMappingURL=CustomButton.js.map