From 62855fe12c62f56cf7791f0341b503847046d9b4 Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Fri, 27 Sep 2024 15:10:18 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(frontend)=20introduce=20active=20spea?= =?UTF-8?q?ker=20pushToTalk=20variant?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Will be used to indicate when the push to talk is open. It gives the user a feedback wether or not her mic is active. --- .../rooms/components/ActiveSpeaker.tsx | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/features/rooms/components/ActiveSpeaker.tsx b/src/frontend/src/features/rooms/components/ActiveSpeaker.tsx index 95f3307d..db2d7baf 100644 --- a/src/frontend/src/features/rooms/components/ActiveSpeaker.tsx +++ b/src/frontend/src/features/rooms/components/ActiveSpeaker.tsx @@ -12,6 +12,19 @@ const StyledContainer = styled('div', { justifyContent: 'center', gap: '2px', }, + variants: { + pushToTalk: { + true: { + height: '46px', + width: '58px', + borderLeftRadius: 8, + borderRightRadius: 0, + backgroundColor: '#dbeafe', + border: '1px solid #3b82f6', + gap: '3px', + }, + }, + }, }) const StyledChild = styled('div', { @@ -39,13 +52,29 @@ const StyledChild = styled('div', { animationName: 'active_speaker_small', }, }, + pushToTalk: { + true: { + backgroundColor: 'primary', + width: '6px', + height: '6px', + }, + }, }, }) -export const ActiveSpeaker = ({ isSpeaking }: { isSpeaking: boolean }) => { +export type ActiveSpeakerProps = { + isSpeaking: boolean + pushToTalk?: boolean +} + +export const ActiveSpeaker = ({ + isSpeaking, + pushToTalk, +}: ActiveSpeakerProps) => { return ( - + { }} />