import React, {useState, useContext} from 'react'; import {View, TouchableOpacity, Image} from 'react-native'; import {RenderModeType, RtcSurfaceView} from 'react-native-agora'; import styles from '../Style'; import icons from '../Controls/Icons'; import RemoteControls from '../Controls/RemoteControls'; import PropsContext, {UidInterface} from '../Contexts/PropsContext'; import ImageIcon from '../Controls/ImageIcon'; import Username from './Usernames'; // import RtcContext from '../Contexts/RtcContext'; interface MinViewInterface { user: UidInterface; color?: string; showOverlay?: boolean; Fallback?: React.ComponentType; } const MinVideoView: React.FC = (props) => { const [overlay, setOverlay] = useState(false); const {styleProps, rtcProps} = useContext(PropsContext); const {theme, remoteBtnStyles, customIcon} = styleProps || {}; const {minCloseBtnStyles} = remoteBtnStyles || {}; const {showOverlay} = props || {}; return ( {showOverlay ? ( setOverlay(true)}> ) : ( )} {overlay && showOverlay ? ( setOverlay(!overlay)}> ) : ( <> )} {!rtcProps.disableRtm && } ); }; const UserVideoWithFallback = (props: { user: UidInterface; Fallback?: React.ComponentType; }) => { const {Fallback, user} = props; const {styleProps} = useContext(PropsContext); const {videoPlaceholderContainer, videoPlaceholderIcon} = styleProps || {}; return user.video ? ( ) : Fallback ? ( ) : ( ); }; const UserVideo = (props: {user: UidInterface}) => { const {styleProps} = useContext(PropsContext); // const {rtcUidRef} = useContext(RtcContext); const {minViewStyles} = styleProps || {}; return props.user.uid === 'local' ? ( ) : ( ); }; export default MinVideoView;