Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make call tiles look less broken in the right panel #9808

Merged
merged 2 commits into from
Dec 21, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion res/css/views/elements/_FacePile.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ limitations under the License.
}

.mx_BaseAvatar_image {
border: 1px solid $background;
border: 1px solid var(--facepile-background, $background);
}

.mx_BaseAvatar_initial {
Expand Down
87 changes: 54 additions & 33 deletions res/css/views/messages/_CallEvent.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -29,49 +29,70 @@ limitations under the License.
border-radius: 8px;

display: flex;
align-items: center;
justify-content: space-between;
gap: $spacing-8;

.mx_CallEvent_title {
font-size: $font-15px;
line-height: 24px; /* in px to match the avatar */
> .mx_BaseAvatar,
> .mx_Icon {
align-self: flex-start;
}

&.mx_CallEvent_inactive .mx_CallEvent_title::before {
display: inline-block;
vertical-align: middle;
content: "";
background-color: $secondary-content;
mask-image: url("$(res)/img/element-icons/call/video-call.svg");
mask-size: 16px;
width: 16px;
height: 16px;
margin-right: 8px;
> .mx_Icon {
padding: 0;
margin: $spacing-4 0;
color: $secondary-content;
}

&.mx_CallEvent_active .mx_CallEvent_title {
font-weight: 600;
.mx_LiveContentSummary {
font-size: $font-12px;
}

> .mx_BaseAvatar {
align-self: flex-start;
}
--facepile-background: $system;
}

> .mx_CallEvent_infoRows {
flex-grow: 1;
.mx_CallEvent_title {
font-size: $font-15px;
line-height: 24px; /* in px to match the avatar */
}

display: flex;
flex-direction: column;
gap: $spacing-4;
}
.mx_CallEvent_inactive .mx_CallEvent_title::before {
display: inline-block;
vertical-align: middle;
content: "";
background-color: $secondary-content;
mask-image: url("$(res)/img/element-icons/call/video-call.svg");
mask-size: 16px;
width: 16px;
height: 16px;
margin-right: $spacing-8;
}

> .mx_CallDuration {
padding: $spacing-4;
}
.mx_CallEvent_active .mx_CallEvent_title {
font-weight: $font-semi-bold;
}

> .mx_CallEvent_button {
box-sizing: border-box;
min-width: 120px;
}
.mx_CallEvent_columns {
flex-grow: 1;
display: flex;
gap: $spacing-12;
align-items: center;
justify-content: space-between;
}

.mx_TimelineCard .mx_CallEvent_columns {
flex-direction: column;
align-items: flex-start;
gap: $spacing-8;
}

.mx_CallEvent_details {
flex-grow: 1;

display: flex;
flex-direction: column;
gap: 6px;
}

.mx_CallEvent_button {
box-sizing: border-box;
min-width: 120px;
}
6 changes: 2 additions & 4 deletions res/css/views/voip/_CallView.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ limitations under the License.
padding: $spacing-12;
color: $call-lobby-primary-content;
background-color: $call-lobby-background;

--facepile-background: $call-lobby-background;
border-radius: 8px;

display: flex;
Expand All @@ -57,10 +59,6 @@ limitations under the License.
.mx_FacePile {
width: fit-content;
margin: $spacing-8 auto 0;

.mx_FacePile_faces .mx_BaseAvatar_image {
border-color: $call-lobby-background;
}
}

.mx_CallView_preview {
Expand Down
4 changes: 2 additions & 2 deletions res/img/element-icons/call/video-call.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 28 additions & 24 deletions src/components/views/messages/CallEvent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,28 +66,30 @@ const ActiveCallEvent = forwardRef<any, ActiveCallEventProps>(
width={24}
height={24}
/>
<div className="mx_CallEvent_infoRows">
<span className="mx_CallEvent_title">
{_t("%(name)s started a video call", { name: senderName })}
</span>
<LiveContentSummary
type={LiveContentType.Video}
text={_t("Video call")}
active={false}
participantCount={participatingMembers.length}
/>
<FacePile members={facePileMembers} faceSize={24} overflow={facePileOverflow} />
<div className="mx_CallEvent_columns">
<div className="mx_CallEvent_details">
<span className="mx_CallEvent_title">
{_t("%(name)s started a video call", { name: senderName })}
</span>
<LiveContentSummary
type={LiveContentType.Video}
text={_t("Video call")}
active={false}
participantCount={participatingMembers.length}
/>
<FacePile members={facePileMembers} faceSize={24} overflow={facePileOverflow} />
</div>
{call && <GroupCallDuration groupCall={call.groupCall} />}
<AccessibleTooltipButton
className="mx_CallEvent_button"
kind={buttonKind}
disabled={onButtonClick === null || buttonDisabledTooltip !== undefined}
onClick={onButtonClick}
tooltip={buttonDisabledTooltip}
>
{buttonText}
</AccessibleTooltipButton>
</div>
{call && <GroupCallDuration groupCall={call.groupCall} />}
<AccessibleTooltipButton
className="mx_CallEvent_button"
kind={buttonKind}
disabled={onButtonClick === null || buttonDisabledTooltip !== undefined}
onClick={onButtonClick}
tooltip={buttonDisabledTooltip}
>
{buttonText}
</AccessibleTooltipButton>
</div>
</div>
);
Expand Down Expand Up @@ -164,15 +166,17 @@ export const CallEvent = forwardRef<any, CallEventProps>(({ mxEvent }, ref) => {
const call = useCall(mxEvent.getRoomId()!);
const latestEvent = client
.getRoom(mxEvent.getRoomId())!
.currentState.getStateEvents(mxEvent.getType(), mxEvent.getStateKey()!);
.currentState.getStateEvents(mxEvent.getType(), mxEvent.getStateKey()!)!;

if ("m.terminated" in latestEvent.getContent()) {
// The call is terminated
return (
<div className="mx_CallEvent_wrapper" ref={ref}>
<div className="mx_CallEvent mx_CallEvent_inactive">
<span className="mx_CallEvent_title">{_t("Video call ended")}</span>
<CallDuration delta={latestEvent.getTs() - mxEvent.getTs()} />
<div className="mx_CallEvent_columns">
<span className="mx_CallEvent_title">{_t("Video call ended")}</span>
<CallDuration delta={latestEvent.getTs() - mxEvent.getTs()} />
</div>
</div>
</div>
);
Expand Down