♻️(frontend) disable participant's tile metadata
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.
This commit is contained in:
committed by
aleb_the_flash
parent
dd9a87a33b
commit
a55a4d5b5d
@@ -44,19 +44,24 @@ export function TrackRefContextIfNeeded(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface ParticipantTileExtendedProps extends ParticipantTileProps {
|
||||||
|
disableMetadata?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
export const ParticipantTile: (
|
export const ParticipantTile: (
|
||||||
props: ParticipantTileProps & React.RefAttributes<HTMLDivElement>
|
props: ParticipantTileExtendedProps & React.RefAttributes<HTMLDivElement>
|
||||||
) => React.ReactNode = /* @__PURE__ */ React.forwardRef<
|
) => React.ReactNode = /* @__PURE__ */ React.forwardRef<
|
||||||
HTMLDivElement,
|
HTMLDivElement,
|
||||||
ParticipantTileProps
|
ParticipantTileExtendedProps
|
||||||
>(function ParticipantTile(
|
>(function ParticipantTile(
|
||||||
{
|
{
|
||||||
trackRef,
|
trackRef,
|
||||||
children,
|
children,
|
||||||
onParticipantClick,
|
onParticipantClick,
|
||||||
disableSpeakingIndicator,
|
disableSpeakingIndicator,
|
||||||
|
disableMetadata,
|
||||||
...htmlProps
|
...htmlProps
|
||||||
}: ParticipantTileProps,
|
}: ParticipantTileExtendedProps,
|
||||||
ref
|
ref
|
||||||
) {
|
) {
|
||||||
const trackReference = useEnsureTrackRef(trackRef)
|
const trackReference = useEnsureTrackRef(trackRef)
|
||||||
@@ -119,9 +124,12 @@ export const ParticipantTile: (
|
|||||||
participant={trackReference.participant}
|
participant={trackReference.participant}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
{!disableMetadata && (
|
||||||
<div className="lk-participant-metadata">
|
<div className="lk-participant-metadata">
|
||||||
<HStack gap={0.25}>
|
<HStack gap={0.25}>
|
||||||
<MutedMicIndicator participant={trackReference.participant} />
|
<MutedMicIndicator
|
||||||
|
participant={trackReference.participant}
|
||||||
|
/>
|
||||||
<div
|
<div
|
||||||
className="lk-participant-metadata-item"
|
className="lk-participant-metadata-item"
|
||||||
style={{
|
style={{
|
||||||
@@ -146,7 +154,9 @@ export const ParticipantTile: (
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{isEncrypted && (
|
{isEncrypted && (
|
||||||
<LockLockedIcon style={{ marginRight: '0.25rem' }} />
|
<LockLockedIcon
|
||||||
|
style={{ marginRight: '0.25rem' }}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
<ParticipantName />
|
<ParticipantName />
|
||||||
</>
|
</>
|
||||||
@@ -160,9 +170,10 @@ export const ParticipantTile: (
|
|||||||
</HStack>
|
</HStack>
|
||||||
<ConnectionQualityIndicator className="lk-participant-metadata-item" />
|
<ConnectionQualityIndicator className="lk-participant-metadata-item" />
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
<FocusToggle trackRef={trackReference} />
|
{!disableMetadata && <FocusToggle trackRef={trackReference} />}
|
||||||
</ParticipantContextIfNeeded>
|
</ParticipantContextIfNeeded>
|
||||||
</TrackRefContextIfNeeded>
|
</TrackRefContextIfNeeded>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user