Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit ff59f68

Browse files
authored
New group call experience: Call tiles (#9332)
* Add call tiles * Factor CallDuration out into a reusable component * Correct the separator character in LiveContentSummary
1 parent 07a5a1d commit ff59f68

File tree

19 files changed

+606
-51
lines changed

19 files changed

+606
-51
lines changed

res/css/_components.pcss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@
210210
@import "./views/elements/_Validation.pcss";
211211
@import "./views/emojipicker/_EmojiPicker.pcss";
212212
@import "./views/location/_LocationPicker.pcss";
213+
@import "./views/messages/_CallEvent.pcss";
213214
@import "./views/messages/_CreateEvent.pcss";
214215
@import "./views/messages/_DateSeparator.pcss";
215216
@import "./views/messages/_DisambiguatedProfile.pcss";
@@ -264,6 +265,7 @@
264265
@import "./views/rooms/_JumpToBottomButton.pcss";
265266
@import "./views/rooms/_LinkPreviewGroup.pcss";
266267
@import "./views/rooms/_LinkPreviewWidget.pcss";
268+
@import "./views/rooms/_LiveContentSummary.pcss";
267269
@import "./views/rooms/_MemberInfo.pcss";
268270
@import "./views/rooms/_MemberList.pcss";
269271
@import "./views/rooms/_MessageComposer.pcss";
@@ -285,7 +287,6 @@
285287
@import "./views/rooms/_RoomPreviewCard.pcss";
286288
@import "./views/rooms/_RoomSublist.pcss";
287289
@import "./views/rooms/_RoomTile.pcss";
288-
@import "./views/rooms/_RoomTileCallSummary.pcss";
289290
@import "./views/rooms/_RoomUpgradeWarningBar.pcss";
290291
@import "./views/rooms/_SearchBar.pcss";
291292
@import "./views/rooms/_SendMessageComposer.pcss";
@@ -347,6 +348,7 @@
347348
@import "./views/user-onboarding/_UserOnboardingTask.pcss";
348349
@import "./views/verification/_VerificationShowSas.pcss";
349350
@import "./views/voip/LegacyCallView/_LegacyCallViewButtons.pcss";
351+
@import "./views/voip/_CallDuration.pcss";
350352
@import "./views/voip/_CallView.pcss";
351353
@import "./views/voip/_DialPad.pcss";
352354
@import "./views/voip/_DialPadContextMenu.pcss";

res/css/views/elements/_FacePile.pcss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ limitations under the License.
2222
display: inline-flex;
2323
flex-direction: row-reverse;
2424
vertical-align: middle;
25+
margin: 0 -1px; /* to cancel out the border on the edges */
2526

2627
/* Overlap the children */
2728
> * + * {
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/*
2+
Copyright 2022 The Matrix.org Foundation C.I.C.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
.mx_CallEvent_wrapper {
18+
display: flex;
19+
width: 100%;
20+
}
21+
22+
.mx_CallEvent {
23+
padding: 12px;
24+
box-sizing: border-box;
25+
min-height: 60px;
26+
max-width: 600px;
27+
width: 100%;
28+
background-color: $system;
29+
border-radius: 8px;
30+
31+
display: flex;
32+
align-items: center;
33+
justify-content: space-between;
34+
gap: $spacing-8;
35+
36+
.mx_CallEvent_title {
37+
font-size: $font-15px;
38+
line-height: 24px; /* in px to match the avatar */
39+
}
40+
41+
&.mx_CallEvent_inactive .mx_CallEvent_title::before {
42+
display: inline-block;
43+
vertical-align: middle;
44+
content: '';
45+
background-color: $secondary-content;
46+
mask-image: url('$(res)/img/element-icons/call/video-call.svg');
47+
mask-size: 16px;
48+
width: 16px;
49+
height: 16px;
50+
margin-right: 8px;
51+
}
52+
53+
&.mx_CallEvent_active .mx_CallEvent_title {
54+
font-weight: 600;
55+
}
56+
57+
> .mx_BaseAvatar {
58+
align-self: flex-start;
59+
}
60+
61+
> .mx_CallEvent_infoRows {
62+
flex-grow: 1;
63+
64+
display: flex;
65+
flex-direction: column;
66+
gap: $spacing-4;
67+
}
68+
69+
> .mx_CallDuration {
70+
padding: $spacing-4;
71+
}
72+
73+
> .mx_CallEvent_button {
74+
box-sizing: border-box;
75+
min-width: 120px;
76+
}
77+
}

res/css/views/rooms/_EventBubbleTile.pcss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,8 @@ limitations under the License.
523523
max-width: 100%;
524524
}
525525

526-
.mx_LegacyCallEvent_wrapper {
526+
.mx_LegacyCallEvent_wrapper,
527+
.mx_CallEvent_wrapper {
527528
justify-content: center;
528529
}
529530
}

res/css/views/rooms/_RoomTileCallSummary.pcss renamed to res/css/views/rooms/_LiveContentSummary.pcss

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,26 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
.mx_RoomTileCallSummary {
18-
.mx_RoomTileCallSummary_text {
17+
.mx_LiveContentSummary {
18+
color: $secondary-content;
19+
20+
.mx_LiveContentSummary_text {
1921
&::before {
2022
display: inline-block;
2123
vertical-align: text-bottom;
2224
content: '';
2325
background-color: $secondary-content;
24-
mask-image: url('$(res)/img/element-icons/call/video-call.svg');
2526
mask-size: 16px;
2627
width: 16px;
2728
height: 16px;
2829
margin-right: 4px;
2930
}
3031

31-
&.mx_RoomTileCallSummary_text_active {
32+
&.mx_LiveContentSummary_text_video::before {
33+
mask-image: url('$(res)/img/element-icons/call/video-call.svg');
34+
}
35+
36+
&.mx_LiveContentSummary_text_active {
3237
color: $accent;
3338

3439
&::before {
@@ -37,7 +42,7 @@ limitations under the License.
3742
}
3843
}
3944

40-
.mx_RoomTileCallSummary_participants::before {
45+
.mx_LiveContentSummary_participants::before {
4146
display: inline-block;
4247
vertical-align: text-bottom;
4348
content: '';
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
Copyright 2022 The Matrix.org Foundation C.I.C.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
.mx_CallDuration {
18+
color: $secondary-content;
19+
font-size: $font-12px;
20+
}

src/components/views/elements/AccessibleButton.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ type IProps<T extends keyof JSX.IntrinsicElements> = DynamicHtmlElementProps<T>
7272
disabled?: boolean;
7373
className?: string;
7474
triggerOnMouseDown?: boolean;
75-
onClick(e?: ButtonEvent): void | Promise<void>;
75+
onClick: ((e: ButtonEvent) => void | Promise<void>) | null;
7676
};
7777

7878
interface IAccessibleButtonProps extends React.InputHTMLAttributes<Element> {
@@ -106,9 +106,9 @@ export default function AccessibleButton<T extends keyof JSX.IntrinsicElements>(
106106
newProps["disabled"] = true;
107107
} else {
108108
if (triggerOnMouseDown) {
109-
newProps.onMouseDown = onClick;
109+
newProps.onMouseDown = onClick ?? undefined;
110110
} else {
111-
newProps.onClick = onClick;
111+
newProps.onClick = onClick ?? undefined;
112112
}
113113
// We need to consume enter onKeyDown and space onKeyUp
114114
// otherwise we are risking also activating other keyboard focusable elements
@@ -124,7 +124,7 @@ export default function AccessibleButton<T extends keyof JSX.IntrinsicElements>(
124124
case KeyBindingAction.Enter:
125125
e.stopPropagation();
126126
e.preventDefault();
127-
return onClick(e);
127+
return onClick?.(e);
128128
case KeyBindingAction.Space:
129129
e.stopPropagation();
130130
e.preventDefault();
@@ -144,7 +144,7 @@ export default function AccessibleButton<T extends keyof JSX.IntrinsicElements>(
144144
case KeyBindingAction.Space:
145145
e.stopPropagation();
146146
e.preventDefault();
147-
return onClick(e);
147+
return onClick?.(e);
148148
default:
149149
onKeyUp?.(e);
150150
break;

0 commit comments

Comments
 (0)