Add paginated calling grid for group calls
This commit is contained in:
parent
9c3d404c82
commit
cf5b3f78b5
22 changed files with 1237 additions and 476 deletions
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { useEffect } from 'react';
|
||||
import { useEffect, useMemo } from 'react';
|
||||
import type { AciString } from '../types/ServiceId';
|
||||
import { usePrevious } from './usePrevious';
|
||||
|
||||
|
@ -12,6 +12,15 @@ type RemoteParticipant = {
|
|||
aci?: AciString;
|
||||
};
|
||||
|
||||
export function usePresenter(
|
||||
remoteParticipants: ReadonlyArray<RemoteParticipant>
|
||||
): AciString | undefined {
|
||||
return useMemo(
|
||||
() => remoteParticipants.find(participant => participant.presenting)?.aci,
|
||||
[remoteParticipants]
|
||||
);
|
||||
}
|
||||
|
||||
export function useActivateSpeakerViewOnPresenting({
|
||||
remoteParticipants,
|
||||
switchToPresentationView,
|
||||
|
@ -21,9 +30,7 @@ export function useActivateSpeakerViewOnPresenting({
|
|||
switchToPresentationView: () => void;
|
||||
switchFromPresentationView: () => void;
|
||||
}): void {
|
||||
const presenterAci = remoteParticipants.find(
|
||||
participant => participant.presenting
|
||||
)?.aci;
|
||||
const presenterAci = usePresenter(remoteParticipants);
|
||||
const prevPresenterAci = usePrevious(presenterAci, presenterAci);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue