From 6d216a3eca47df246afa5f5f1c7d16bf8d7ba9c6 Mon Sep 17 00:00:00 2001 From: ayumi-signal <143036029+ayumi-signal@users.noreply.github.com> Date: Wed, 1 Nov 2023 10:56:38 -0700 Subject: [PATCH] Calling: Add local video/mute to local preview; button order --- stylesheets/_modules.scss | 19 +++------- .../components/CallingAudioIndicator.scss | 20 ++++++++-- .../components/CallingStatusIndicator.scss | 37 +++++++++++++++++++ stylesheets/manifest.scss | 1 + ts/components/CallScreen.tsx | 30 +++++++-------- ts/components/CallingHeader.tsx | 36 +++++++++--------- ts/components/GroupCallRemoteParticipant.tsx | 22 ++++++----- 7 files changed, 106 insertions(+), 59 deletions(-) create mode 100644 stylesheets/components/CallingStatusIndicator.scss diff --git a/stylesheets/_modules.scss b/stylesheets/_modules.scss index 1be29653d199..a960c21ee22c 100644 --- a/stylesheets/_modules.scss +++ b/stylesheets/_modules.scss @@ -3939,27 +3939,27 @@ button.module-image__border-overlay:focus { } &__info { - @include font-caption; align-items: flex-end; bottom: 0; display: flex; - height: 48px; - justify-content: space-between; - padding: 6px; position: absolute; + height: 60px; + justify-content: space-between; + padding-block: 0 16px; + padding-inline: 16px; user-select: none; width: 100%; z-index: $z-index-above-base; &__contact-name { - font-size: 12px; + font-size: 13px; + line-height: 18px; color: $color-white; margin-inline-end: 20px; overflow: hidden; text-overflow: ellipsis; visibility: hidden; white-space: nowrap; - margin-bottom: 2px; } } @@ -4047,13 +4047,6 @@ button.module-image__border-overlay:focus { transform: inherit; } } - - .CallingAudioIndicator { - bottom: 6px; - position: absolute; - inset-inline-end: 6px; - z-index: $z-index-base; - } } } diff --git a/stylesheets/components/CallingAudioIndicator.scss b/stylesheets/components/CallingAudioIndicator.scss index 04259e8e0d17..b7a5c0d3d2b2 100644 --- a/stylesheets/components/CallingAudioIndicator.scss +++ b/stylesheets/components/CallingAudioIndicator.scss @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only .CallingAudioIndicator { - $size: 20px; + $size: 28px; display: flex; align-items: center; @@ -14,11 +14,11 @@ border-radius: calc($size / 2); &--with-content { - background: $color-black-alpha-30; + background: rgba($color-gray-80, 0.7); } &__content { - $size: 14px; + $size: 16px; width: $size; height: $size; /* Center Lottie animation */ @@ -34,3 +34,17 @@ } } } + +.module-ongoing-call__footer__local-preview .CallingAudioIndicator { + position: absolute; + top: 6px; + inset-inline-end: 6px; + z-index: $z-index-base; +} + +.module-ongoing-call__group-call-remote-participant .CallingAudioIndicator { + position: absolute; + top: 8px; + inset-inline-end: 8px; + z-index: $z-index-base; +} diff --git a/stylesheets/components/CallingStatusIndicator.scss b/stylesheets/components/CallingStatusIndicator.scss new file mode 100644 index 000000000000..8ad67ec76039 --- /dev/null +++ b/stylesheets/components/CallingStatusIndicator.scss @@ -0,0 +1,37 @@ +// Copyright 2023 Signal Messenger, LLC +// SPDX-License-Identifier: AGPL-3.0-only + +.CallingStatusIndicator { + $size: 28px; + + display: flex; + align-items: center; + justify-content: center; + height: $size; + min-width: $size; + width: $size; + z-index: $z-index-base; + border-radius: calc($size / 2); + background: rgba($color-gray-80, 0.7); + + &::after { + content: ''; + $icon-size: 16px; + width: $icon-size; + height: $icon-size; + } +} + +.CallingStatusIndicator--Video::after { + @include color-svg( + '../images/icons/v3/video/video-slash-fill-light.svg', + $color-white + ); +} + +.module-ongoing-call__footer__local-preview .CallingStatusIndicator--Video { + position: absolute; + top: 6px; + inset-inline-start: 6px; + z-index: $z-index-base; +} diff --git a/stylesheets/manifest.scss b/stylesheets/manifest.scss index 077581a16659..46ff009710af 100644 --- a/stylesheets/manifest.scss +++ b/stylesheets/manifest.scss @@ -37,6 +37,7 @@ @import './components/Button.scss'; @import './components/CallsTab.scss'; @import './components/CallingAudioIndicator.scss'; +@import './components/CallingStatusIndicator.scss'; @import './components/CallingButton.scss'; @import './components/CallControls.scss'; @import './components/CallSettingsButton.scss'; diff --git a/ts/components/CallScreen.tsx b/ts/components/CallScreen.tsx index 12c91750f930..f1de9efd4072 100644 --- a/ts/components/CallScreen.tsx +++ b/ts/components/CallScreen.tsx @@ -581,21 +581,21 @@ export function CallScreen({ -
- {localPreviewNode} - -
+ {localPreviewNode ? ( +
+ {localPreviewNode} + {!isSendingVideo && ( +
+ )} + +
+ ) : ( +
+ )}
); diff --git a/ts/components/CallingHeader.tsx b/ts/components/CallingHeader.tsx index 14b05acc04a8..0d0100fbb2fd 100644 --- a/ts/components/CallingHeader.tsx +++ b/ts/components/CallingHeader.tsx @@ -42,24 +42,6 @@ export function CallingHeader({
{message}
) : null}
- {togglePip && ( -
- - - -
- )} {isGroupCall && participantCount > 2 && toggleSpeakerView && (
+ {togglePip && ( +
+ + + +
+ )} {onCancel && (
= React.memo( style={containerStyles} > {!props.isInPip && ( -
- + <> -
+
+ +
+ )} {wantsToShowVideo && (