diff --git a/stylesheets/_variables.scss b/stylesheets/_variables.scss index d03aa10fe527..5f2437e9ddcd 100644 --- a/stylesheets/_variables.scss +++ b/stylesheets/_variables.scss @@ -293,3 +293,5 @@ $NavTabs__Item__blockPadding: 2px; $NavTabs__Toggle__blockPadding: 8px; $NavTabs__ItemButton__blockPadding: 10px; $CallControls__height: 80px; +$CallControls__max-width: 600px; +$CallControls__initial-width: 440px; diff --git a/stylesheets/components/CallControls.scss b/stylesheets/components/CallControls.scss index 8eed7b12ad43..750815d9d7c0 100644 --- a/stylesheets/components/CallControls.scss +++ b/stylesheets/components/CallControls.scss @@ -7,10 +7,10 @@ display: flex; flex-grow: 1; flex-shrink: 0; - flex-basis: 440px; + flex-basis: $CallControls__initial-width; align-items: center; justify-content: space-between; - max-width: 600px; + max-width: $CallControls__max-width; height: $CallControls__height; background-color: $color-gray-78; box-shadow: 0px 4px 14px 0px $color-black-alpha-40; diff --git a/stylesheets/components/CallingRaisedHandsList.scss b/stylesheets/components/CallingRaisedHandsList.scss index d978286f0420..f37380e0b695 100644 --- a/stylesheets/components/CallingRaisedHandsList.scss +++ b/stylesheets/components/CallingRaisedHandsList.scss @@ -5,13 +5,20 @@ width: 100%; height: auto; margin-block-end: auto; + overflow: auto; } .CallingRaisedHandsList__width-container { + display: flex; + flex-direction: column; width: 320px; height: auto; - margin-block-end: 72px; + padding-block: 1px; + padding-inline: 1px; + // This should be above .CallingRaisedHandsList__Button + margin-block-end: 168px; margin-inline-start: 8px; + overflow: hidden; } .CallingRaisedHandsList__overlay { @@ -33,7 +40,7 @@ @include button-reset; position: absolute; inset-inline-start: 16px; - inset-block-end: 16px; + inset-block-end: calc($CallControls__height + 32px); display: flex; padding-block: 14px; padding-inline: 12px; diff --git a/stylesheets/components/CallingRaisedHandsToasts.scss b/stylesheets/components/CallingRaisedHandsToasts.scss index 586b30c0cecc..5d92b31ad0f5 100644 --- a/stylesheets/components/CallingRaisedHandsToasts.scss +++ b/stylesheets/components/CallingRaisedHandsToasts.scss @@ -1,14 +1,14 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -.CallingReactionsToast__Content { +.CallingRaisedHandsToast__Content { display: flex; margin-block: 4px; margin-inline: 8px; font-weight: 500; } -.CallingReactionsToast__HandIcon { +.CallingRaisedHandsToast__HandIcon { display: inline-block; $icon-size: 16px; width: $icon-size; diff --git a/stylesheets/components/CallingReactionsToasts.scss b/stylesheets/components/CallingReactionsToasts.scss index 1db31675f91e..8d760e8a8c17 100644 --- a/stylesheets/components/CallingReactionsToasts.scss +++ b/stylesheets/components/CallingReactionsToasts.scss @@ -8,6 +8,12 @@ width: 100%; } +// Reactions appear in the same space as the Raised Hands button. When they are both +// present then move Reactions up. +.CallingRaisedHandsList__Button + .CallingReactionsToasts { + inset-block-end: calc($CallControls__height + 100px); +} + // Normally the newest toasts are appended on top, like this: // | Second | // | First | -> | First | diff --git a/stylesheets/components/CallingToast.scss b/stylesheets/components/CallingToast.scss index 24159f4c0bce..dda4093ecf97 100644 --- a/stylesheets/components/CallingToast.scss +++ b/stylesheets/components/CallingToast.scss @@ -40,9 +40,26 @@ } } +.CallingButtonToasts__outer { + position: absolute; + inset-block-end: calc($CallControls__height + 16px); + width: 100%; + // Match .module-ongoing-call__footer + z-index: $z-index-above-base; +} + +// Match the width behavior of .CallControls +.CallingButtonToasts { + display: flex; + flex-grow: 1; + flex-shrink: 0; + flex-basis: $CallControls__initial-width; + max-width: $CallControls__max-width; +} + .CallingButtonToasts .CallingToasts { position: absolute; - top: -20px; + top: -16px; transform: translateY(-100%); inset-inline-start: 0; } diff --git a/ts/components/CallScreen.stories.tsx b/ts/components/CallScreen.stories.tsx index 384faa4d0cc4..71f81ed5dc8f 100644 --- a/ts/components/CallScreen.stories.tsx +++ b/ts/components/CallScreen.stories.tsx @@ -108,6 +108,18 @@ const getConversationsByDemuxId = (overrideProps: GroupCallOverrideProps) => { return conversationsByDemuxId; }; +const getRaisedHands = (overrideProps: GroupCallOverrideProps) => { + if (!overrideProps.remoteParticipants) { + return; + } + + return new Set( + overrideProps.remoteParticipants + .filter(participant => participant.isHandRaised) + .map(participant => participant.demuxId) + ); +}; + const createActiveGroupCallProp = (overrideProps: GroupCallOverrideProps) => ({ callMode: CallMode.Group as CallMode.Group, connectionState: @@ -124,7 +136,10 @@ const createActiveGroupCallProp = (overrideProps: GroupCallOverrideProps) => ({ isConversationTooBigToRing: false, peekedParticipants: overrideProps.peekedParticipants || overrideProps.remoteParticipants || [], - raisedHands: overrideProps.raisedHands || new Set(), + raisedHands: + overrideProps.raisedHands || + getRaisedHands(overrideProps) || + new Set(), remoteParticipants: overrideProps.remoteParticipants || [], remoteAudioLevels: new Map( overrideProps.remoteParticipants?.map((_participant, index) => [ diff --git a/ts/components/CallScreen.tsx b/ts/components/CallScreen.tsx index 48ec471cee66..4cc91073bd7e 100644 --- a/ts/components/CallScreen.tsx +++ b/ts/components/CallScreen.tsx @@ -567,8 +567,8 @@ export function CallScreen({ }); } return ( -
- +
+ {message} {buttonOverride || (