@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.
48 lines • 1.46 kB
JavaScript
import * as React from 'react';
import { useHMSRoomColorPalette, useHMSRoomStyleSheet } from '../hooks-util';
import { HMSBaseButton } from './HMSBaseButton';
import { COLORS } from '../utils/theme';
export const HMSDangerButton = ({
title,
loading,
onPress,
testID,
style,
disabled,
leftComponent,
wrapWithGestureDetector
}) => {
const {
alert_error_dim: alertErrorDimColor,
alert_error_brighter: alertErrorBrighterColor
} = useHMSRoomColorPalette();
const hmsRoomStyles = useHMSRoomStyleSheet((theme, typography) => ({
button: {
backgroundColor: theme.palette.alert_error_default
},
disabledButton: {
backgroundColor: theme.palette.alert_error_dim
},
buttonText: {
color: COLORS.WHITE,
fontFamily: `${typography.font_family}-SemiBold`
},
disabledText: {
color: theme.palette.alert_error_bright
}
}));
return /*#__PURE__*/React.createElement(HMSBaseButton, {
testID: testID,
loaderColor: alertErrorBrighterColor,
loading: loading,
onPress: onPress,
title: title,
underlayColor: alertErrorDimColor,
disabled: disabled,
leftComponent: leftComponent,
style: [hmsRoomStyles.button, disabled ? hmsRoomStyles.disabledButton : null, style],
textStyle: [hmsRoomStyles.buttonText, disabled ? hmsRoomStyles.disabledText : null],
wrapWithGestureDetector: wrapWithGestureDetector
});
};
//# sourceMappingURL=HMSDangerButton.js.map