Basic call link join support

This commit is contained in:
ayumi-signal 2024-02-22 13:19:50 -08:00 committed by GitHub
parent 2bfb6e7481
commit 96b3413feb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
75 changed files with 2438 additions and 509 deletions

View file

@ -3,27 +3,46 @@
import React from 'react';
import type { LocalizerType } from '../types/Util';
import { CallMode } from '../types/Calling';
export type PropsType = {
callMode: CallMode;
i18n: LocalizerType;
isAdhocJoinRequestPending?: boolean;
groupMemberCount?: number;
participantCount: number;
toggleParticipants: () => void;
};
export function CallParticipantCount({
callMode,
i18n,
isAdhocJoinRequestPending,
groupMemberCount,
participantCount,
toggleParticipants,
}: PropsType): JSX.Element {
const isToggleVisible =
Boolean(participantCount) || callMode === CallMode.Adhoc;
const count = participantCount || groupMemberCount || 1;
const innerText = i18n('icu:CallControls__InfoDisplay--participants', {
count: String(count),
});
let innerText: string | undefined;
if (callMode === CallMode.Adhoc) {
if (isAdhocJoinRequestPending) {
innerText = i18n(
'icu:CallControls__InfoDisplay--adhoc-join-request-pending'
);
} else if (!participantCount) {
innerText = i18n('icu:CallControls__InfoDisplay--adhoc-call');
}
}
if (!innerText) {
innerText = i18n('icu:CallControls__InfoDisplay--participants', {
count: String(count),
});
}
// Call not started, can't click to show participants
if (!participantCount) {
if (!isToggleVisible) {
return (
<span
aria-label={i18n('icu:calling__participants', {