Skip to content

Commit c0c0111

Browse files
committed
Update design of incoming call notifications
1 parent 46bff1f commit c0c0111

7 files changed

Lines changed: 176 additions & 171 deletions

File tree

apps/web/res/css/structures/_ToastContainer.pcss

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,40 +32,32 @@ Please see LICENSE files in the repository root for full details.
3232
color: $primary-content;
3333
box-shadow: 0px 4px 24px rgb(0, 0, 0, 0.1);
3434
border: var(--cpd-border-width-1) solid var(--cpd-color-border-interactive-secondary);
35-
border-radius: 12px;
35+
border-radius: calc(var(--cpd-space-6x) - var(--cpd-border-width-1));
3636
overflow: hidden;
3737
display: grid;
38-
grid-template-columns: 22px 1fr;
39-
column-gap: 8px;
38+
grid-template-columns: 20px 1fr;
39+
column-gap: var(--cpd-space-2x);
4040
row-gap: 4px;
4141
align-items: center;
42-
padding: var(--cpd-space-3x);
42+
padding: calc(var(--cpd-space-5x) - var(--cpd-border-width-1));
4343

4444
&.mx_Toast_hasIcon {
4545
svg {
46-
width: 22px;
47-
height: 22px;
46+
width: 20px;
47+
height: 20px;
4848
grid-column: 1;
4949
}
5050

5151
.mx_Toast_title {
5252
grid-column: 2;
5353
}
5454

55-
.mx_Toast_body {
56-
grid-column: 2 / 4;
57-
}
58-
5955
.mx_Toast_closebutton {
6056
grid-column: 3;
6157
}
6258
}
63-
&:not(.mx_Toast_hasIcon) {
64-
padding-left: 12px;
65-
66-
.mx_Toast_title {
67-
grid-column: 1 / -1;
68-
}
59+
&:not(.mx_Toast_hasIcon) .mx_Toast_title {
60+
grid-column: 1 / -1;
6961
}
7062

7163
.mx_Toast_title,
@@ -96,7 +88,7 @@ Please see LICENSE files in the repository root for full details.
9688
.mx_Toast_buttons {
9789
display: flex;
9890
justify-content: flex-end;
99-
column-gap: 5px;
91+
column-gap: var(--cpd-space-2x);
10092

10193
.mx_AccessibleButton {
10294
min-width: 96px;

apps/web/res/css/views/toasts/_IncomingCallToast.pcss

Lines changed: 22 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -9,64 +9,46 @@ Please see LICENSE files in the repository root for full details.
99
.mx_IncomingCallToast {
1010
position: relative;
1111
display: flex;
12-
flex-direction: row;
12+
flex-direction: column;
1313
pointer-events: initial; /* restore pointer events so the user can accept/decline */
1414

15-
$closeButtonSize: var(--cpd-space-4x);
16-
1715
.mx_IncomingCallToast_content {
1816
display: flex;
1917
flex-direction: column;
2018
gap: var(--cpd-space-4x);
21-
padding: var(--cpd-space-3x);
2219
width: 100%;
2320
overflow: hidden;
2421

25-
.mx_IncomingCallToast_message {
26-
font-size: var(--cpd-font-size-body-lg);
27-
line-height: var(--cpd-font-size-heading-sm);
28-
width: calc(100% - $closeButtonSize - 2 * var(--cpd-space-1x));
29-
font-weight: var(--cpd-font-weight-semibold);
22+
.mx_IncomingCallToast_title {
23+
display: grid;
24+
grid-template-columns: auto 1fr auto;
25+
align-items: center;
26+
gap: var(--cpd-space-2x);
27+
28+
h2 {
29+
margin: 0;
30+
}
31+
32+
.mx_IncomingCallToast_expandButton {
33+
padding: var(--cpd-space-1x);
34+
color: var(--cpd-color-icon-secondary);
35+
transition: color 0.1s;
36+
37+
&:hover {
38+
color: var(--cpd-color-icon-primary);
39+
}
40+
}
3041
}
3142

3243
.mx_IncomingCallToast_buttons {
3344
display: flex;
3445
gap: var(--cpd-space-2x);
46+
padding-block-start: var(--cpd-space-2x);
3547
}
3648

3749
.mx_IncomingCallToast_actionButton {
38-
position: relative;
39-
40-
align-self: flex-end;
41-
4250
box-sizing: border-box;
43-
min-width: 120px;
44-
45-
padding: var(--cpd-space-1x) 0;
46-
padding-right: var(--cpd-space-4x);
47-
line-height: var(--cpd-space-6x);
48-
}
49-
}
50-
51-
.mx_IncomingCallToast_closeButton {
52-
position: absolute;
53-
54-
right: 0;
55-
56-
display: flex;
57-
height: $closeButtonSize;
58-
width: $closeButtonSize;
59-
60-
svg {
61-
height: inherit;
62-
width: inherit;
63-
color: $secondary-content;
64-
}
65-
}
66-
.mx_IncomingCallToast_toggleWithLabel {
67-
display: flex;
68-
span {
69-
flex-grow: 1;
51+
min-width: 131px;
7052
}
7153
}
7254
}

apps/web/src/i18n/strings/en_EN.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3900,7 +3900,6 @@
39003900
"connection_lost": "Connectivity to the server has been lost",
39013901
"connection_lost_description": "You cannot place calls without a connection to the server.",
39023902
"consulting": "Consulting with %(transferTarget)s. <a>Transfer to %(transferee)s</a>",
3903-
"decline_call": "Decline",
39043903
"default_device": "Default Device",
39053904
"dial": "Dial",
39063905
"dialpad": "Dialpad",
@@ -3914,10 +3913,12 @@
39143913
"enable_microphone": "Unmute microphone",
39153914
"expand": "Return to call",
39163915
"get_call_link": "Share call link",
3916+
"group_call_started": "Group call started",
39173917
"hangup": "Hangup",
39183918
"hide_sidebar_button": "Hide sidebar",
39193919
"input_devices": "Input devices",
39203920
"jitsi_call": "Jitsi Conference",
3921+
"join_with_video": "Join with video",
39213922
"legacy_call": "Legacy Call",
39223923
"maximise": "Fill screen",
39233924
"maximise_call": "Maximise call",
@@ -3951,7 +3952,6 @@
39513952
"show_sidebar_button": "Show sidebar",
39523953
"silence": "Silence call",
39533954
"silenced": "Notifications silenced",
3954-
"skip_lobby_toggle_option": "Join immediately",
39553955
"start_screenshare": "Start sharing your screen",
39563956
"stop_screenshare": "Stop sharing your screen",
39573957
"too_many_calls": "Too Many Calls",
@@ -3973,7 +3973,6 @@
39733973
"user_is_presenting": "%(sharerName)s is presenting",
39743974
"video_call": "Video call",
39753975
"video_call_incoming": "Incoming video call",
3976-
"video_call_started": "Video call started",
39773976
"video_call_using": "Video call using:",
39783977
"voice_call": "Voice call",
39793978
"voice_call_incoming": "Incoming voice call",

apps/web/src/models/Call.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,8 @@ export class JitsiCall extends Call {
592592
export enum ElementCallIntent {
593593
StartCall = "start_call",
594594
JoinExisting = "join_existing",
595+
StartCallVoice = "start_call_voice",
596+
JoinExistingVoice = "join_existing_voice",
595597
StartCallDM = "start_call_dm",
596598
StartCallDMVoice = "start_call_dm_voice",
597599
JoinExistingDM = "join_existing_dm",
@@ -685,11 +687,13 @@ export class ElementCall extends Call {
685687
params.append("intent", voiceOnly ? ElementCallIntent.StartCallDMVoice : ElementCallIntent.StartCallDM);
686688
}
687689
} else {
688-
// Group chats do not have a voice option.
689690
if (hasCallStarted) {
690-
params.append("intent", ElementCallIntent.JoinExisting);
691+
params.append(
692+
"intent",
693+
voiceOnly ? ElementCallIntent.JoinExistingVoice : ElementCallIntent.JoinExisting,
694+
);
691695
} else {
692-
params.append("intent", ElementCallIntent.StartCall);
696+
params.append("intent", voiceOnly ? ElementCallIntent.StartCallVoice : ElementCallIntent.StartCall);
693697
}
694698
}
695699
}

0 commit comments

Comments
 (0)