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.

60 lines 2.14 kB
import * as React from 'react'; import { Pressable, StyleSheet, View } from 'react-native'; import { useDispatch, useSelector } from 'react-redux'; import Animated, { SlideInDown, SlideOutDown } from 'react-native-reanimated'; import { hexToRgbA } from '../utils/theme'; import { useHMSRoomStyleSheet } from '../hooks-util'; import { setPollQDeleteConfirmationVisible } from '../redux/actions'; import { PollQuestionDeleteConfirmation } from './PollQuestionDeleteConfirmation'; const _PollQDeleteConfirmationSheetView = ({}) => { const dispatch = useDispatch(); const deleteConfirmationVisible = useSelector(state => state.polls.deleteConfirmationVisible); const hmsRoomStyles = useHMSRoomStyleSheet(theme => ({ backdrop: { backgroundColor: theme.palette.background_dim && hexToRgbA(theme.palette.background_dim, 0.1) }, contentContainer: { backgroundColor: theme.palette.surface_dim } })); const closeBottomSheet = () => { dispatch(setPollQDeleteConfirmationVisible(false)); }; if (!deleteConfirmationVisible) { return null; } return /*#__PURE__*/React.createElement(View, { style: styles.container }, /*#__PURE__*/React.createElement(Pressable, { onPress: closeBottomSheet, style: [styles.backdrop, hmsRoomStyles.backdrop] }), /*#__PURE__*/React.createElement(Animated.View, { entering: SlideInDown, exiting: SlideOutDown, style: [styles.contentContainer, hmsRoomStyles.contentContainer] }, /*#__PURE__*/React.createElement(PollQuestionDeleteConfirmation, { dismissModal: closeBottomSheet }))); }; const styles = StyleSheet.create({ container: { position: 'absolute', width: '100%', height: '100%', zIndex: 1, justifyContent: 'flex-end', alignSelf: 'center' }, backdrop: { position: 'absolute', width: '100%', height: '100%' }, contentContainer: { width: '100%', borderTopLeftRadius: 16, borderTopRightRadius: 16 } }); export const PollQDeleteConfirmationSheetView = /*#__PURE__*/React.memo(_PollQDeleteConfirmationSheetView); //# sourceMappingURL=PollQDeleteConfirmationSheetView.js.map