Skip to content

Commit 79c9563

Browse files
authored
Enable Element Call by default on release instances (#28313)
Update button label to say it is a Beta Signed-off-by: Michael Telatynski <[email protected]>
1 parent f4dc904 commit 79c9563

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

element.io/app/config.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,13 @@
4646
"map_style_url": "https://api.maptiler.com/maps/streets/style.json?key=fU3vlMsMn4Jb6dnEIFsx",
4747
"setting_defaults": {
4848
"RustCrypto.staged_rollout_percent": 60
49+
},
50+
"features": {
51+
"feature_video_rooms": true,
52+
"feature_group_calls": true,
53+
"feature_element_call_video_rooms": true
54+
},
55+
"element_call": {
56+
"url": "https://call.element.io"
4957
}
5058
}

res/css/views/rooms/_RoomHeader.pcss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,8 @@ Please see LICENSE files in the repository root for full details.
8888
.mx_RoomHeader .mx_BaseAvatar {
8989
flex-shrink: 0;
9090
}
91+
92+
.mx_RoomHeader_videoCallOption {
93+
/* Workaround for https://github.com/element-hq/compound/issues/331 */
94+
min-width: 240px;
95+
}

src/components/views/rooms/RoomHeader.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { useRoomMemberCount, useRoomMembers } from "../../../hooks/useRoomMember
2727
import { _t } from "../../../languageHandler";
2828
import { Flex } from "../../utils/Flex";
2929
import { Box } from "../../utils/Box";
30-
import { getPlatformCallTypeLabel, useRoomCall } from "../../../hooks/room/useRoomCall";
30+
import { getPlatformCallTypeChildren, getPlatformCallTypeLabel, useRoomCall } from "../../../hooks/room/useRoomCall";
3131
import { useRoomThreadNotifications } from "../../../hooks/room/useRoomThreadNotifications";
3232
import { useGlobalNotificationState } from "../../../hooks/useGlobalNotificationState";
3333
import SdkConfig from "../../../SdkConfig";
@@ -172,6 +172,8 @@ export default function RoomHeader({
172172
key={option}
173173
label={getPlatformCallTypeLabel(option)}
174174
aria-label={getPlatformCallTypeLabel(option)}
175+
children={getPlatformCallTypeChildren(option)}
176+
className="mx_RoomHeader_videoCallOption"
175177
onClick={(ev) => videoCallClick(ev, option)}
176178
Icon={VideoCallIcon}
177179
onSelect={() => {} /* Dummy handler since we want the click event.*/}

src/hooks/room/useRoomCall.ts renamed to src/hooks/room/useRoomCall.tsx

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

99
import { Room } from "matrix-js-sdk/src/matrix";
10-
import React, { useCallback, useEffect, useMemo, useState } from "react";
10+
import React, { ReactNode, useCallback, useEffect, useMemo, useState } from "react";
1111
import { CallType } from "matrix-js-sdk/src/webrtc/call";
1212

1313
import { useFeatureEnabled } from "../useSettings";
@@ -35,6 +35,7 @@ import { isVideoRoom } from "../../utils/video-rooms";
3535
import { useGuestAccessInformation } from "./useGuestAccessInformation";
3636
import SettingsStore from "../../settings/SettingsStore";
3737
import { UIFeature } from "../../settings/UIFeature";
38+
import { BetaPill } from "../../components/views/beta/BetaCard";
3839

3940
export enum PlatformCallType {
4041
ElementCall,
@@ -51,6 +52,14 @@ export const getPlatformCallTypeLabel = (platformCallType: PlatformCallType): st
5152
return _t("voip|legacy_call");
5253
}
5354
};
55+
export const getPlatformCallTypeChildren = (platformCallType: PlatformCallType): ReactNode => {
56+
switch (platformCallType) {
57+
case PlatformCallType.ElementCall:
58+
return <BetaPill />;
59+
default:
60+
return null;
61+
}
62+
};
5463
const enum State {
5564
NoCall,
5665
NoOneHere,

0 commit comments

Comments
 (0)