import React from 'react'; import { Pressable, StyleSheet, Text, View } from 'react-native'; import { StopScreenShare } from '../../icons'; import { useTheme } from '../../contexts'; import { useCall, useI18n } from '@stream-io/video-react-bindings'; /** * Props for the ScreenShareOverlay component */ export type ScreenShareOverlayProps = {}; /** * The component that displays the screen sharing overlay, when the screen is shared. */ export const ScreenShareOverlay = ({}: ScreenShareOverlayProps) => { const call = useCall(); const { t } = useI18n(); const { theme: { colors, typefaces, variants: { iconSizes }, screenshareOverlay, }, } = useTheme(); const onStopScreenshareHandler = async () => { // force-stop is required to stop the OS prompts of screen share await call?.screenShare.disable(true); }; return ( {t('You are sharing your screen with everyone')} { return [ styles.button, { backgroundColor: colors.sheetSecondary, opacity: pressed ? 0.2 : 1, }, screenshareOverlay.button, ]; }} > {t('Stop Screen Sharing')} ); }; const styles = StyleSheet.create({ container: { flex: 1, alignItems: 'center', justifyContent: 'center', }, text: {}, button: { marginTop: 16, padding: 8, borderRadius: 8, flexDirection: 'row', justifyContent: 'center', alignItems: 'center', }, buttonIcon: {}, buttonText: { marginLeft: 8, includeFontPadding: false, }, });