Improve group call participants background, padding, margin

This commit is contained in:
ayumi-signal 2024-01-17 12:37:04 -08:00 committed by GitHub
parent 670da5722a
commit a9df5923a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 39 additions and 16 deletions

View file

@ -3818,6 +3818,7 @@ button.module-image__border-overlay:focus {
&__overflow { &__overflow {
flex: 0 0 auto; flex: 0 0 auto;
position: relative; position: relative;
margin-block-start: calc(60px + var(--title-bar-drag-area-height));
margin-inline-end: 16px; margin-inline-end: 16px;
&__inner { &__inner {
@ -3838,6 +3839,11 @@ button.module-image__border-overlay:focus {
& .module-ongoing-call__group-call-remote-participant { & .module-ongoing-call__group-call-remote-participant {
width: 100%; width: 100%;
margin-bottom: 1rem; margin-bottom: 1rem;
&__footer {
padding-block: 0 10px;
padding-inline: 10px;
}
} }
&__scroll-marker { &__scroll-marker {
@ -3892,7 +3898,7 @@ button.module-image__border-overlay:focus {
); );
#{$scroll-marker-selector}__button { #{$scroll-marker-selector}__button {
margin-block-start: 60px; margin-block-start: 16px;
transform: rotate(180deg); transform: rotate(180deg);
} }
} }
@ -3947,6 +3953,8 @@ button.module-image__border-overlay:focus {
} }
&__group-call-remote-participant { &__group-call-remote-participant {
container-type: size;
display: flex; display: flex;
justify-content: center; justify-content: center;
position: relative; position: relative;
@ -3961,6 +3969,16 @@ button.module-image__border-overlay:focus {
transition: none; transition: none;
} }
$group-call-remote-participant-footer-padding-medium: 12px;
$group-call-remote-participant-footer-padding-large: 16px;
@container (min-width: 180px) or (min-height: 180px) {
.module-ongoing-call__group-call-remote-participant__footer {
padding-block: 0 $group-call-remote-participant-footer-padding-large;
padding-inline: $group-call-remote-participant-footer-padding-large;
}
}
&:after { &:after {
content: ''; content: '';
position: absolute; position: absolute;
@ -3992,6 +4010,10 @@ button.module-image__border-overlay:focus {
} }
} }
&-background.module-calling__background--no-avatar {
background-color: $color-gray-78;
}
&__blocked { &__blocked {
@include color-svg('../images/icons/v3/block/block.svg', $color-white); @include color-svg('../images/icons/v3/block/block.svg', $color-white);
height: 24px; height: 24px;
@ -4022,8 +4044,8 @@ button.module-image__border-overlay:focus {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
height: 60px; height: 60px;
padding-block: 0 16px; padding-block: 0 $group-call-remote-participant-footer-padding-medium;
padding-inline: 16px; padding-inline: $group-call-remote-participant-footer-padding-medium;
user-select: none; user-select: none;
width: 100%; width: 100%;
z-index: $z-index-above-base; z-index: $z-index-above-base;
@ -4216,6 +4238,10 @@ button.module-image__border-overlay:focus {
-webkit-user-drag: none; -webkit-user-drag: none;
-webkit-user-select: none; -webkit-user-select: none;
} }
.module-calling__background--no-avatar {
background: transparent;
}
} }
&--local { &--local {

View file

@ -3,28 +3,23 @@
import React from 'react'; import React from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import type { AvatarColorType } from '../types/Colors';
export type PropsType = { export type PropsType = {
avatarPath?: string; avatarPath?: string;
children?: React.ReactNode; children?: React.ReactNode;
className?: string; className?: string;
color?: AvatarColorType;
}; };
export function CallBackgroundBlur({ export function CallBackgroundBlur({
avatarPath, avatarPath,
children, children,
className, className,
color,
}: PropsType): JSX.Element { }: PropsType): JSX.Element {
return ( return (
<div <div
className={classNames( className={classNames(
'module-calling__background', 'module-calling__background',
{ !avatarPath && 'module-calling__background--no-avatar',
[`module-background-color__${color || 'default'}`]: !avatarPath,
},
className className
)} )}
> >

View file

@ -391,7 +391,7 @@ export function CallScreen({
{isSendingVideo ? ( {isSendingVideo ? (
<video ref={localVideoRef} autoPlay /> <video ref={localVideoRef} autoPlay />
) : ( ) : (
<CallBackgroundBlur avatarPath={me.avatarPath} color={me.color}> <CallBackgroundBlur avatarPath={me.avatarPath}>
<div className="module-calling__spacer module-calling__camera-is-off-spacer" /> <div className="module-calling__spacer module-calling__camera-is-off-spacer" />
<div className="module-calling__camera-is-off"> <div className="module-calling__camera-is-off">
{i18n('icu:calling__your-video-is-off')} {i18n('icu:calling__your-video-is-off')}
@ -412,7 +412,7 @@ export function CallScreen({
autoPlay autoPlay
/> />
) : ( ) : (
<CallBackgroundBlur avatarPath={me.avatarPath} color={me.color}> <CallBackgroundBlur avatarPath={me.avatarPath}>
<Avatar <Avatar
acceptedMessageRequest acceptedMessageRequest
avatarPath={me.avatarPath} avatarPath={me.avatarPath}

View file

@ -240,7 +240,6 @@ export function CallingLobby({
<CallBackgroundBlur <CallBackgroundBlur
className="module-CallingLobby__local-preview module-CallingLobby__local-preview--camera-is-off" className="module-CallingLobby__local-preview module-CallingLobby__local-preview--camera-is-off"
avatarPath={me.avatarPath} avatarPath={me.avatarPath}
color={me.color}
/> />
)} )}

View file

@ -48,7 +48,7 @@ function NoVideo({
return ( return (
<div className="module-calling-pip__video--remote"> <div className="module-calling-pip__video--remote">
<CallBackgroundBlur avatarPath={avatarPath} color={color}> <CallBackgroundBlur avatarPath={avatarPath}>
<div className="module-calling-pip__video--avatar"> <div className="module-calling-pip__video--avatar">
<Avatar <Avatar
acceptedMessageRequest={acceptedMessageRequest} acceptedMessageRequest={acceptedMessageRequest}

View file

@ -73,7 +73,7 @@ function renderAvatar(
): JSX.Element { ): JSX.Element {
return ( return (
<div className="module-ongoing-call__remote-video-disabled"> <div className="module-ongoing-call__remote-video-disabled">
<CallBackgroundBlur avatarPath={avatarPath} color={color}> <CallBackgroundBlur avatarPath={avatarPath}>
<Avatar <Avatar
acceptedMessageRequest={acceptedMessageRequest} acceptedMessageRequest={acceptedMessageRequest}
avatarPath={avatarPath} avatarPath={avatarPath}

View file

@ -250,7 +250,7 @@ export const GroupCallRemoteParticipant: React.FC<PropsType> = React.memo(
const shorterDimension = Math.min(width, height); const shorterDimension = Math.min(width, height);
if (shorterDimension >= 180) { if (shorterDimension >= 180) {
avatarSize = AvatarSize.EIGHTY; avatarSize = AvatarSize.NINETY_SIX;
} else { } else {
avatarSize = AvatarSize.FORTY_EIGHT; avatarSize = AvatarSize.FORTY_EIGHT;
} }
@ -373,7 +373,10 @@ export const GroupCallRemoteParticipant: React.FC<PropsType> = React.memo(
/> />
)} )}
{!hasVideoToShow && ( {!hasVideoToShow && (
<CallBackgroundBlur avatarPath={avatarPath} color={color}> <CallBackgroundBlur
avatarPath={avatarPath}
className="module-ongoing-call__group-call-remote-participant-background"
>
{isBlocked ? ( {isBlocked ? (
<> <>
<i className="module-ongoing-call__group-call-remote-participant__blocked" /> <i className="module-ongoing-call__group-call-remote-participant__blocked" />