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.

33 lines 1.34 kB
import * as React from 'react'; import { StyleSheet } from 'react-native'; import { useDispatch, useSelector } from 'react-redux'; import { PressableIcon } from './PressableIcon'; import { MaximizeIcon, MinimizeIcon } from '../Icons'; import { useHMSRoomStyle } from '../hooks-util'; import { hexToRgbA } from '../utils/theme'; import { setFullScreenWhiteboard } from '../redux/actions'; export const WhiteboardFullScreenButton = () => { const dispatch = useDispatch(); const fullScreenWhiteboard = useSelector(state => state.app.fullScreenWhiteboard); const buttonStyles = useHMSRoomStyle(theme => ({ backgroundColor: theme.palette.background_dim && hexToRgbA(theme.palette.background_dim, 0.64) })); const maximizeAction = !fullScreenWhiteboard; const handleFullScreenPress = () => { dispatch(setFullScreenWhiteboard(!fullScreenWhiteboard)); }; return /*#__PURE__*/React.createElement(PressableIcon, { border: false, onPress: handleFullScreenPress, style: [styles.container, buttonStyles] }, maximizeAction ? /*#__PURE__*/React.createElement(MaximizeIcon, null) : /*#__PURE__*/React.createElement(MinimizeIcon, null)); }; const styles = StyleSheet.create({ container: { position: 'absolute', top: 8, right: 8, padding: 8 } }); //# sourceMappingURL=WhiteboardFullScreenButton.js.map