@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.3 kB
JavaScript
import * as React from 'react';
import { useHMSActions } from '../hooks-sdk';
import { ScreenShareIcon } from '../Icons';
import { HMSDangerButton } from './HMSDangerButton';
import { HMSNotification } from './HMSNotification';
import { useHMSRoomStyle } from '../hooks-util';
import { NotificationTypes } from '../types';
import { TestIds } from '../utils/constants';
export const HMSLocalScreenshareNotification = () => {
const hmsActions = useHMSActions();
const notificationStyle = useHMSRoomStyle(theme => ({
backgroundColor: theme.palette.surface_default
}));
const stopScreenshare = async () => {
await hmsActions.setScreenShareEnabled(false);
};
return /*#__PURE__*/React.createElement(HMSNotification, {
id: NotificationTypes.LOCAL_SCREENSHARE,
autoDismiss: false,
style: notificationStyle,
text: 'You are sharing your screen',
textTestID: TestIds.notification_sharing_screen,
icon: /*#__PURE__*/React.createElement(ScreenShareIcon, null),
cta: /*#__PURE__*/React.createElement(HMSDangerButton, {
testID: TestIds.notification_stop_screen_share_btn,
loading: false,
onPress: stopScreenshare,
title: "Stop",
wrapWithGestureDetector: true
})
});
};
//# sourceMappingURL=HMSLocalScreenshareNotification.js.map