| 
									
										
										
										
											2021-01-08 11:32:49 -06:00
										 |  |  | // Copyright 2020-2021 Signal Messenger, LLC
 | 
					
						
							| 
									
										
										
										
											2020-11-13 13:57:55 -06:00
										 |  |  | // SPDX-License-Identifier: AGPL-3.0-only
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-17 13:49:48 -06:00
										 |  |  | import React, { | 
					
						
							|  |  |  |   useState, | 
					
						
							|  |  |  |   useRef, | 
					
						
							|  |  |  |   useMemo, | 
					
						
							|  |  |  |   useCallback, | 
					
						
							|  |  |  |   useEffect, | 
					
						
							|  |  |  |   CSSProperties, | 
					
						
							|  |  |  | } from 'react'; | 
					
						
							| 
									
										
										
										
											2020-11-16 13:57:58 -06:00
										 |  |  | import classNames from 'classnames'; | 
					
						
							| 
									
										
										
										
											2020-11-13 13:57:55 -06:00
										 |  |  | import { noop } from 'lodash'; | 
					
						
							| 
									
										
										
										
											2020-11-19 13:13:36 -05:00
										 |  |  | import { | 
					
						
							|  |  |  |   GroupCallRemoteParticipantType, | 
					
						
							|  |  |  |   VideoFrameSource, | 
					
						
							|  |  |  | } from '../types/Calling'; | 
					
						
							|  |  |  | import { LocalizerType } from '../types/Util'; | 
					
						
							| 
									
										
										
										
											2020-11-13 13:57:55 -06:00
										 |  |  | import { CallBackgroundBlur } from './CallBackgroundBlur'; | 
					
						
							| 
									
										
										
										
											2020-11-19 13:13:36 -05:00
										 |  |  | import { Avatar, AvatarSize } from './Avatar'; | 
					
						
							| 
									
										
										
										
											2020-12-01 20:30:25 -05:00
										 |  |  | import { ConfirmationModal } from './ConfirmationModal'; | 
					
						
							|  |  |  | import { Intl } from './Intl'; | 
					
						
							| 
									
										
										
										
											2020-11-19 18:31:04 -05:00
										 |  |  | import { ContactName } from './conversation/ContactName'; | 
					
						
							| 
									
										
										
										
											2021-01-08 12:58:28 -06:00
										 |  |  | import { useIntersectionObserver } from '../util/hooks'; | 
					
						
							| 
									
										
										
										
											2021-01-08 11:32:49 -06:00
										 |  |  | import { MAX_FRAME_SIZE } from '../calling/constants'; | 
					
						
							| 
									
										
										
										
											2020-11-17 13:49:48 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-14 12:07:05 -06:00
										 |  |  | type BasePropsType = { | 
					
						
							| 
									
										
										
										
											2021-01-08 11:32:49 -06:00
										 |  |  |   getFrameBuffer: () => ArrayBuffer; | 
					
						
							| 
									
										
										
										
											2020-11-13 13:57:55 -06:00
										 |  |  |   getGroupCallVideoFrameSource: (demuxId: number) => VideoFrameSource; | 
					
						
							| 
									
										
										
										
											2020-11-19 13:13:36 -05:00
										 |  |  |   i18n: LocalizerType; | 
					
						
							|  |  |  |   remoteParticipant: GroupCallRemoteParticipantType; | 
					
						
							| 
									
										
										
										
											2021-01-14 12:07:05 -06:00
										 |  |  | }; | 
					
						
							| 
									
										
										
										
											2020-11-17 13:49:48 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-14 12:07:05 -06:00
										 |  |  | type InPipPropsType = { | 
					
						
							| 
									
										
										
										
											2020-11-17 13:49:48 -06:00
										 |  |  |   isInPip: true; | 
					
						
							| 
									
										
										
										
											2021-01-14 12:07:05 -06:00
										 |  |  | }; | 
					
						
							| 
									
										
										
										
											2020-11-17 13:49:48 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-14 12:07:05 -06:00
										 |  |  | type InOverflowAreaPropsType = { | 
					
						
							| 
									
										
										
										
											2020-11-17 13:49:48 -06:00
										 |  |  |   height: number; | 
					
						
							| 
									
										
										
										
											2020-11-19 13:13:36 -05:00
										 |  |  |   isInPip?: false; | 
					
						
							| 
									
										
										
										
											2021-01-08 12:58:28 -06:00
										 |  |  |   width: number; | 
					
						
							| 
									
										
										
										
											2021-01-14 12:07:05 -06:00
										 |  |  | }; | 
					
						
							| 
									
										
										
										
											2021-01-08 12:58:28 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-14 12:07:05 -06:00
										 |  |  | type InGridPropsType = InOverflowAreaPropsType & { | 
					
						
							| 
									
										
										
										
											2020-11-13 13:57:55 -06:00
										 |  |  |   left: number; | 
					
						
							|  |  |  |   top: number; | 
					
						
							| 
									
										
										
										
											2021-01-14 12:07:05 -06:00
										 |  |  | }; | 
					
						
							| 
									
										
										
										
											2020-11-13 13:57:55 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-08 12:58:28 -06:00
										 |  |  | export type PropsType = BasePropsType & | 
					
						
							|  |  |  |   (InPipPropsType | InOverflowAreaPropsType | InGridPropsType); | 
					
						
							| 
									
										
										
										
											2020-11-17 13:49:48 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-18 13:07:25 -06:00
										 |  |  | export const GroupCallRemoteParticipant: React.FC<PropsType> = React.memo( | 
					
						
							|  |  |  |   props => { | 
					
						
							| 
									
										
										
										
											2021-01-08 11:32:49 -06:00
										 |  |  |     const { getFrameBuffer, getGroupCallVideoFrameSource, i18n } = props; | 
					
						
							| 
									
										
										
										
											2020-11-19 13:13:36 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-18 13:07:25 -06:00
										 |  |  |     const { | 
					
						
							| 
									
										
										
										
											2020-11-19 13:13:36 -05:00
										 |  |  |       avatarPath, | 
					
						
							|  |  |  |       color, | 
					
						
							| 
									
										
										
										
											2020-11-18 13:07:25 -06:00
										 |  |  |       demuxId, | 
					
						
							|  |  |  |       hasRemoteAudio, | 
					
						
							|  |  |  |       hasRemoteVideo, | 
					
						
							| 
									
										
										
										
											2020-12-01 20:30:25 -05:00
										 |  |  |       isBlocked, | 
					
						
							|  |  |  |       profileName, | 
					
						
							|  |  |  |       title, | 
					
						
							| 
									
										
										
										
											2021-01-08 12:58:28 -06:00
										 |  |  |       videoAspectRatio, | 
					
						
							| 
									
										
										
										
											2020-11-19 13:13:36 -05:00
										 |  |  |     } = props.remoteParticipant; | 
					
						
							| 
									
										
										
										
											2020-11-18 13:07:25 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-08 12:58:28 -06:00
										 |  |  |     const [isWide, setIsWide] = useState<boolean>( | 
					
						
							|  |  |  |       videoAspectRatio ? videoAspectRatio >= 1 : true | 
					
						
							|  |  |  |     ); | 
					
						
							| 
									
										
										
										
											2020-11-19 18:31:04 -05:00
										 |  |  |     const [hasHover, setHover] = useState(false); | 
					
						
							| 
									
										
										
										
											2020-12-01 20:30:25 -05:00
										 |  |  |     const [showBlockInfo, setShowBlockInfo] = useState(false); | 
					
						
							| 
									
										
										
										
											2020-11-18 13:07:25 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  |     const remoteVideoRef = useRef<HTMLCanvasElement | null>(null); | 
					
						
							|  |  |  |     const canvasContextRef = useRef<CanvasRenderingContext2D | null>(null); | 
					
						
							| 
									
										
										
										
											2020-11-13 13:57:55 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-08 12:58:28 -06:00
										 |  |  |     const [ | 
					
						
							|  |  |  |       intersectionRef, | 
					
						
							|  |  |  |       intersectionObserverEntry, | 
					
						
							|  |  |  |     ] = useIntersectionObserver(); | 
					
						
							|  |  |  |     const isVisible = intersectionObserverEntry | 
					
						
							|  |  |  |       ? intersectionObserverEntry.isIntersecting | 
					
						
							|  |  |  |       : true; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-18 13:07:25 -06:00
										 |  |  |     const videoFrameSource = useMemo( | 
					
						
							|  |  |  |       () => getGroupCallVideoFrameSource(demuxId), | 
					
						
							|  |  |  |       [getGroupCallVideoFrameSource, demuxId] | 
					
						
							| 
									
										
										
										
											2020-11-17 13:49:48 -06:00
										 |  |  |     ); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-18 13:07:25 -06:00
										 |  |  |     const renderVideoFrame = useCallback(() => { | 
					
						
							|  |  |  |       const canvasEl = remoteVideoRef.current; | 
					
						
							|  |  |  |       if (!canvasEl) { | 
					
						
							|  |  |  |         return; | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       const canvasContext = canvasContextRef.current; | 
					
						
							|  |  |  |       if (!canvasContext) { | 
					
						
							|  |  |  |         return; | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-08 11:32:49 -06:00
										 |  |  |       // This frame buffer is shared by all participants, so it may contain pixel data
 | 
					
						
							|  |  |  |       //   for other participants, or pixel data from a previous frame. That's why we
 | 
					
						
							|  |  |  |       //   return early and use the `frameWidth` and `frameHeight`.
 | 
					
						
							|  |  |  |       const frameBuffer = getFrameBuffer(); | 
					
						
							|  |  |  |       const frameDimensions = videoFrameSource.receiveVideoFrame(frameBuffer); | 
					
						
							| 
									
										
										
										
											2020-11-18 13:07:25 -06:00
										 |  |  |       if (!frameDimensions) { | 
					
						
							|  |  |  |         return; | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2020-11-17 13:49:48 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-18 13:07:25 -06:00
										 |  |  |       const [frameWidth, frameHeight] = frameDimensions; | 
					
						
							| 
									
										
										
										
											2021-01-08 11:32:49 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  |       if ( | 
					
						
							|  |  |  |         frameWidth < 2 || | 
					
						
							|  |  |  |         frameHeight < 2 || | 
					
						
							|  |  |  |         frameWidth * frameHeight > MAX_FRAME_SIZE | 
					
						
							|  |  |  |       ) { | 
					
						
							| 
									
										
										
										
											2020-11-18 13:07:25 -06:00
										 |  |  |         return; | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       canvasEl.width = frameWidth; | 
					
						
							|  |  |  |       canvasEl.height = frameHeight; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       canvasContext.putImageData( | 
					
						
							|  |  |  |         new ImageData( | 
					
						
							| 
									
										
										
										
											2021-01-08 11:32:49 -06:00
										 |  |  |           new Uint8ClampedArray(frameBuffer, 0, frameWidth * frameHeight * 4), | 
					
						
							| 
									
										
										
										
											2020-11-18 13:07:25 -06:00
										 |  |  |           frameWidth, | 
					
						
							|  |  |  |           frameHeight | 
					
						
							| 
									
										
										
										
											2020-11-17 13:49:48 -06:00
										 |  |  |         ), | 
					
						
							| 
									
										
										
										
											2020-11-18 13:07:25 -06:00
										 |  |  |         0, | 
					
						
							|  |  |  |         0 | 
					
						
							|  |  |  |       ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       setIsWide(frameWidth > frameHeight); | 
					
						
							| 
									
										
										
										
											2021-01-08 11:32:49 -06:00
										 |  |  |     }, [getFrameBuffer, videoFrameSource]); | 
					
						
							| 
									
										
										
										
											2020-11-18 13:07:25 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  |     useEffect(() => { | 
					
						
							| 
									
										
										
										
											2021-01-08 12:58:28 -06:00
										 |  |  |       if (!hasRemoteVideo || !isVisible) { | 
					
						
							| 
									
										
										
										
											2020-11-18 13:07:25 -06:00
										 |  |  |         return noop; | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       let rafId = requestAnimationFrame(tick); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       function tick() { | 
					
						
							|  |  |  |         renderVideoFrame(); | 
					
						
							|  |  |  |         rafId = requestAnimationFrame(tick); | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       return () => { | 
					
						
							|  |  |  |         cancelAnimationFrame(rafId); | 
					
						
							|  |  |  |       }; | 
					
						
							| 
									
										
										
										
											2021-01-08 12:58:28 -06:00
										 |  |  |     }, [hasRemoteVideo, isVisible, renderVideoFrame, videoFrameSource]); | 
					
						
							| 
									
										
										
										
											2020-11-18 13:07:25 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  |     let canvasStyles: CSSProperties; | 
					
						
							|  |  |  |     let containerStyles: CSSProperties; | 
					
						
							| 
									
										
										
										
											2020-11-17 13:49:48 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // If our `width` and `height` props don't match the canvas's aspect ratio, we want to
 | 
					
						
							|  |  |  |     //   fill the container. This can happen when RingRTC gives us an inaccurate
 | 
					
						
							|  |  |  |     //   `videoAspectRatio`, or if the container is an unexpected size.
 | 
					
						
							| 
									
										
										
										
											2020-11-18 13:07:25 -06:00
										 |  |  |     if (isWide) { | 
					
						
							|  |  |  |       canvasStyles = { width: '100%' }; | 
					
						
							| 
									
										
										
										
											2020-11-13 13:57:55 -06:00
										 |  |  |     } else { | 
					
						
							| 
									
										
										
										
											2020-11-18 13:07:25 -06:00
										 |  |  |       canvasStyles = { height: '100%' }; | 
					
						
							| 
									
										
										
										
											2020-11-17 13:49:48 -06:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-19 13:13:36 -05:00
										 |  |  |     let avatarSize: number; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-18 13:07:25 -06:00
										 |  |  |     // TypeScript isn't smart enough to know that `isInPip` by itself disambiguates the
 | 
					
						
							|  |  |  |     //   types, so we have to use `props.isInPip` instead.
 | 
					
						
							|  |  |  |     // eslint-disable-next-line react/destructuring-assignment
 | 
					
						
							|  |  |  |     if (props.isInPip) { | 
					
						
							|  |  |  |       containerStyles = canvasStyles; | 
					
						
							| 
									
										
										
										
											2020-11-19 13:13:36 -05:00
										 |  |  |       avatarSize = AvatarSize.FIFTY_TWO; | 
					
						
							| 
									
										
										
										
											2020-11-18 13:07:25 -06:00
										 |  |  |     } else { | 
					
						
							| 
									
										
										
										
											2021-01-08 12:58:28 -06:00
										 |  |  |       const { width, height } = props; | 
					
						
							| 
									
										
										
										
											2020-11-19 13:13:36 -05:00
										 |  |  |       const shorterDimension = Math.min(width, height); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       if (shorterDimension >= 240) { | 
					
						
							|  |  |  |         avatarSize = AvatarSize.ONE_HUNDRED_TWELVE; | 
					
						
							|  |  |  |       } else if (shorterDimension >= 180) { | 
					
						
							|  |  |  |         avatarSize = AvatarSize.EIGHTY; | 
					
						
							|  |  |  |       } else { | 
					
						
							|  |  |  |         avatarSize = AvatarSize.FIFTY_TWO; | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2020-11-18 13:07:25 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  |       containerStyles = { | 
					
						
							|  |  |  |         height, | 
					
						
							|  |  |  |         width, | 
					
						
							|  |  |  |       }; | 
					
						
							| 
									
										
										
										
											2021-01-08 12:58:28 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  |       if ('top' in props) { | 
					
						
							|  |  |  |         containerStyles.position = 'absolute'; | 
					
						
							|  |  |  |         containerStyles.top = props.top; | 
					
						
							|  |  |  |         containerStyles.left = props.left; | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2020-11-13 13:57:55 -06:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2020-11-17 13:49:48 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-20 15:24:55 -05:00
										 |  |  |     const showHover = hasHover && !props.isInPip; | 
					
						
							| 
									
										
										
										
											2021-01-08 12:58:28 -06:00
										 |  |  |     const canShowVideo = hasRemoteVideo && !isBlocked && isVisible; | 
					
						
							| 
									
										
										
										
											2020-12-01 20:30:25 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-18 13:07:25 -06:00
										 |  |  |     return ( | 
					
						
							| 
									
										
										
										
											2021-01-06 11:22:48 -06:00
										 |  |  |       <> | 
					
						
							|  |  |  |         {showBlockInfo && ( | 
					
						
							|  |  |  |           <ConfirmationModal | 
					
						
							|  |  |  |             i18n={i18n} | 
					
						
							|  |  |  |             onClose={() => { | 
					
						
							|  |  |  |               setShowBlockInfo(false); | 
					
						
							|  |  |  |             }} | 
					
						
							|  |  |  |             title={ | 
					
						
							|  |  |  |               <div className="module-ongoing-call__group-call-remote-participant__blocked--modal-title"> | 
					
						
							|  |  |  |                 <Intl | 
					
						
							|  |  |  |                   i18n={i18n} | 
					
						
							|  |  |  |                   id="calling__you-have-blocked" | 
					
						
							|  |  |  |                   components={[ | 
					
						
							|  |  |  |                     <ContactName | 
					
						
							|  |  |  |                       key="name" | 
					
						
							|  |  |  |                       profileName={profileName} | 
					
						
							|  |  |  |                       title={title} | 
					
						
							|  |  |  |                       i18n={i18n} | 
					
						
							|  |  |  |                     />, | 
					
						
							|  |  |  |                   ]} | 
					
						
							|  |  |  |                 /> | 
					
						
							|  |  |  |               </div> | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |             actions={[ | 
					
						
							| 
									
										
										
										
											2020-11-19 18:31:04 -05:00
										 |  |  |               { | 
					
						
							| 
									
										
										
										
											2021-01-06 11:22:48 -06:00
										 |  |  |                 text: i18n('ok'), | 
					
						
							|  |  |  |                 action: () => { | 
					
						
							|  |  |  |                   setShowBlockInfo(false); | 
					
						
							|  |  |  |                 }, | 
					
						
							|  |  |  |                 style: 'affirmative', | 
					
						
							|  |  |  |               }, | 
					
						
							|  |  |  |             ]} | 
					
						
							| 
									
										
										
										
											2020-11-19 18:31:04 -05:00
										 |  |  |           > | 
					
						
							| 
									
										
										
										
											2021-01-06 11:22:48 -06:00
										 |  |  |             {i18n('calling__block-info')} | 
					
						
							|  |  |  |           </ConfirmationModal> | 
					
						
							| 
									
										
										
										
											2020-11-19 18:31:04 -05:00
										 |  |  |         )} | 
					
						
							| 
									
										
										
										
											2021-01-06 11:22:48 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  |         <div | 
					
						
							|  |  |  |           className="module-ongoing-call__group-call-remote-participant" | 
					
						
							| 
									
										
										
										
											2021-01-08 12:58:28 -06:00
										 |  |  |           ref={intersectionRef} | 
					
						
							| 
									
										
										
										
											2021-01-06 11:22:48 -06:00
										 |  |  |           onMouseEnter={() => setHover(true)} | 
					
						
							|  |  |  |           onMouseLeave={() => setHover(false)} | 
					
						
							|  |  |  |           style={containerStyles} | 
					
						
							|  |  |  |         > | 
					
						
							|  |  |  |           {showHover && ( | 
					
						
							|  |  |  |             <div | 
					
						
							|  |  |  |               className={classNames( | 
					
						
							|  |  |  |                 'module-ongoing-call__group-call-remote-participant--title', | 
					
						
							|  |  |  |                 { | 
					
						
							|  |  |  |                   'module-ongoing-call__group-call-remote-participant--audio-muted': !hasRemoteAudio, | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |               )} | 
					
						
							|  |  |  |             > | 
					
						
							|  |  |  |               <ContactName | 
					
						
							|  |  |  |                 module="module-ongoing-call__group-call-remote-participant--contact-name" | 
					
						
							| 
									
										
										
										
											2020-12-01 20:30:25 -05:00
										 |  |  |                 profileName={profileName} | 
					
						
							|  |  |  |                 title={title} | 
					
						
							| 
									
										
										
										
											2021-01-06 11:22:48 -06:00
										 |  |  |                 i18n={i18n} | 
					
						
							| 
									
										
										
										
											2020-12-01 20:30:25 -05:00
										 |  |  |               /> | 
					
						
							| 
									
										
										
										
											2021-01-06 11:22:48 -06:00
										 |  |  |             </div> | 
					
						
							|  |  |  |           )} | 
					
						
							|  |  |  |           {canShowVideo ? ( | 
					
						
							|  |  |  |             <canvas | 
					
						
							|  |  |  |               className="module-ongoing-call__group-call-remote-participant__remote-video" | 
					
						
							|  |  |  |               style={canvasStyles} | 
					
						
							|  |  |  |               ref={canvasEl => { | 
					
						
							|  |  |  |                 remoteVideoRef.current = canvasEl; | 
					
						
							|  |  |  |                 if (canvasEl) { | 
					
						
							|  |  |  |                   canvasContextRef.current = canvasEl.getContext('2d', { | 
					
						
							|  |  |  |                     alpha: false, | 
					
						
							|  |  |  |                     desynchronized: true, | 
					
						
							|  |  |  |                     storage: 'discardable', | 
					
						
							|  |  |  |                   } as CanvasRenderingContext2DSettings); | 
					
						
							|  |  |  |                 } else { | 
					
						
							|  |  |  |                   canvasContextRef.current = null; | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |               }} | 
					
						
							|  |  |  |             /> | 
					
						
							|  |  |  |           ) : ( | 
					
						
							|  |  |  |             <CallBackgroundBlur avatarPath={avatarPath} color={color}> | 
					
						
							|  |  |  |               {isBlocked ? ( | 
					
						
							|  |  |  |                 <> | 
					
						
							|  |  |  |                   <i className="module-ongoing-call__group-call-remote-participant__blocked" /> | 
					
						
							|  |  |  |                   <button | 
					
						
							|  |  |  |                     type="button" | 
					
						
							|  |  |  |                     className="module-ongoing-call__group-call-remote-participant__blocked--info" | 
					
						
							|  |  |  |                     onClick={() => { | 
					
						
							|  |  |  |                       setShowBlockInfo(true); | 
					
						
							|  |  |  |                     }} | 
					
						
							|  |  |  |                   > | 
					
						
							|  |  |  |                     {i18n('moreInfo')} | 
					
						
							|  |  |  |                   </button> | 
					
						
							|  |  |  |                 </> | 
					
						
							|  |  |  |               ) : ( | 
					
						
							|  |  |  |                 <Avatar | 
					
						
							|  |  |  |                   avatarPath={avatarPath} | 
					
						
							|  |  |  |                   color={color || 'ultramarine'} | 
					
						
							|  |  |  |                   noteToSelf={false} | 
					
						
							|  |  |  |                   conversationType="direct" | 
					
						
							|  |  |  |                   i18n={i18n} | 
					
						
							|  |  |  |                   profileName={profileName} | 
					
						
							|  |  |  |                   title={title} | 
					
						
							|  |  |  |                   size={avatarSize} | 
					
						
							|  |  |  |                 /> | 
					
						
							|  |  |  |               )} | 
					
						
							|  |  |  |             </CallBackgroundBlur> | 
					
						
							|  |  |  |           )} | 
					
						
							|  |  |  |         </div> | 
					
						
							|  |  |  |       </> | 
					
						
							| 
									
										
										
										
											2020-11-18 13:07:25 -06:00
										 |  |  |     ); | 
					
						
							| 
									
										
										
										
											2020-11-13 13:57:55 -06:00
										 |  |  |   } | 
					
						
							| 
									
										
										
										
											2020-11-18 13:07:25 -06:00
										 |  |  | ); |