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.

48 lines 1.76 kB
import * as React from 'react'; import { Platform, StyleSheet } from 'react-native'; import { useDispatch } from 'react-redux'; import { BottomSheet } from './BottomSheet'; import { useHMSRoomStyleSheet, useModalType } from '../hooks-util'; import { useHeaderHeight } from './Header'; import { useIsLandscapeOrientation } from '../utils/dimension'; import { PollsAndQuizzesModalContent } from './PollsAndQuizzesModalContent'; import { ModalTypes } from '../utils/types'; import { resetNavigationStack } from '../redux/actions'; export const PollsAndQuizBottomSheet = () => { const dispatch = useDispatch(); const headerHeight = useHeaderHeight(); const isLandscapeOrientation = useIsLandscapeOrientation(); const { modalVisibleType: modalVisible, handleModalVisibleType: setModalVisible } = useModalType(); const hmsRoomStyles = useHMSRoomStyleSheet(theme => ({ contentContainer: { backgroundColor: theme.palette.surface_dim } })); const dismissModal = () => { setModalVisible(ModalTypes.DEFAULT); dispatch(resetNavigationStack()); }; const containerStyles = [styles.bottomSheet, { marginTop: isLandscapeOrientation ? 0 : headerHeight + (Platform.OS === 'android' ? 24 : 0) }, hmsRoomStyles.contentContainer]; return /*#__PURE__*/React.createElement(BottomSheet // fullWidth={true} , { dismissModal: dismissModal, isVisible: modalVisible === ModalTypes.POLLS_AND_QUIZZES, avoidKeyboard: true, containerStyle: containerStyles, bottomOffsetSpace: 0 }, /*#__PURE__*/React.createElement(PollsAndQuizzesModalContent, { dismissModal: dismissModal })); }; const styles = StyleSheet.create({ bottomSheet: { flex: 1 } }); //# sourceMappingURL=PollsAndQuizBottomSheet.js.map