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

Commit df4a223

Browse files
authored
Deduplicate media & voip icons using Compound Design Tokens (#129)
* Deduplicate media & voip icons using Compound Design Tokens Signed-off-by: Michael Telatynski <[email protected]> * Update tests Signed-off-by: Michael Telatynski <[email protected]> --------- Signed-off-by: Michael Telatynski <[email protected]>
1 parent 197168b commit df4a223

File tree

49 files changed

+497
-149
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+497
-149
lines changed

res/css/views/audio_messages/_PlayPauseButton.pcss

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,21 @@ Please see LICENSE files in the repository root for full details.
2121
background-color: $secondary-content;
2222
mask-repeat: no-repeat;
2323
mask-size: contain;
24+
top: 6px; /* center */
25+
left: 6px; /* center */
26+
width: 20px;
27+
height: 20px;
2428
}
2529

2630
&.mx_PlayPauseButton_disabled::before {
2731
opacity: 0.5;
2832
}
2933

3034
&.mx_PlayPauseButton_play::before {
31-
width: 13px;
32-
height: 16px;
33-
top: 8px; /* center */
34-
left: 12px; /* center */
35-
mask-image: url("$(res)/img/element-icons/play.svg");
35+
mask-image: url("@vector-im/compound-design-tokens/icons/play-solid.svg");
3636
}
3737

3838
&.mx_PlayPauseButton_pause::before {
39-
width: 10px;
40-
height: 12px;
41-
top: 10px; /* center */
42-
left: 11px; /* center */
43-
mask-image: url("$(res)/img/element-icons/pause.svg");
39+
mask-image: url("@vector-im/compound-design-tokens/icons/pause-solid.svg");
4440
}
4541
}

res/css/views/messages/_LegacyCallEvent.pcss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Please see LICENSE files in the repository root for full details.
7575
&.mx_LegacyCallEvent_rejected,
7676
&.mx_LegacyCallEvent_noAnswer {
7777
.mx_LegacyCallEvent_type_icon::before {
78-
mask-image: url("$(res)/img/voip/declined-video.svg");
78+
mask-image: url("@vector-im/compound-design-tokens/icons/video-call-declined-solid.svg");
7979
}
8080
}
8181
}
@@ -89,7 +89,7 @@ Please see LICENSE files in the repository root for full details.
8989

9090
&.mx_LegacyCallEvent_video {
9191
.mx_LegacyCallEvent_type_icon::before {
92-
mask-image: url("$(res)/img/voip/missed-video.svg");
92+
mask-image: url("@vector-im/compound-design-tokens/icons/video-call-missed-solid.svg");
9393
}
9494
}
9595
}

res/css/views/rooms/_MessageComposer.pcss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ Please see LICENSE files in the repository root for full details.
253253
}
254254

255255
.mx_MessageComposer_voiceMessage::before {
256-
mask-image: url("$(res)/img/element-icons/mic.svg");
256+
mask-image: url("@vector-im/compound-design-tokens/icons/mic-on-solid.svg");
257257
}
258258

259259
.mx_MessageComposer_voiceBroadcast::before {

res/css/views/rooms/_ReplyTile.pcss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Please see LICENSE files in the repository root for full details.
1212
font: var(--cpd-font-body-md-regular);
1313

1414
&.mx_ReplyTile_audio .mx_MFileBody_info_icon::before {
15-
mask-image: url("$(res)/img/element-icons/speaker.svg");
15+
mask-image: url("@vector-im/compound-design-tokens/icons/volume-on-solid.svg");
1616
}
1717

1818
&.mx_ReplyTile_video .mx_MFileBody_info_icon::before {

res/css/views/voip/LegacyCallView/_LegacyCallViewButtons.pcss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,19 +87,19 @@ Please see LICENSE files in the repository root for full details.
8787

8888
&.mx_LegacyCallViewButtons_button_mic::before {
8989
height: 20px;
90-
mask-image: url("$(res)/img/element-icons/mic.svg");
90+
mask-image: url("@vector-im/compound-design-tokens/icons/mic-on-solid.svg");
9191
width: 20px;
9292
}
9393

9494
&.mx_LegacyCallViewButtons_button_vid::before {
95-
mask-image: url("$(res)/img/voip/call-view/cam-on.svg");
95+
mask-image: url("@vector-im/compound-design-tokens/icons/video-call-solid.svg");
9696
}
9797

9898
&.mx_LegacyCallViewButtons_button_screensharing {
9999
background-color: $accent;
100100

101101
&::before {
102-
mask-image: url("$(res)/img/voip/call-view/screensharing.svg");
102+
mask-image: url("@vector-im/compound-design-tokens/icons/share-screen-solid.svg");
103103
background-color: white; /* Same on both themes */
104104
}
105105
}
@@ -118,19 +118,19 @@ Please see LICENSE files in the repository root for full details.
118118

119119
&.mx_LegacyCallViewButtons_button_mic::before {
120120
height: 20px;
121-
mask-image: url("$(res)/img/element-icons/Mic-off.svg");
121+
mask-image: url("@vector-im/compound-design-tokens/icons/mic-off-solid.svg");
122122
width: 20px;
123123
}
124124

125125
&.mx_LegacyCallViewButtons_button_vid::before {
126-
mask-image: url("$(res)/img/voip/call-view/cam-off.svg");
126+
mask-image: url("@vector-im/compound-design-tokens/icons/video-call-off-solid.svg");
127127
}
128128

129129
&.mx_LegacyCallViewButtons_button_screensharing {
130130
background-color: $call-view-button-on-background;
131131

132132
&::before {
133-
mask-image: url("$(res)/img/voip/call-view/screensharing.svg");
133+
mask-image: url("@vector-im/compound-design-tokens/icons/share-screen-solid.svg");
134134
background-color: $call-view-button-on-foreground;
135135
}
136136
}

res/css/views/voip/_CallView.pcss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@ Please see LICENSE files in the repository root for full details.
123123
}
124124

125125
&.mx_CallView_deviceButton_audio::before {
126-
mask-image: url("$(res)/img/element-icons/mic.svg");
126+
mask-image: url("@vector-im/compound-design-tokens/icons/mic-on-solid.svg");
127127
mask-size: 14px;
128128
}
129129

130130
&.mx_CallView_deviceButton_video::before {
131-
mask-image: url("$(res)/img/voip/call-view/cam-on.svg");
131+
mask-image: url("@vector-im/compound-design-tokens/icons/video-call-solid.svg");
132132
}
133133
}
134134

@@ -168,12 +168,12 @@ Please see LICENSE files in the repository root for full details.
168168

169169
.mx_CallView_deviceButton {
170170
&.mx_CallView_deviceButton_audio::before {
171-
mask-image: url("$(res)/img/element-icons/Mic-off.svg");
171+
mask-image: url("@vector-im/compound-design-tokens/icons/mic-off-solid.svg");
172172
mask-size: 18px;
173173
}
174174

175175
&.mx_CallView_deviceButton_video::before {
176-
mask-image: url("$(res)/img/voip/call-view/cam-off.svg");
176+
mask-image: url("@vector-im/compound-design-tokens/icons/video-call-off-solid.svg");
177177
}
178178
}
179179
}

res/css/views/voip/_VideoFeed.pcss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ Please see LICENSE files in the repository root for full details.
7272
}
7373

7474
&.mx_VideoFeed_mic_muted::before {
75-
mask-image: url("$(res)/img/element-icons/Mic-off.svg");
75+
mask-image: url("@vector-im/compound-design-tokens/icons/mic-off-solid.svg");
7676
}
7777

7878
&.mx_VideoFeed_mic_unmuted::before {
79-
mask-image: url("$(res)/img/element-icons/mic.svg");
79+
mask-image: url("@vector-im/compound-design-tokens/icons/mic-on-solid.svg");
8080
}
8181
}
8282
}

res/img/compound/mic-16px.svg

Lines changed: 0 additions & 4 deletions
This file was deleted.

res/img/compound/pause-12.svg

Lines changed: 0 additions & 4 deletions
This file was deleted.

res/img/compound/play-16.svg

Lines changed: 0 additions & 3 deletions
This file was deleted.

res/img/element-icons/Mic-off.svg

Lines changed: 0 additions & 5 deletions
This file was deleted.

res/img/element-icons/mic.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

res/img/element-icons/pause.svg

Lines changed: 0 additions & 4 deletions
This file was deleted.

res/img/element-icons/play.svg

Lines changed: 0 additions & 3 deletions
This file was deleted.

res/img/element-icons/speaker.svg

Lines changed: 0 additions & 5 deletions
This file was deleted.

res/img/voip/call-view/cam-off.svg

Lines changed: 0 additions & 3 deletions
This file was deleted.

res/img/voip/call-view/cam-on.svg

Lines changed: 0 additions & 3 deletions
This file was deleted.

res/img/voip/call-view/screensharing.svg

Lines changed: 0 additions & 3 deletions
This file was deleted.

res/img/voip/declined-video.svg

Lines changed: 0 additions & 3 deletions
This file was deleted.

res/img/voip/missed-video.svg

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/voice-broadcast/components/atoms/VoiceBroadcastHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ import React from "react";
1010
import { Room } from "matrix-js-sdk/src/matrix";
1111
import classNames from "classnames";
1212
import CloseIcon from "@vector-im/compound-design-tokens/assets/web/icons/close";
13+
import MicrophoneIcon from "@vector-im/compound-design-tokens/assets/web/icons/mic-on-solid";
1314

1415
import { LiveBadge, VoiceBroadcastLiveness } from "../..";
1516
import { Icon as LiveIcon } from "../../../../res/img/compound/live-16px.svg";
16-
import { Icon as MicrophoneIcon } from "../../../../res/img/compound/mic-16px.svg";
1717
import { Icon as TimerIcon } from "../../../../res/img/compound/timer-16px.svg";
1818
import { _t } from "../../../languageHandler";
1919
import RoomAvatar from "../../../components/views/avatars/RoomAvatar";

src/voice-broadcast/components/atoms/VoiceBroadcastPlaybackControl.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ Please see LICENSE files in the repository root for full details.
77
*/
88

99
import React, { ReactElement } from "react";
10+
import PauseIcon from "@vector-im/compound-design-tokens/assets/web/icons/pause-solid";
11+
import PlayIcon from "@vector-im/compound-design-tokens/assets/web/icons/play-solid";
1012

11-
import { Icon as PlayIcon } from "../../../../res/img/compound/play-16.svg";
12-
import { Icon as PauseIcon } from "../../../../res/img/compound/pause-12.svg";
1313
import { _t } from "../../../languageHandler";
1414
import { VoiceBroadcastControl, VoiceBroadcastPlaybackState } from "../..";
1515

0 commit comments

Comments
 (0)