diff --git a/.gitignore b/.gitignore index d15cee0b..3e9016a6 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ dist-ssr public/config.json backend/synapse_tmp/* /coverage +config.json # Yarn yarn-error.log diff --git a/locales/de/app.json b/locales/de/app.json index 67aab44c..9ab56a26 100644 --- a/locales/de/app.json +++ b/locales/de/app.json @@ -175,7 +175,7 @@ "camera_numbered": "Kamera {{n}}", "default": "Standard", "default_named": "Standard<2> ({{name}} )", - "earpiece": "Ohrhörer", + "handset": "Ohrhörer", "microphone": "Mikrofon", "microphone_numbered": "Mikrofon{{n}}", "speaker": "Lautsprecher", diff --git a/locales/en/app.json b/locales/en/app.json index f7d7bf0b..96d89d70 100644 --- a/locales/en/app.json +++ b/locales/en/app.json @@ -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" }, "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": { "call_is_not_supported": "Call is not supported", "call_not_found": "Call not found", @@ -110,6 +105,11 @@ "knock_reject_heading": "Access denied", "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", "header_label": "Element Call Home", "header_participants_label": "Participants", @@ -181,7 +181,7 @@ "change_device_button": "Change audio device", "default": "Default", "default_named": "Default <2>({{name}})", - "earpiece": "Earpiece", + "handset": "Handset", "loudspeaker": "Loudspeaker", "microphone": "Microphone", "microphone_numbered": "Microphone {{n}}", diff --git a/src/AppBar.tsx b/src/AppBar.tsx index 337c31c5..e70bb50d 100644 --- a/src/AppBar.tsx +++ b/src/AppBar.tsx @@ -17,10 +17,7 @@ import { useState, } from "react"; import { Heading, IconButton, Tooltip } from "@vector-im/compound-web"; -import { - ArrowLeftIcon, - CollapseIcon, -} from "@vector-im/compound-design-tokens/assets/web/icons"; +import { CollapseIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; import { useTranslation } from "react-i18next"; import { Header, LeftNav, RightNav } from "./Header"; @@ -45,7 +42,6 @@ interface Props { */ export const AppBar: FC = ({ children }) => { const { t } = useTranslation(); - const BackIcon = platform === "ios" ? CollapseIcon : ArrowLeftIcon; const onBackClick = useCallback((e: MouseEvent) => { e.preventDefault(); window.controls.onBackButtonPressed?.(); @@ -69,7 +65,7 @@ export const AppBar: FC = ({ children }) => { - + diff --git a/src/__snapshots__/AppBar.test.tsx.snap b/src/__snapshots__/AppBar.test.tsx.snap index e7dc1c46..fe61d09b 100644 --- a/src/__snapshots__/AppBar.test.tsx.snap +++ b/src/__snapshots__/AppBar.test.tsx.snap @@ -32,7 +32,7 @@ exports[`AppBar > renders 1`] = ` xmlns="http://www.w3.org/2000/svg" > diff --git a/src/room/EarpieceOverlay.module.css b/src/room/EarpieceOverlay.module.css index 20760406..fd46d0e2 100644 --- a/src/room/EarpieceOverlay.module.css +++ b/src/room/EarpieceOverlay.module.css @@ -61,3 +61,7 @@ .overlay > p { text-align: center; } + +.spacer { + min-height: var(--cpd-space-32x); +} diff --git a/src/room/EarpieceOverlay.tsx b/src/room/EarpieceOverlay.tsx index 054e3083..14ce33cc 100644 --- a/src/room/EarpieceOverlay.tsx +++ b/src/room/EarpieceOverlay.tsx @@ -7,7 +7,7 @@ Please see LICENSE in the repository root for full details. import { type FC } from "react"; 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 styles from "./EarpieceOverlay.module.css"; @@ -22,12 +22,12 @@ export const EarpieceOverlay: FC = ({ show, onBackToVideoPressed }) => { return (
- + - {t("earpiece.overlay_title")} + {t("handset.overlay_title")} - {t("earpiece.overlay_description")} + {t("handset.overlay_description")} + {/* This spacer is used to give the overlay an offset to the top. */} +
); }; diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx index 74b738d9..f99e368b 100644 --- a/src/room/InCallView.tsx +++ b/src/room/InCallView.tsx @@ -29,7 +29,7 @@ import { useObservable } from "observable-hooks"; import { logger } from "matrix-js-sdk/lib/logger"; import { RoomAndToDeviceEvents } from "matrix-js-sdk/lib/matrixrtc/RoomAndToDeviceKeyTransport"; import { - EarpieceIcon, + VoiceCallSolidIcon, VolumeOnSolidIcon, } from "@vector-im/compound-design-tokens/assets/web/icons"; import { useTranslation } from "react-i18next"; @@ -458,9 +458,9 @@ export const InCallView: FC = ({ useMemo(() => { if (audioOutputSwitcher === null) return null; const isEarpieceTarget = audioOutputSwitcher.targetOutput === "earpiece"; - const Icon = isEarpieceTarget ? EarpieceIcon : VolumeOnSolidIcon; + const Icon = isEarpieceTarget ? VoiceCallSolidIcon : VolumeOnSolidIcon; const label = isEarpieceTarget - ? t("settings.devices.earpiece") + ? t("settings.devices.handset") : t("settings.devices.loudspeaker"); return ( diff --git a/src/room/__snapshots__/InCallView.test.tsx.snap b/src/room/__snapshots__/InCallView.test.tsx.snap index 5b5bd3e8..b45a30ad 100644 --- a/src/room/__snapshots__/InCallView.test.tsx.snap +++ b/src/room/__snapshots__/InCallView.test.tsx.snap @@ -98,18 +98,30 @@ exports[`InCallView > rendering > renders 1`] = ` width="1em" xmlns="http://www.w3.org/2000/svg" > - - + + + + + + + +

- Earpiece Mode + Handset Mode

rendering > renders 1`] = ` > Back to Speaker Mode +

= ({ labelText = t("settings.devices.loudspeaker"); break; case "earpiece": - labelText = t("settings.devices.earpiece"); + labelText = t("settings.devices.handset"); break; } diff --git a/src/state/CallViewModel.test.ts b/src/state/CallViewModel.test.ts index 0d09aa31..a3068c32 100644 --- a/src/state/CallViewModel.test.ts +++ b/src/state/CallViewModel.test.ts @@ -1048,7 +1048,7 @@ test("audio output changes when toggling earpiece mode", () => { window.controls.setAvailableAudioDevices([ { id: "speaker", name: "Speaker", isSpeaker: true }, - { id: "earpiece", name: "Earpiece", isEarpiece: true }, + { id: "earpiece", name: "Handset", isEarpiece: true }, { id: "headphones", name: "Headphones" }, ]); window.controls.setAudioDevice("headphones");