Call Controls: Enhance width for viewport sizes

This commit is contained in:
ayumi-signal 2023-11-02 13:28:03 -07:00 committed by GitHub
parent 3ef0d221d1
commit 62cdc613b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 65 additions and 61 deletions

View file

@ -3708,7 +3708,7 @@ button.module-image__border-overlay:focus {
} }
.module-ongoing-call { .module-ongoing-call {
$local-preview-width: 107px; $local-preview-width: 108px;
$local-preview-height: 80px; $local-preview-height: 80px;
&__remote-video-enabled { &__remote-video-enabled {
@ -4013,18 +4013,10 @@ button.module-image__border-overlay:focus {
justify-content: center; justify-content: center;
} }
// This layout-only element is not ideal, but lets us keep the actions centered until
// until they'd overlap with the video, at which point they start to move.
&__local-preview-offset {
flex: 1 0;
max-width: $local-preview-width;
margin-inline-start: 16px;
visibility: hidden;
}
&__local-preview { &__local-preview {
border-radius: 10px; border-radius: 10px;
display: flex; display: flex;
flex-shrink: 0;
height: $local-preview-height; height: $local-preview-height;
margin-block-end: 16px; margin-block-end: 16px;
margin-inline: 0 16px; margin-inline: 0 16px;

View file

@ -5,17 +5,18 @@
position: relative; position: relative;
bottom: 0; bottom: 0;
display: flex; display: flex;
flex-grow: 0; flex-grow: 1;
flex-shrink: 0; flex-shrink: 0;
flex-basis: 440px;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
width: 480px; max-width: 600px;
min-width: 480px;
height: 80px; height: 80px;
background-color: $color-gray-78; background-color: $color-gray-78;
box-shadow: 0px 4px 14px 0px $color-black-alpha-40; box-shadow: 0px 4px 14px 0px $color-black-alpha-40;
border-radius: 18px; border-radius: 18px;
margin-block-end: 16px; margin-block-end: 16px;
margin-inline: 16px;
padding-block: 22px; padding-block: 22px;
padding-inline: 24px; padding-inline: 24px;
text-align: center; text-align: center;
@ -31,6 +32,7 @@
.CallControls__CallTitle { .CallControls__CallTitle {
display: flex; display: flex;
max-height: 40px; max-height: 40px;
margin-block-end: 2px;
color: $color-gray-15; color: $color-gray-15;
font-size: 14px; font-size: 14px;
font-weight: bold; font-weight: bold;
@ -107,3 +109,9 @@
.CallControls__JoinLeaveButton .module-spinner__container { .CallControls__JoinLeaveButton .module-spinner__container {
margin-block: -5px; margin-block: -5px;
} }
.CallControls__OuterSpacer {
// Defined in _modules but duplicated here for ease of refactor
$local-preview-width: 108px;
flex-basis: calc($local-preview-width + 16px);
}

View file

@ -35,6 +35,8 @@
} }
} }
.module-CallingLobby__CallControls-spacer { .CallingLobby__Footer {
flex-basis: 70px; display: flex;
width: 100%;
justify-content: center;
} }

View file

@ -518,9 +518,7 @@ export function CallScreen({
{remoteParticipantsElement} {remoteParticipantsElement}
{lonelyInCallNode} {lonelyInCallNode}
<div className="module-ongoing-call__footer"> <div className="module-ongoing-call__footer">
{/* This layout-only element is not ideal. <div className="module-calling__spacer CallControls__OuterSpacer" />
See the comment in _modules.css for more. */}
<div className="module-ongoing-call__footer__local-preview-offset" />
<div <div
className={classNames( className={classNames(
'CallControls', 'CallControls',

View file

@ -277,11 +277,13 @@ export function CallingLobby({
{i18n('icu:calling__your-video-is-off')} {i18n('icu:calling__your-video-is-off')}
</div> </div>
<div className="module-calling__spacer module-CallingLobby__CallControls-spacer" /> <div className="CallingLobby__Footer">
<div className="module-calling__spacer CallControls__OuterSpacer" />
<div className="CallControls"> <div className="CallControls">
<div className="CallControls__InfoDisplay"> <div className="CallControls__InfoDisplay">
<div className="CallControls__CallTitle">{conversation.title}</div> <div className="CallControls__CallTitle">
{conversation.title}
</div>
<div className="CallControls__Status">{callStatus}</div> <div className="CallControls__Status">{callStatus}</div>
</div> </div>
<CallingButtonToastsContainer <CallingButtonToastsContainer
@ -322,6 +324,8 @@ export function CallingLobby({
/> />
</div> </div>
</div> </div>
<div className="module-calling__spacer CallControls__OuterSpacer" />
</div>
</div> </div>
</FocusTrap> </FocusTrap>
); );