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
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -9,6 +9,7 @@ dist-ssr
|
|||||||
public/config.json
|
public/config.json
|
||||||
backend/synapse_tmp/*
|
backend/synapse_tmp/*
|
||||||
/coverage
|
/coverage
|
||||||
|
config.json
|
||||||
|
|
||||||
# Yarn
|
# Yarn
|
||||||
yarn-error.log
|
yarn-error.log
|
||||||
|
|||||||
@@ -175,7 +175,7 @@
|
|||||||
"camera_numbered": "Kamera {{n}}",
|
"camera_numbered": "Kamera {{n}}",
|
||||||
"default": "Standard",
|
"default": "Standard",
|
||||||
"default_named": "Standard<2> ({{name}} )</2>",
|
"default_named": "Standard<2> ({{name}} )</2>",
|
||||||
"earpiece": "Ohrhörer",
|
"handset": "Ohrhörer",
|
||||||
"microphone": "Mikrofon",
|
"microphone": "Mikrofon",
|
||||||
"microphone_numbered": "Mikrofon{{n}}",
|
"microphone_numbered": "Mikrofon{{n}}",
|
||||||
"speaker": "Lautsprecher",
|
"speaker": "Lautsprecher",
|
||||||
|
|||||||
@@ -79,11 +79,6 @@
|
|||||||
"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"
|
"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"
|
||||||
},
|
},
|
||||||
"disconnected_banner": "Connectivity to the server has been lost.",
|
"disconnected_banner": "Connectivity to the server has been lost.",
|
||||||
"earpiece": {
|
|
||||||
"overlay_back_button": "Back to Speaker Mode",
|
|
||||||
"overlay_description": "Only works while using app",
|
|
||||||
"overlay_title": "Earpiece Mode"
|
|
||||||
},
|
|
||||||
"error": {
|
"error": {
|
||||||
"call_is_not_supported": "Call is not supported",
|
"call_is_not_supported": "Call is not supported",
|
||||||
"call_not_found": "Call not found",
|
"call_not_found": "Call not found",
|
||||||
@@ -110,6 +105,11 @@
|
|||||||
"knock_reject_heading": "Access denied",
|
"knock_reject_heading": "Access denied",
|
||||||
"reason": "Reason: {{reason}}"
|
"reason": "Reason: {{reason}}"
|
||||||
},
|
},
|
||||||
|
"handset": {
|
||||||
|
"overlay_back_button": "Back to Speaker Mode",
|
||||||
|
"overlay_description": "Only works while using app",
|
||||||
|
"overlay_title": "Handset Mode"
|
||||||
|
},
|
||||||
"hangup_button_label": "End call",
|
"hangup_button_label": "End call",
|
||||||
"header_label": "Element Call Home",
|
"header_label": "Element Call Home",
|
||||||
"header_participants_label": "Participants",
|
"header_participants_label": "Participants",
|
||||||
@@ -181,7 +181,7 @@
|
|||||||
"change_device_button": "Change audio device",
|
"change_device_button": "Change audio device",
|
||||||
"default": "Default",
|
"default": "Default",
|
||||||
"default_named": "Default <2>({{name}})</2>",
|
"default_named": "Default <2>({{name}})</2>",
|
||||||
"earpiece": "Earpiece",
|
"handset": "Handset",
|
||||||
"loudspeaker": "Loudspeaker",
|
"loudspeaker": "Loudspeaker",
|
||||||
"microphone": "Microphone",
|
"microphone": "Microphone",
|
||||||
"microphone_numbered": "Microphone {{n}}",
|
"microphone_numbered": "Microphone {{n}}",
|
||||||
|
|||||||
@@ -17,10 +17,7 @@ import {
|
|||||||
useState,
|
useState,
|
||||||
} from "react";
|
} from "react";
|
||||||
import { Heading, IconButton, Tooltip } from "@vector-im/compound-web";
|
import { Heading, IconButton, Tooltip } from "@vector-im/compound-web";
|
||||||
import {
|
import { CollapseIcon } from "@vector-im/compound-design-tokens/assets/web/icons";
|
||||||
ArrowLeftIcon,
|
|
||||||
CollapseIcon,
|
|
||||||
} from "@vector-im/compound-design-tokens/assets/web/icons";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
import { Header, LeftNav, RightNav } from "./Header";
|
import { Header, LeftNav, RightNav } from "./Header";
|
||||||
@@ -45,7 +42,6 @@ interface Props {
|
|||||||
*/
|
*/
|
||||||
export const AppBar: FC<Props> = ({ children }) => {
|
export const AppBar: FC<Props> = ({ children }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const BackIcon = platform === "ios" ? CollapseIcon : ArrowLeftIcon;
|
|
||||||
const onBackClick = useCallback((e: MouseEvent) => {
|
const onBackClick = useCallback((e: MouseEvent) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
window.controls.onBackButtonPressed?.();
|
window.controls.onBackButtonPressed?.();
|
||||||
@@ -69,7 +65,7 @@ export const AppBar: FC<Props> = ({ children }) => {
|
|||||||
<LeftNav>
|
<LeftNav>
|
||||||
<Tooltip label={t("common.back")}>
|
<Tooltip label={t("common.back")}>
|
||||||
<IconButton onClick={onBackClick}>
|
<IconButton onClick={onBackClick}>
|
||||||
<BackIcon />
|
<CollapseIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</LeftNav>
|
</LeftNav>
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ exports[`AppBar > renders 1`] = `
|
|||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
>
|
>
|
||||||
<path
|
<path
|
||||||
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"
|
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"
|
||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -61,3 +61,7 @@
|
|||||||
.overlay > p {
|
.overlay > p {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.spacer {
|
||||||
|
min-height: var(--cpd-space-32x);
|
||||||
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Please see LICENSE in the repository root for full details.
|
|||||||
|
|
||||||
import { type FC } from "react";
|
import { type FC } from "react";
|
||||||
import { BigIcon, Button, Heading, Text } from "@vector-im/compound-web";
|
import { BigIcon, Button, Heading, Text } from "@vector-im/compound-web";
|
||||||
import { EarpieceIcon } from "@vector-im/compound-design-tokens/assets/web/icons";
|
import { VoiceCallIcon } from "@vector-im/compound-design-tokens/assets/web/icons";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
import styles from "./EarpieceOverlay.module.css";
|
import styles from "./EarpieceOverlay.module.css";
|
||||||
@@ -22,12 +22,12 @@ export const EarpieceOverlay: FC<Props> = ({ show, onBackToVideoPressed }) => {
|
|||||||
return (
|
return (
|
||||||
<div className={styles.overlay} data-show={show}>
|
<div className={styles.overlay} data-show={show}>
|
||||||
<BigIcon className={styles.icon}>
|
<BigIcon className={styles.icon}>
|
||||||
<EarpieceIcon aria-hidden />
|
<VoiceCallIcon aria-hidden />
|
||||||
</BigIcon>
|
</BigIcon>
|
||||||
<Heading as="h2" weight="semibold" size="md">
|
<Heading as="h2" weight="semibold" size="md">
|
||||||
{t("earpiece.overlay_title")}
|
{t("handset.overlay_title")}
|
||||||
</Heading>
|
</Heading>
|
||||||
<Text>{t("earpiece.overlay_description")}</Text>
|
<Text>{t("handset.overlay_description")}</Text>
|
||||||
<Button
|
<Button
|
||||||
kind="primary"
|
kind="primary"
|
||||||
size="sm"
|
size="sm"
|
||||||
@@ -35,8 +35,10 @@ export const EarpieceOverlay: FC<Props> = ({ show, onBackToVideoPressed }) => {
|
|||||||
onBackToVideoPressed?.();
|
onBackToVideoPressed?.();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t("earpiece.overlay_back_button")}
|
{t("handset.overlay_back_button")}
|
||||||
</Button>
|
</Button>
|
||||||
|
{/* This spacer is used to give the overlay an offset to the top. */}
|
||||||
|
<div className={styles.spacer} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import { useObservable } from "observable-hooks";
|
|||||||
import { logger } from "matrix-js-sdk/lib/logger";
|
import { logger } from "matrix-js-sdk/lib/logger";
|
||||||
import { RoomAndToDeviceEvents } from "matrix-js-sdk/lib/matrixrtc/RoomAndToDeviceKeyTransport";
|
import { RoomAndToDeviceEvents } from "matrix-js-sdk/lib/matrixrtc/RoomAndToDeviceKeyTransport";
|
||||||
import {
|
import {
|
||||||
EarpieceIcon,
|
VoiceCallSolidIcon,
|
||||||
VolumeOnSolidIcon,
|
VolumeOnSolidIcon,
|
||||||
} from "@vector-im/compound-design-tokens/assets/web/icons";
|
} from "@vector-im/compound-design-tokens/assets/web/icons";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
@@ -458,9 +458,9 @@ export const InCallView: FC<InCallViewProps> = ({
|
|||||||
useMemo(() => {
|
useMemo(() => {
|
||||||
if (audioOutputSwitcher === null) return null;
|
if (audioOutputSwitcher === null) return null;
|
||||||
const isEarpieceTarget = audioOutputSwitcher.targetOutput === "earpiece";
|
const isEarpieceTarget = audioOutputSwitcher.targetOutput === "earpiece";
|
||||||
const Icon = isEarpieceTarget ? EarpieceIcon : VolumeOnSolidIcon;
|
const Icon = isEarpieceTarget ? VoiceCallSolidIcon : VolumeOnSolidIcon;
|
||||||
const label = isEarpieceTarget
|
const label = isEarpieceTarget
|
||||||
? t("settings.devices.earpiece")
|
? t("settings.devices.handset")
|
||||||
: t("settings.devices.loudspeaker");
|
: t("settings.devices.loudspeaker");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -98,18 +98,30 @@ exports[`InCallView > rendering > renders 1`] = `
|
|||||||
width="1em"
|
width="1em"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
>
|
>
|
||||||
<path
|
<g
|
||||||
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"
|
clip-path="url(#a)"
|
||||||
/>
|
>
|
||||||
<path
|
<path
|
||||||
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"
|
clip-rule="evenodd"
|
||||||
/>
|
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"
|
||||||
|
fill-rule="evenodd"
|
||||||
|
/>
|
||||||
|
</g>
|
||||||
|
<defs>
|
||||||
|
<clippath
|
||||||
|
id="a"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M0 0h24v24H0z"
|
||||||
|
/>
|
||||||
|
</clippath>
|
||||||
|
</defs>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
<h2
|
<h2
|
||||||
class="_typography_6v6n8_153 _font-heading-md-semibold_6v6n8_112"
|
class="_typography_6v6n8_153 _font-heading-md-semibold_6v6n8_112"
|
||||||
>
|
>
|
||||||
Earpiece Mode
|
Handset Mode
|
||||||
</h2>
|
</h2>
|
||||||
<p
|
<p
|
||||||
class="_typography_6v6n8_153 _font-body-md-regular_6v6n8_50"
|
class="_typography_6v6n8_153 _font-body-md-regular_6v6n8_50"
|
||||||
@@ -125,6 +137,9 @@ exports[`InCallView > rendering > renders 1`] = `
|
|||||||
>
|
>
|
||||||
Back to Speaker Mode
|
Back to Speaker Mode
|
||||||
</button>
|
</button>
|
||||||
|
<div
|
||||||
|
class="spacer"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="container"
|
class="container"
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ export const DeviceSelection: FC<Props> = ({
|
|||||||
labelText = t("settings.devices.loudspeaker");
|
labelText = t("settings.devices.loudspeaker");
|
||||||
break;
|
break;
|
||||||
case "earpiece":
|
case "earpiece":
|
||||||
labelText = t("settings.devices.earpiece");
|
labelText = t("settings.devices.handset");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1048,7 +1048,7 @@ test("audio output changes when toggling earpiece mode", () => {
|
|||||||
|
|
||||||
window.controls.setAvailableAudioDevices([
|
window.controls.setAvailableAudioDevices([
|
||||||
{ id: "speaker", name: "Speaker", isSpeaker: true },
|
{ id: "speaker", name: "Speaker", isSpeaker: true },
|
||||||
{ id: "earpiece", name: "Earpiece", isEarpiece: true },
|
{ id: "earpiece", name: "Handset", isEarpiece: true },
|
||||||
{ id: "headphones", name: "Headphones" },
|
{ id: "headphones", name: "Headphones" },
|
||||||
]);
|
]);
|
||||||
window.controls.setAudioDevice("headphones");
|
window.controls.setAudioDevice("headphones");
|
||||||
|
|||||||
Reference in New Issue
Block a user