signal-desktop/ts/components/CallingAudioIndicator.tsx
Evan Hahn 5ce26eb91a
Speaking indicator for group calls
Co-authored-by: Peter Thatcher <peter@signal.org>
Co-authored-by: Jim Gustafson <jim@signal.org>
Co-authored-by: Josh Perez <60019601+josh-signal@users.noreply.github.com>
2022-02-08 12:30:33 -06:00

30 lines
803 B
TypeScript

// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { ReactElement } from 'react';
import React from 'react';
import animationData from '../../images/lottie-animations/CallingSpeakingIndicator.json';
import { Lottie } from './Lottie';
export function CallingAudioIndicator({
hasRemoteAudio,
isSpeaking,
}: Readonly<{
hasRemoteAudio: boolean;
isSpeaking: boolean;
}>): ReactElement {
if (!hasRemoteAudio) {
return (
<div className="CallingAudioIndicator CallingAudioIndicator--muted" />
);
}
if (isSpeaking) {
return (
<Lottie animationData={animationData} className="CallingAudioIndicator" />
);
}
// Render an empty spacer so that names don't move around.
return <div className="CallingAudioIndicator" />;
}