diff --git a/public/locales/en-GB/app.json b/public/locales/en-GB/app.json index f6a7ed65..84798e1e 100644 --- a/public/locales/en-GB/app.json +++ b/public/locales/en-GB/app.json @@ -22,7 +22,6 @@ "By clicking \"Join call now\", you agree to our <2>End User Licensing Agreement (EULA)": "By clicking \"Join call now\", you agree to our <2>End User Licensing Agreement (EULA)", "By participating in this beta, you consent to the collection of anonymous data, which we use to improve the product. You can find more information about which data we track in our <2>Privacy Policy and our <5>Cookie Policy.": "By participating in this beta, you consent to the collection of anonymous data, which we use to improve the product. You can find more information about which data we track in our <2>Privacy Policy and our <5>Cookie Policy.", "Call link copied": "Call link copied", - "Call type menu": "Call type menu", "Camera": "Camera", "Close": "Close", "Confirm password": "Confirm password", @@ -66,6 +65,7 @@ "Microphone off": "Microphone off", "Microphone on": "Microphone on", "More": "More", + "Name of call": "Name of call", "No": "No", "Not encrypted": "Not encrypted", "Not now, return to home screen": "Not now, return to home screen", @@ -96,6 +96,7 @@ "Sign out": "Sign out", "Speaker": "Speaker", "Spotlight": "Spotlight", + "Start new call": "Start new call", "Submit": "Submit", "Submit feedback": "Submit feedback", "Submitting…": "Submitting…", @@ -108,16 +109,11 @@ "Username": "Username", "Version: {{version}}": "Version: {{version}}", "Video": "Video", - "Video call": "Video call", - "Video call name": "Video call name", "Video off": "Video off", "Video on": "Video on", "Waiting for other participants…": "Waiting for other participants…", - "Walkie-talkie call": "Walkie-talkie call", - "Walkie-talkie call name": "Walkie-talkie call name", "Yes, join call": "Yes, join call", "You": "You", "You were disconnected from the call": "You were disconnected from the call", - "Your feedback": "Your feedback", - "Your recent calls": "Your recent calls" + "Your feedback": "Your feedback" } diff --git a/src/UrlParams.ts b/src/UrlParams.ts index e6f0cd05..6a2ea501 100644 --- a/src/UrlParams.ts +++ b/src/UrlParams.ts @@ -43,10 +43,6 @@ interface UrlParams { * Whether to hide the screen-sharing button. */ hideScreensharing: boolean; - /** - * Whether to start a walkie-talkie call instead of a video call. - */ - isPtt: boolean; /** * Whether to use end-to-end encryption. */ @@ -179,7 +175,6 @@ export const getUrlParams = ( preload: hasParam("preload"), hideHeader: hasParam("hideHeader"), hideScreensharing: hasParam("hideScreensharing"), - isPtt: hasParam("ptt"), e2eEnabled: getParam("enableE2e") !== "false", // Defaults to true userId: getParam("userId"), displayName: getParam("displayName"), diff --git a/src/home/CallTypeDropdown.module.css b/src/home/CallTypeDropdown.module.css deleted file mode 100644 index 6641fea0..00000000 --- a/src/home/CallTypeDropdown.module.css +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2022 New Vector Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -.label { - margin-bottom: 0; -} diff --git a/src/home/CallTypeDropdown.tsx b/src/home/CallTypeDropdown.tsx deleted file mode 100644 index f24d3d48..00000000 --- a/src/home/CallTypeDropdown.tsx +++ /dev/null @@ -1,85 +0,0 @@ -/* -Copyright 2022 New Vector Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { FC } from "react"; -import { Item } from "@react-stately/collections"; -import { useTranslation } from "react-i18next"; - -import { Headline } from "../typography/Typography"; -import { Button } from "../button"; -import { PopoverMenuTrigger } from "../popover/PopoverMenu"; -import { ReactComponent as VideoIcon } from "../icons/Video.svg"; -import { ReactComponent as MicIcon } from "../icons/Mic.svg"; -import { ReactComponent as CheckIcon } from "../icons/Check.svg"; -import styles from "./CallTypeDropdown.module.css"; -import commonStyles from "./common.module.css"; -import menuStyles from "../Menu.module.css"; -import { Menu } from "../Menu"; - -export enum CallType { - Video = "video", - Radio = "radio", -} - -interface Props { - callType: CallType; - setCallType: (value: CallType) => void; -} - -export const CallTypeDropdown: FC = ({ callType, setCallType }) => { - const { t } = useTranslation(); - - const onAction = (key: React.Key) => { - setCallType(key.toString() as CallType); - }; - - const onClose = () => {}; - - return ( - - - {(props: JSX.IntrinsicAttributes) => ( - - - - {t("Video call")} - {callType === CallType.Video && ( - - )} - - - - {t("Walkie-talkie call")} - {callType === CallType.Radio && ( - - )} - - - )} - - ); -}; diff --git a/src/home/HomePage.tsx b/src/home/HomePage.tsx index 018e0512..a78cb8bd 100644 --- a/src/home/HomePage.tsx +++ b/src/home/HomePage.tsx @@ -34,10 +34,7 @@ export function HomePage() { return ; } else { return clientState.authenticated ? ( - + ) : ( ); diff --git a/src/home/RegisteredView.tsx b/src/home/RegisteredView.tsx index 0f8cc93c..87c0a417 100644 --- a/src/home/RegisteredView.tsx +++ b/src/home/RegisteredView.tsx @@ -19,6 +19,7 @@ import { useHistory } from "react-router-dom"; import { MatrixClient } from "matrix-js-sdk/src/client"; import { randomString } from "matrix-js-sdk/src/randomstring"; import { useTranslation } from "react-i18next"; +import { Heading } from "@vector-im/compound-web"; import { createRoom, @@ -35,9 +36,8 @@ import { CallList } from "./CallList"; import { UserMenuContainer } from "../UserMenuContainer"; import { useModalTriggerState } from "../Modal"; import { JoinExistingCallModal } from "./JoinExistingCallModal"; -import { Caption, Title } from "../typography/Typography"; +import { Caption } from "../typography/Typography"; import { Form } from "../form/Form"; -import { CallType, CallTypeDropdown } from "./CallTypeDropdown"; import { useEnableE2EE, useOptInAnalytics } from "../settings/useSetting"; import { AnalyticsNotice } from "../analytics/AnalyticsNotice"; import { E2EEBanner } from "../E2EEBanner"; @@ -46,11 +46,9 @@ import { getRoomSharedKeyLocalStorageKey } from "../e2ee/sharedKeyManagement"; interface Props { client: MatrixClient; - isPasswordlessUser: boolean; } -export function RegisteredView({ client, isPasswordlessUser }: Props) { - const [callType, setCallType] = useState(CallType.Video); +export function RegisteredView({ client }: Props) { const [loading, setLoading] = useState(false); const [error, setError] = useState(); const [optInAnalytics] = useOptInAnalytics(); @@ -68,14 +66,13 @@ export function RegisteredView({ client, isPasswordlessUser }: Props) { typeof roomNameData === "string" ? sanitiseRoomNameInput(roomNameData) : ""; - const ptt = callType === CallType.Radio; async function submit() { setError(undefined); setLoading(true); const roomId = ( - await createRoom(client, roomName, ptt, e2eeEnabled ?? false) + await createRoom(client, roomName, e2eeEnabled ?? false) )[1]; if (e2eeEnabled) { @@ -101,7 +98,7 @@ export function RegisteredView({ client, isPasswordlessUser }: Props) { } }); }, - [client, history, modalState, callType, e2eeEnabled] + [client, history, modalState, e2eeEnabled] ); const recentRooms = useGroupCallRooms(client); @@ -111,11 +108,6 @@ export function RegisteredView({ client, isPasswordlessUser }: Props) { history.push(`/${existingAlias}`); }, [history, existingAlias]); - const callNameLabel = - callType === CallType.Video - ? t("Video call name") - : t("Walkie-talkie call name"); - return ( <>
@@ -129,14 +121,16 @@ export function RegisteredView({ client, isPasswordlessUser }: Props) {
- + + {t("Start new call")} +
{recentRooms.length > 0 && ( - <> - - {t("Your recent calls")} - - - + )}
diff --git a/src/home/UnauthenticatedView.tsx b/src/home/UnauthenticatedView.tsx index 721c56d1..fb3a3445 100644 --- a/src/home/UnauthenticatedView.tsx +++ b/src/home/UnauthenticatedView.tsx @@ -18,6 +18,7 @@ import { FC, useCallback, useState, FormEventHandler } from "react"; import { useHistory } from "react-router-dom"; import { randomString } from "matrix-js-sdk/src/randomstring"; import { Trans, useTranslation } from "react-i18next"; +import { Heading } from "@vector-im/compound-web"; import { useClient } from "../ClientContext"; import { Header, HeaderLogo, LeftNav, RightNav } from "../Header"; @@ -35,7 +36,6 @@ import { JoinExistingCallModal } from "./JoinExistingCallModal"; import { useRecaptcha } from "../auth/useRecaptcha"; import { Body, Caption, Link } from "../typography/Typography"; import { Form } from "../form/Form"; -import { CallType, CallTypeDropdown } from "./CallTypeDropdown"; import styles from "./UnauthenticatedView.module.css"; import commonStyles from "./common.module.css"; import { generateRandomName } from "../auth/generateRandomName"; @@ -48,7 +48,6 @@ import { setLocalStorageItem } from "../useLocalStorage"; export const UnauthenticatedView: FC = () => { const { setClient } = useClient(); - const [callType, setCallType] = useState(CallType.Video); const [loading, setLoading] = useState(false); const [error, setError] = useState(); const [optInAnalytics] = useOptInAnalytics(); @@ -68,7 +67,6 @@ export const UnauthenticatedView: FC = () => { const data = new FormData(e.target as HTMLFormElement); const roomName = sanitiseRoomNameInput(data.get("callName") as string); const displayName = data.get("displayName") as string; - const ptt = callType === CallType.Radio; async function submit() { setError(undefined); @@ -86,7 +84,7 @@ export const UnauthenticatedView: FC = () => { let roomId: string; try { roomId = ( - await createRoom(client, roomName, ptt, e2eeEnabled ?? false) + await createRoom(client, roomName, e2eeEnabled ?? false) )[1]; if (e2eeEnabled) { @@ -133,23 +131,9 @@ export const UnauthenticatedView: FC = () => { reset(); }); }, - [ - register, - reset, - execute, - history, - callType, - modalState, - setClient, - e2eeEnabled, - ] + [register, reset, execute, history, modalState, setClient, e2eeEnabled] ); - const callNameLabel = - callType === CallType.Video - ? t("Video call name") - : t("Walkie-talkie call name"); - return ( <>
@@ -163,14 +147,16 @@ export const UnauthenticatedView: FC = () => {
- + + {t("Start new call")} + { logger.log(`Creating room for group call`); @@ -327,14 +326,12 @@ export async function createRoom( const result = await createPromise; - logger.log( - `Creating ${ptt ? "PTT" : "video"} group call in ${result.room_id}` - ); + logger.log(`Creating group call in ${result.room_id}`); await client.createGroupCall( result.room_id, - ptt ? GroupCallType.Voice : GroupCallType.Video, - ptt, + GroupCallType.Video, + false, GroupCallIntent.Room, true ); diff --git a/src/room/GroupCallLoader.tsx b/src/room/GroupCallLoader.tsx index 78fa780c..5f71f203 100644 --- a/src/room/GroupCallLoader.tsx +++ b/src/room/GroupCallLoader.tsx @@ -27,7 +27,6 @@ interface Props { roomIdOrAlias: string; viaServers: string[]; children: (rtcSession: MatrixRTCSession) => ReactNode; - createPtt: boolean; } export function GroupCallLoader({ @@ -35,15 +34,9 @@ export function GroupCallLoader({ roomIdOrAlias, viaServers, children, - createPtt, }: Props): JSX.Element { const { t } = useTranslation(); - const groupCallState = useLoadGroupCall( - client, - roomIdOrAlias, - viaServers, - createPtt - ); + const groupCallState = useLoadGroupCall(client, roomIdOrAlias, viaServers); switch (groupCallState.kind) { case "loading": diff --git a/src/room/RoomPage.tsx b/src/room/RoomPage.tsx index 50156e70..c7eed871 100644 --- a/src/room/RoomPage.tsx +++ b/src/room/RoomPage.tsx @@ -35,7 +35,6 @@ export const RoomPage: FC = () => { isEmbedded, preload, hideHeader, - isPtt, displayName, } = useUrlParams(); const roomIdOrAlias = roomId ?? roomAlias; @@ -107,7 +106,6 @@ export const RoomPage: FC = () => { client={client} roomIdOrAlias={roomIdOrAlias} viaServers={viaServers} - createPtt={isPtt} > {groupCallView} diff --git a/src/room/useLoadGroupCall.ts b/src/room/useLoadGroupCall.ts index 9218bf32..e6f79ced 100644 --- a/src/room/useLoadGroupCall.ts +++ b/src/room/useLoadGroupCall.ts @@ -56,8 +56,7 @@ export interface GroupCallLoadState { export const useLoadGroupCall = ( client: MatrixClient, roomIdOrAlias: string, - viaServers: string[], - createPtt: boolean + viaServers: string[] ): GroupCallStatus => { const { t } = useTranslation(); const [state, setState] = useState({ kind: "loading" }); @@ -101,7 +100,6 @@ export const useLoadGroupCall = ( const [, roomId] = await createRoom( client, roomNameFromRoomId(roomIdOrAlias), - createPtt, e2eeEnabled ?? false ); @@ -151,7 +149,7 @@ export const useLoadGroupCall = ( .then(fetchOrCreateGroupCall) .then((rtcSession) => setState({ kind: "loaded", rtcSession })) .catch((error) => setState({ kind: "failed", error })); - }, [client, roomIdOrAlias, viaServers, createPtt, t, e2eeEnabled]); + }, [client, roomIdOrAlias, viaServers, t, e2eeEnabled]); return state; };