From a55a4d5b5d31b0e6bbf2b3e5f098a29ed0c7561c Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Mon, 9 Sep 2024 22:21:05 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F(frontend)=20disable=20partic?= =?UTF-8?q?ipant's=20tile=20metadata?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Inspired by the props disableSpeakingIndicator, used the same logic for all metadata displayed on hover on a participant's tile. Why? I'll need to render the joining participant tile without any metadata, so the participant see who is joining the room. --- .../livekit/components/ParticipantTile.tsx | 101 ++++++++++-------- 1 file changed, 56 insertions(+), 45 deletions(-) diff --git a/src/frontend/src/features/rooms/livekit/components/ParticipantTile.tsx b/src/frontend/src/features/rooms/livekit/components/ParticipantTile.tsx index 1c9f9b77..076ea42f 100644 --- a/src/frontend/src/features/rooms/livekit/components/ParticipantTile.tsx +++ b/src/frontend/src/features/rooms/livekit/components/ParticipantTile.tsx @@ -44,19 +44,24 @@ export function TrackRefContextIfNeeded( ) } +interface ParticipantTileExtendedProps extends ParticipantTileProps { + disableMetadata?: boolean +} + export const ParticipantTile: ( - props: ParticipantTileProps & React.RefAttributes + props: ParticipantTileExtendedProps & React.RefAttributes ) => React.ReactNode = /* @__PURE__ */ React.forwardRef< HTMLDivElement, - ParticipantTileProps + ParticipantTileExtendedProps >(function ParticipantTile( { trackRef, children, onParticipantClick, disableSpeakingIndicator, + disableMetadata, ...htmlProps - }: ParticipantTileProps, + }: ParticipantTileExtendedProps, ref ) { const trackReference = useEnsureTrackRef(trackRef) @@ -119,50 +124,56 @@ export const ParticipantTile: ( participant={trackReference.participant} /> -
- - -
- {trackReference.source === Track.Source.Camera ? ( - <> - {isHandRaised && ( - - )} - {isEncrypted && ( - - )} - - - ) : ( - <> - - 's screen - - )} -
-
- -
+ {!disableMetadata && ( +
+ + +
+ {trackReference.source === Track.Source.Camera ? ( + <> + {isHandRaised && ( + + )} + {isEncrypted && ( + + )} + + + ) : ( + <> + + 's screen + + )} +
+
+ +
+ )} )} - + {!disableMetadata && }