Skip to content

Commit 5ea0759

Browse files
authored
Earpiece follow up: Change labels and icons (#3401)
* fix collapse icon on android * update wording `earpiece` -> `headset` * update icon `earpiece` -> `phone` * i18n * update icons to solid (top right) and non solid (overlay) * update snapshots * add config.json to gitignore * add offset for earpice overlay * update snapshots to include offset spacer
1 parent 7ac3780 commit 5ea0759

File tree

11 files changed

+49
-31
lines changed

11 files changed

+49
-31
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ dist-ssr
99
public/config.json
1010
backend/synapse_tmp/*
1111
/coverage
12+
config.json
1213

1314
# Yarn
1415
yarn-error.log

locales/de/app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175
"camera_numbered": "Kamera {{n}}",
176176
"default": "Standard",
177177
"default_named": "Standard<2> ({{name}} )</2>",
178-
"earpiece": "Ohrhörer",
178+
"handset": "Ohrhörer",
179179
"microphone": "Mikrofon",
180180
"microphone_numbered": "Mikrofon{{n}}",
181181
"speaker": "Lautsprecher",

locales/en/app.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,6 @@
7979
"use_to_device_key_transport": "Use to device key transport. This will fallback to room key transport when another call member sent a room key"
8080
},
8181
"disconnected_banner": "Connectivity to the server has been lost.",
82-
"earpiece": {
83-
"overlay_back_button": "Back to Speaker Mode",
84-
"overlay_description": "Only works while using app",
85-
"overlay_title": "Earpiece Mode"
86-
},
8782
"error": {
8883
"call_is_not_supported": "Call is not supported",
8984
"call_not_found": "Call not found",
@@ -110,6 +105,11 @@
110105
"knock_reject_heading": "Access denied",
111106
"reason": "Reason: {{reason}}"
112107
},
108+
"handset": {
109+
"overlay_back_button": "Back to Speaker Mode",
110+
"overlay_description": "Only works while using app",
111+
"overlay_title": "Handset Mode"
112+
},
113113
"hangup_button_label": "End call",
114114
"header_label": "Element Call Home",
115115
"header_participants_label": "Participants",
@@ -181,7 +181,7 @@
181181
"change_device_button": "Change audio device",
182182
"default": "Default",
183183
"default_named": "Default <2>({{name}})</2>",
184-
"earpiece": "Earpiece",
184+
"handset": "Handset",
185185
"loudspeaker": "Loudspeaker",
186186
"microphone": "Microphone",
187187
"microphone_numbered": "Microphone {{n}}",

src/AppBar.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ import {
1717
useState,
1818
} from "react";
1919
import { Heading, IconButton, Tooltip } from "@vector-im/compound-web";
20-
import {
21-
ArrowLeftIcon,
22-
CollapseIcon,
23-
} from "@vector-im/compound-design-tokens/assets/web/icons";
20+
import { CollapseIcon } from "@vector-im/compound-design-tokens/assets/web/icons";
2421
import { useTranslation } from "react-i18next";
2522

2623
import { Header, LeftNav, RightNav } from "./Header";
@@ -45,7 +42,6 @@ interface Props {
4542
*/
4643
export const AppBar: FC<Props> = ({ children }) => {
4744
const { t } = useTranslation();
48-
const BackIcon = platform === "ios" ? CollapseIcon : ArrowLeftIcon;
4945
const onBackClick = useCallback((e: MouseEvent) => {
5046
e.preventDefault();
5147
window.controls.onBackButtonPressed?.();
@@ -69,7 +65,7 @@ export const AppBar: FC<Props> = ({ children }) => {
6965
<LeftNav>
7066
<Tooltip label={t("common.back")}>
7167
<IconButton onClick={onBackClick}>
72-
<BackIcon />
68+
<CollapseIcon />
7369
</IconButton>
7470
</Tooltip>
7571
</LeftNav>

src/__snapshots__/AppBar.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ exports[`AppBar > renders 1`] = `
3232
xmlns="http://www.w3.org/2000/svg"
3333
>
3434
<path
35-
d="M12.207 5.293a1 1 0 0 1 0 1.414L7.914 11H18.5a1 1 0 1 1 0 2H7.914l4.293 4.293a1 1 0 0 1-1.414 1.414l-6-6a1 1 0 0 1 0-1.414l6-6a1 1 0 0 1 1.414 0"
35+
d="M12 11.034a1 1 0 0 0 .29.702l.005.005c.18.18.43.29.705.29h8a1 1 0 0 0 0-2h-5.586L22 3.445a1 1 0 0 0-1.414-1.414L14 8.617V3.031a1 1 0 1 0-2 0zm0 1.963a1 1 0 0 0-.29-.702l-.005-.004A1 1 0 0 0 11 12H3a1 1 0 1 0 0 2h5.586L2 20.586A1 1 0 1 0 3.414 22L10 15.414V21a1 1 0 0 0 2 0z"
3636
/>
3737
</svg>
3838
</div>

src/room/EarpieceOverlay.module.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,7 @@
6161
.overlay > p {
6262
text-align: center;
6363
}
64+
65+
.spacer {
66+
min-height: var(--cpd-space-32x);
67+
}

src/room/EarpieceOverlay.tsx

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

88
import { type FC } from "react";
99
import { BigIcon, Button, Heading, Text } from "@vector-im/compound-web";
10-
import { EarpieceIcon } from "@vector-im/compound-design-tokens/assets/web/icons";
10+
import { VoiceCallIcon } from "@vector-im/compound-design-tokens/assets/web/icons";
1111
import { useTranslation } from "react-i18next";
1212

1313
import styles from "./EarpieceOverlay.module.css";
@@ -22,21 +22,23 @@ export const EarpieceOverlay: FC<Props> = ({ show, onBackToVideoPressed }) => {
2222
return (
2323
<div className={styles.overlay} data-show={show}>
2424
<BigIcon className={styles.icon}>
25-
<EarpieceIcon aria-hidden />
25+
<VoiceCallIcon aria-hidden />
2626
</BigIcon>
2727
<Heading as="h2" weight="semibold" size="md">
28-
{t("earpiece.overlay_title")}
28+
{t("handset.overlay_title")}
2929
</Heading>
30-
<Text>{t("earpiece.overlay_description")}</Text>
30+
<Text>{t("handset.overlay_description")}</Text>
3131
<Button
3232
kind="primary"
3333
size="sm"
3434
onClick={() => {
3535
onBackToVideoPressed?.();
3636
}}
3737
>
38-
{t("earpiece.overlay_back_button")}
38+
{t("handset.overlay_back_button")}
3939
</Button>
40+
{/* This spacer is used to give the overlay an offset to the top. */}
41+
<div className={styles.spacer} />
4042
</div>
4143
);
4244
};

src/room/InCallView.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { useObservable } from "observable-hooks";
2929
import { logger } from "matrix-js-sdk/lib/logger";
3030
import { RoomAndToDeviceEvents } from "matrix-js-sdk/lib/matrixrtc/RoomAndToDeviceKeyTransport";
3131
import {
32-
EarpieceIcon,
32+
VoiceCallSolidIcon,
3333
VolumeOnSolidIcon,
3434
} from "@vector-im/compound-design-tokens/assets/web/icons";
3535
import { useTranslation } from "react-i18next";
@@ -458,9 +458,9 @@ export const InCallView: FC<InCallViewProps> = ({
458458
useMemo(() => {
459459
if (audioOutputSwitcher === null) return null;
460460
const isEarpieceTarget = audioOutputSwitcher.targetOutput === "earpiece";
461-
const Icon = isEarpieceTarget ? EarpieceIcon : VolumeOnSolidIcon;
461+
const Icon = isEarpieceTarget ? VoiceCallSolidIcon : VolumeOnSolidIcon;
462462
const label = isEarpieceTarget
463-
? t("settings.devices.earpiece")
463+
? t("settings.devices.handset")
464464
: t("settings.devices.loudspeaker");
465465

466466
return (

src/room/__snapshots__/InCallView.test.tsx.snap

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,30 @@ exports[`InCallView > rendering > renders 1`] = `
9898
width="1em"
9999
xmlns="http://www.w3.org/2000/svg"
100100
>
101-
<path
102-
d="M14 2c3.93 0 7 3.07 7 7a1 1 0 0 1-2 0c0-2.8-2.2-5-5-5S9 6.2 9 9c0 .93.29 1.98.82 2.94.71 1.29 1.53 1.92 2.32 2.53.92.71 1.88 1.44 2.39 3 .5 1.5 1 2.01 1.71 2.38.2.09.47.15.76.15 1.1 0 2-.9 2-2a1 1 0 1 1 2 0 4 4 0 0 1-5.64 3.65c-1.36-.71-2.13-1.73-2.73-3.55-.32-.98-.9-1.43-1.71-2.05-.87-.67-1.94-1.5-2.85-3.15C7.38 11.65 7 10.26 7 9c0-3.93 3.07-7 7-7"
103-
/>
104-
<path
105-
d="M6.145 1.3a1 1 0 0 1 1.427 1.4A8.97 8.97 0 0 0 5 9c0 2.3.862 4.397 2.281 5.988l.291.312.069.077A1 1 0 0 1 6.22 16.77l-.075-.07-.356-.38A10.96 10.96 0 0 1 3 9c0-2.998 1.2-5.717 3.145-7.7M14 6.5a2.5 2.5 0 0 1 0 5 2.501 2.501 0 0 1 0-5"
106-
/>
101+
<g
102+
clip-path="url(#a)"
103+
>
104+
<path
105+
clip-rule="evenodd"
106+
d="M8.929 15.1a13.6 13.6 0 0 0 4.654 3.066q2.62 1.036 5.492.923h.008l.003-.004.003-.002-.034-3.124-3.52-.483-1.791 1.792-.645-.322a13.5 13.5 0 0 1-3.496-2.52 13.4 13.4 0 0 1-2.52-3.496l-.322-.644 1.792-1.792-.483-3.519-3.123-.034-.003.002-.003.004v.002a13.65 13.65 0 0 0 .932 5.492A13.4 13.4 0 0 0 8.93 15.1m3.92 4.926a15.6 15.6 0 0 1-5.334-3.511 15.4 15.4 0 0 1-3.505-5.346 15.6 15.6 0 0 1-1.069-6.274 1.93 1.93 0 0 1 .589-1.366c.366-.366.84-.589 1.386-.589h.01l3.163.035a1.96 1.96 0 0 1 1.958 1.694v.005l.487 3.545v.003c.043.297.025.605-.076.907a2 2 0 0 1-.485.773l-.762.762a11.4 11.4 0 0 0 3.206 3.54q.457.33.948.614l.762-.761a2 2 0 0 1 .774-.486c.302-.1.61-.118.907-.076l3.553.487a1.96 1.96 0 0 1 1.694 1.958l.034 3.174c0 .546-.223 1.02-.588 1.386-.361.36-.827.582-1.363.588a15.3 15.3 0 0 1-6.29-1.062"
107+
fill-rule="evenodd"
108+
/>
109+
</g>
110+
<defs>
111+
<clippath
112+
id="a"
113+
>
114+
<path
115+
d="M0 0h24v24H0z"
116+
/>
117+
</clippath>
118+
</defs>
107119
</svg>
108120
</div>
109121
<h2
110122
class="_typography_6v6n8_153 _font-heading-md-semibold_6v6n8_112"
111123
>
112-
Earpiece Mode
124+
Handset Mode
113125
</h2>
114126
<p
115127
class="_typography_6v6n8_153 _font-body-md-regular_6v6n8_50"
@@ -125,6 +137,9 @@ exports[`InCallView > rendering > renders 1`] = `
125137
>
126138
Back to Speaker Mode
127139
</button>
140+
<div
141+
class="spacer"
142+
/>
128143
</div>
129144
<div
130145
class="container"

src/settings/DeviceSelection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export const DeviceSelection: FC<Props> = ({
9898
labelText = t("settings.devices.loudspeaker");
9999
break;
100100
case "earpiece":
101-
labelText = t("settings.devices.earpiece");
101+
labelText = t("settings.devices.handset");
102102
break;
103103
}
104104

0 commit comments

Comments
 (0)