From 1d8c7a368ea14a70dd32553129f67eb6cdb3e0db Mon Sep 17 00:00:00 2001 From: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com> Date: Tue, 8 Dec 2020 16:28:44 -0600 Subject: [PATCH] When joining an empty group call, the button should say "Start Call" --- ts/components/CallingLobby.stories.tsx | 10 +++++ ts/components/CallingLobby.tsx | 61 +++++++++++--------------- 2 files changed, 35 insertions(+), 36 deletions(-) diff --git a/ts/components/CallingLobby.stories.tsx b/ts/components/CallingLobby.stories.tsx index 012d156f2..65b071d31 100644 --- a/ts/components/CallingLobby.stories.tsx +++ b/ts/components/CallingLobby.stories.tsx @@ -34,6 +34,7 @@ const createProps = (overrideProps: Partial = {}): PropsType => ({ hasLocalVideo: boolean('hasLocalVideo', overrideProps.hasLocalVideo || false), i18n, isGroupCall: boolean('isGroupCall', overrideProps.isGroupCall || false), + isCallFull: boolean('isCallFull', overrideProps.isCallFull || false), me: overrideProps.me || { color: 'ultramarine' as ColorType, uuid: generateUuid(), @@ -147,3 +148,12 @@ story.add('Group Call - 4 peeked participants (participants list)', () => { }); return ; }); + +story.add('Group Call - call full', () => { + const props = createProps({ + isGroupCall: true, + isCallFull: true, + peekedParticipants: ['Sam', 'Cayce'].map(fakePeekedParticipant), + }); + return ; +}); diff --git a/ts/components/CallingLobby.tsx b/ts/components/CallingLobby.tsx index 24f86bac7..a25ae432b 100644 --- a/ts/components/CallingLobby.tsx +++ b/ts/components/CallingLobby.tsx @@ -1,7 +1,7 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import React from 'react'; +import React, { ReactNode } from 'react'; import { SetLocalAudioType, SetLocalPreviewType, @@ -126,43 +126,17 @@ export const CallingLobby = ({ : participant.firstName || participant.title ); - let joinButton: JSX.Element; + const canJoin = !isCallFull && !isCallConnecting; + + let joinButtonChildren: ReactNode; if (isCallFull) { - joinButton = ( - - ); + joinButtonChildren = i18n('calling__call-is-full'); } else if (isCallConnecting) { - joinButton = ( - - ); + joinButtonChildren = ; + } else if (peekedParticipants.length) { + joinButtonChildren = i18n('calling__join'); } else { - joinButton = ( - - ); + joinButtonChildren = i18n('calling__start'); } return ( @@ -244,7 +218,22 @@ export const CallingLobby = ({ > {i18n('cancel')} - {joinButton} + );