@100mslive/roomkit-react 0.3.22-alpha.3 → 0.3.22-alpha.5
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Accordion/Accordion.d.ts +322 -134
- package/dist/Accordion/index.d.ts +322 -134
- package/dist/Avatar/Avatar.d.ts +141 -47
- package/dist/Button/Button.d.ts +141 -47
- package/dist/Checkbox/Checkbox.d.ts +322 -134
- package/dist/Collapsible/Collapsible.d.ts +483 -201
- package/dist/Divider/Divider.d.ts +322 -134
- package/dist/Dropdown/Dropdown.d.ts +1932 -804
- package/dist/Fieldset/Fieldset.d.ts +141 -47
- package/dist/Footer/Footer.d.ts +1288 -536
- package/dist/{PDFView-RMR33QH4.css → HLSView-CNAJ5SBZ.css} +3 -3
- package/dist/{LeaveScreen-ZAG5UJZL.css.map → HLSView-CNAJ5SBZ.css.map} +1 -1
- package/dist/{HLSView-EYGGK6BH.js → HLSView-YIWJTBCT.js} +24 -38
- package/dist/HLSView-YIWJTBCT.js.map +7 -0
- package/dist/IconButton/IconButton.d.ts +141 -47
- package/dist/Input/Input.d.ts +926 -362
- package/dist/Label/Label.d.ts +141 -47
- package/dist/Layout/Box.d.ts +141 -47
- package/dist/Layout/Flex.d.ts +141 -47
- package/dist/Link/Link.d.ts +141 -47
- package/dist/Modal/Dialog.d.ts +987 -329
- package/dist/Modal/DialogContent.d.ts +1127 -469
- package/dist/Pagination/StyledPagination.d.ts +644 -268
- package/dist/Popover/index.d.ts +483 -201
- package/dist/Prebuilt/IconButton.d.ts +322 -134
- package/dist/Prebuilt/components/Chat/ChatBody.d.ts +322 -134
- package/dist/Prebuilt/components/Leave/LeaveAtoms.d.ts +805 -335
- package/dist/Prebuilt/components/Settings/common.d.ts +322 -134
- package/dist/Progress/index.d.ts +322 -134
- package/dist/RadioGroup/RadioGroup.d.ts +483 -201
- package/dist/ReactSelect/ReactSelect.d.ts +1610 -670
- package/dist/Select/Select.d.ts +483 -201
- package/dist/Sheet/Sheet.d.ts +987 -329
- package/dist/Slider/Slider.d.ts +141 -47
- package/dist/Stats/StyledStats.d.ts +966 -402
- package/dist/Switch/Switch.d.ts +141 -47
- package/dist/Tabs/Tabs.d.ts +644 -268
- package/dist/Text/Text.d.ts +141 -47
- package/dist/TextArea/TextArea.d.ts +141 -47
- package/dist/Theme/base.config.d.ts +78 -26
- package/dist/Theme/stitches.config.d.ts +1514 -1067
- package/dist/TileMenu/StyledMenuTile.d.ts +1127 -469
- package/dist/Toast/Toast.d.ts +946 -382
- package/dist/Video/Video.d.ts +141 -47
- package/dist/VideoList/StyledVideoList.d.ts +483 -201
- package/dist/VideoTile/StyledVideoTile.d.ts +1610 -670
- package/dist/chunk-4UCH4XSJ.js +34759 -0
- package/dist/chunk-4UCH4XSJ.js.map +7 -0
- package/dist/index.cjs.css +2 -2
- package/dist/index.cjs.css.map +1 -1
- package/dist/index.cjs.js +22367 -22558
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/index.js +15 -25
- package/dist/meta.cjs.json +5076 -5434
- package/dist/meta.esbuild.json +6290 -9146
- package/package.json +8 -8
- package/src/Avatar/Avatar.tsx +1 -1
- package/src/Popover/Popover.stories.tsx +1 -1
- package/src/Prebuilt/App.tsx +2 -6
- package/src/Prebuilt/components/Chat/Chat.tsx +8 -12
- package/src/Prebuilt/components/Chat/ChatFooter.tsx +1 -1
- package/src/Prebuilt/components/Notifications/Notifications.tsx +171 -13
- package/src/Prebuilt/components/Notifications/PeerNotifications.tsx +2 -9
- package/src/Prebuilt/components/Notifications/ReconnectNotifications.tsx +5 -1
- package/src/Prebuilt/components/Notifications/TrackBulkUnmuteModal.tsx +5 -7
- package/src/Prebuilt/components/Notifications/TrackNotifications.tsx +1 -23
- package/src/Prebuilt/components/Notifications/TrackUnmuteModal.tsx +5 -13
- package/src/Prebuilt/components/StatsForNerds.jsx +3 -32
- package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +31 -43
- package/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +2 -2
- package/src/Prebuilt/components/VirtualBackground/VBOption.tsx +1 -3
- package/src/Prebuilt/components/VirtualBackground/VBPicker.tsx +0 -6
- package/src/Prebuilt/layouts/HLSView.jsx +0 -1
- package/src/Prebuilt/layouts/PDFView.jsx +0 -1
- package/src/Prebuilt/layouts/SidePane.tsx +6 -12
- package/src/Prebuilt/layouts/VideoStreamingSection.tsx +34 -35
- package/dist/ConferenceScreen-CSVWECB5.js +0 -1778
- package/dist/ConferenceScreen-CSVWECB5.js.map +0 -7
- package/dist/ConferenceScreen-YRURU3RV.css +0 -2780
- package/dist/ConferenceScreen-YRURU3RV.css.map +0 -7
- package/dist/EmbedView-N2E4DZQA.js +0 -17
- package/dist/EmbedView-N2E4DZQA.js.map +0 -7
- package/dist/EmbedView-S54NTHF5.css +0 -2780
- package/dist/EmbedView-S54NTHF5.css.map +0 -7
- package/dist/EmojiReaction-3X4ST4AU.js +0 -11
- package/dist/EmojiReaction-3X4ST4AU.js.map +0 -7
- package/dist/HLSView-EYGGK6BH.js.map +0 -7
- package/dist/HLSView-LBTFLMI4.css +0 -2780
- package/dist/HLSView-LBTFLMI4.css.map +0 -7
- package/dist/LeaveScreen-D6XU64JL.js +0 -556
- package/dist/LeaveScreen-D6XU64JL.js.map +0 -7
- package/dist/LeaveScreen-ZAG5UJZL.css +0 -2780
- package/dist/MoreSettings-R7B4BSNT.css +0 -2780
- package/dist/MoreSettings-R7B4BSNT.css.map +0 -7
- package/dist/MoreSettings-TBJVM7OY.js +0 -16
- package/dist/MoreSettings-TBJVM7OY.js.map +0 -7
- package/dist/PDFView-JOIJDP65.js +0 -84
- package/dist/PDFView-JOIJDP65.js.map +0 -7
- package/dist/PDFView-RMR33QH4.css.map +0 -7
- package/dist/Polls-IN3V2HFI.js +0 -1584
- package/dist/Polls-IN3V2HFI.js.map +0 -7
- package/dist/Polls-JW7JWGTE.css +0 -2780
- package/dist/Polls-JW7JWGTE.css.map +0 -7
- package/dist/Prebuilt/components/Notifications/DeviceChangeNotifications.d.ts +0 -1
- package/dist/Prebuilt/components/Notifications/ErrorNotifications.d.ts +0 -1
- package/dist/Prebuilt/components/Notifications/MessageNotifications.d.ts +0 -1
- package/dist/Prebuilt/components/Notifications/PollNotificationModal.d.ts +0 -1
- package/dist/Prebuilt/components/Notifications/RoleChangeNotification.d.ts +0 -1
- package/dist/RaiseHand-WES4KKMD.js +0 -10
- package/dist/RaiseHand-WES4KKMD.js.map +0 -7
- package/dist/RoleProminence-4ZBDBCMU.css +0 -2780
- package/dist/RoleProminence-4ZBDBCMU.css.map +0 -7
- package/dist/RoleProminence-PB32DLIB.js +0 -116
- package/dist/RoleProminence-PB32DLIB.js.map +0 -7
- package/dist/RoomDetailsPane-CZH2SNLE.js +0 -53
- package/dist/RoomDetailsPane-CZH2SNLE.js.map +0 -7
- package/dist/RoomDetailsPane-XWH2KEFI.css +0 -2780
- package/dist/RoomDetailsPane-XWH2KEFI.css.map +0 -7
- package/dist/ScreenshareLayout-XVENPVK3.js +0 -358
- package/dist/ScreenshareLayout-XVENPVK3.js.map +0 -7
- package/dist/ScreenshareLayout-YUW3KHAB.css +0 -2780
- package/dist/ScreenshareLayout-YUW3KHAB.css.map +0 -7
- package/dist/SidePaneTabs-QXCDHOGG.js +0 -1354
- package/dist/SidePaneTabs-QXCDHOGG.js.map +0 -7
- package/dist/SidePaneTabs-WQGVOWRP.css +0 -2780
- package/dist/SidePaneTabs-WQGVOWRP.css.map +0 -7
- package/dist/VBPicker-XN74N67R.js +0 -322
- package/dist/VBPicker-XN74N67R.js.map +0 -7
- package/dist/VBPicker-YDM2YIOM.css +0 -2780
- package/dist/VBPicker-YDM2YIOM.css.map +0 -7
- package/dist/WaitingView-77PRTIBV.js +0 -10
- package/dist/WaitingView-77PRTIBV.js.map +0 -7
- package/dist/WhiteboardLayout-FZC7SOSG.js +0 -96
- package/dist/WhiteboardLayout-FZC7SOSG.js.map +0 -7
- package/dist/WhiteboardLayout-MNTUWEVK.css +0 -2780
- package/dist/WhiteboardLayout-MNTUWEVK.css.map +0 -7
- package/dist/android-perm-1.png +0 -0
- package/dist/audio-level.png +0 -0
- package/dist/chunk-26D5FDBW.js +0 -16812
- package/dist/chunk-26D5FDBW.js.map +0 -7
- package/dist/chunk-2J5WS52X.js +0 -2595
- package/dist/chunk-2J5WS52X.js.map +0 -7
- package/dist/chunk-2LWOQMYY.js +0 -30
- package/dist/chunk-2LWOQMYY.js.map +0 -7
- package/dist/chunk-3MRQJSIY.js +0 -171
- package/dist/chunk-3MRQJSIY.js.map +0 -7
- package/dist/chunk-4X4WB7X3.js +0 -98
- package/dist/chunk-4X4WB7X3.js.map +0 -7
- package/dist/chunk-7QZJMUHM.js +0 -90
- package/dist/chunk-7QZJMUHM.js.map +0 -7
- package/dist/chunk-ABCV7TX5.js +0 -71
- package/dist/chunk-ABCV7TX5.js.map +0 -7
- package/dist/chunk-BQOT4DK7.js +0 -418
- package/dist/chunk-BQOT4DK7.js.map +0 -7
- package/dist/chunk-ENHSO6YN.js +0 -6337
- package/dist/chunk-ENHSO6YN.js.map +0 -7
- package/dist/chunk-JKWX7W4K.js +0 -161
- package/dist/chunk-JKWX7W4K.js.map +0 -7
- package/dist/chunk-LO4BXA4G.js +0 -114
- package/dist/chunk-LO4BXA4G.js.map +0 -7
- package/dist/chunk-MRVWNFXC.js +0 -59
- package/dist/chunk-MRVWNFXC.js.map +0 -7
- package/dist/chunk-OA4HW7HW.js +0 -262
- package/dist/chunk-OA4HW7HW.js.map +0 -7
- package/dist/chunk-PJQSPAFZ.js +0 -178
- package/dist/chunk-PJQSPAFZ.js.map +0 -7
- package/dist/chunk-QHQKY35W.js +0 -830
- package/dist/chunk-QHQKY35W.js.map +0 -7
- package/dist/chunk-QKXHQ6DV.js +0 -254
- package/dist/chunk-QKXHQ6DV.js.map +0 -7
- package/dist/chunk-RTWNTT77.js +0 -62
- package/dist/chunk-RTWNTT77.js.map +0 -7
- package/dist/chunk-TBXRX6MK.js +0 -576
- package/dist/chunk-TBXRX6MK.js.map +0 -7
- package/dist/chunk-TCOPR3BK.js +0 -487
- package/dist/chunk-TCOPR3BK.js.map +0 -7
- package/dist/chunk-VKORP2LF.js +0 -41
- package/dist/chunk-VKORP2LF.js.map +0 -7
- package/dist/chunk-YYVDCP5Z.js +0 -136
- package/dist/chunk-YYVDCP5Z.js.map +0 -7
- package/dist/empty-chat.svg +0 -12
- package/dist/ios-perm-0.png +0 -0
- package/dist/pdf-share.png +0 -0
- package/dist/screen-share.png +0 -0
- package/dist/transaction_error.svg +0 -12
- package/src/Prebuilt/components/Notifications/DeviceChangeNotifications.tsx +0 -18
- package/src/Prebuilt/components/Notifications/ErrorNotifications.tsx +0 -56
- package/src/Prebuilt/components/Notifications/MessageNotifications.tsx +0 -24
- package/src/Prebuilt/components/Notifications/PollNotificationModal.tsx +0 -71
- package/src/Prebuilt/components/Notifications/RoleChangeNotification.tsx +0 -24
package/dist/chunk-VKORP2LF.js
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
import {
|
2
|
-
useMyMetadata
|
3
|
-
} from "./chunk-RTWNTT77.js";
|
4
|
-
import {
|
5
|
-
IconButton_default,
|
6
|
-
Tooltip,
|
7
|
-
useRoomLayoutConferencingScreen
|
8
|
-
} from "./chunk-ENHSO6YN.js";
|
9
|
-
import {
|
10
|
-
__async,
|
11
|
-
init_define_process_env
|
12
|
-
} from "./chunk-TBXRX6MK.js";
|
13
|
-
|
14
|
-
// src/Prebuilt/components/RaiseHand.tsx
|
15
|
-
init_define_process_env();
|
16
|
-
import React from "react";
|
17
|
-
import { HandIcon, HandRaiseSlashedIcon } from "@100mslive/react-icons";
|
18
|
-
var RaiseHand = ({ css }) => {
|
19
|
-
const { isHandRaised, toggleHandRaise } = useMyMetadata();
|
20
|
-
const { elements } = useRoomLayoutConferencingScreen();
|
21
|
-
if (!elements.hand_raise) {
|
22
|
-
return null;
|
23
|
-
}
|
24
|
-
return /* @__PURE__ */ React.createElement(Tooltip, { title: isHandRaised ? "Lower hand" : "Raise hand" }, /* @__PURE__ */ React.createElement(
|
25
|
-
IconButton_default,
|
26
|
-
{
|
27
|
-
"data-testid": "hand_raise_btn",
|
28
|
-
css,
|
29
|
-
active: !isHandRaised,
|
30
|
-
onClick: () => __async(void 0, null, function* () {
|
31
|
-
return yield toggleHandRaise();
|
32
|
-
})
|
33
|
-
},
|
34
|
-
isHandRaised ? /* @__PURE__ */ React.createElement(HandRaiseSlashedIcon, null) : /* @__PURE__ */ React.createElement(HandIcon, null)
|
35
|
-
));
|
36
|
-
};
|
37
|
-
|
38
|
-
export {
|
39
|
-
RaiseHand
|
40
|
-
};
|
41
|
-
//# sourceMappingURL=chunk-VKORP2LF.js.map
|
@@ -1,7 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"version": 3,
|
3
|
-
"sources": ["../src/Prebuilt/components/RaiseHand.tsx"],
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { HandIcon, HandRaiseSlashedIcon } from '@100mslive/react-icons';\nimport { CSS } from '../../Theme';\nimport { Tooltip } from '../../Tooltip';\n// @ts-ignore: No implicit Any\nimport IconButton from '../IconButton';\nimport { useRoomLayoutConferencingScreen } from '../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';\nimport { useMyMetadata } from './hooks/useMetadata';\n\nexport const RaiseHand = ({ css }: { css?: CSS }) => {\n const { isHandRaised, toggleHandRaise } = useMyMetadata();\n const { elements } = useRoomLayoutConferencingScreen();\n\n if (!elements.hand_raise) {\n return null;\n }\n\n return (\n <Tooltip title={isHandRaised ? 'Lower hand' : 'Raise hand'}>\n <IconButton\n data-testid=\"hand_raise_btn\"\n css={css}\n active={!isHandRaised}\n onClick={async () => await toggleHandRaise()}\n >\n {isHandRaised ? <HandRaiseSlashedIcon /> : <HandIcon />}\n </IconButton>\n </Tooltip>\n );\n};\n"],
|
5
|
-
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA,OAAO,WAAW;AAClB,SAAS,UAAU,4BAA4B;AAQxC,IAAM,YAAY,CAAC,EAAE,IAAI,MAAqB;AACnD,QAAM,EAAE,cAAc,gBAAgB,IAAI,cAAc;AACxD,QAAM,EAAE,SAAS,IAAI,gCAAgC;AAErD,MAAI,CAAC,SAAS,YAAY;AACxB,WAAO;AAAA,EACT;AAEA,SACE,oCAAC,WAAQ,OAAO,eAAe,eAAe,gBAC5C;AAAA,IAAC;AAAA;AAAA,MACC,eAAY;AAAA,MACZ;AAAA,MACA,QAAQ,CAAC;AAAA,MACT,SAAS,MAAS;AAAG,qBAAM,gBAAgB;AAAA;AAAA;AAAA,IAE1C,eAAe,oCAAC,0BAAqB,IAAK,oCAAC,cAAS;AAAA,EACvD,CACF;AAEJ;",
|
6
|
-
"names": []
|
7
|
-
}
|
package/dist/chunk-YYVDCP5Z.js
DELETED
@@ -1,136 +0,0 @@
|
|
1
|
-
import {
|
2
|
-
useVideoTileContext
|
3
|
-
} from "./chunk-PJQSPAFZ.js";
|
4
|
-
import {
|
5
|
-
AudioVideoToggle,
|
6
|
-
VideoTile_default
|
7
|
-
} from "./chunk-26D5FDBW.js";
|
8
|
-
import {
|
9
|
-
Text
|
10
|
-
} from "./chunk-JKWX7W4K.js";
|
11
|
-
import {
|
12
|
-
Box,
|
13
|
-
Flex
|
14
|
-
} from "./chunk-7QZJMUHM.js";
|
15
|
-
import {
|
16
|
-
IconButton_default,
|
17
|
-
useSetAppDataByKey
|
18
|
-
} from "./chunk-ENHSO6YN.js";
|
19
|
-
import {
|
20
|
-
APP_DATA,
|
21
|
-
__spreadProps,
|
22
|
-
__spreadValues,
|
23
|
-
config,
|
24
|
-
init_define_process_env
|
25
|
-
} from "./chunk-TBXRX6MK.js";
|
26
|
-
|
27
|
-
// src/Prebuilt/components/InsetTile.tsx
|
28
|
-
init_define_process_env();
|
29
|
-
import React, { useEffect, useRef } from "react";
|
30
|
-
import Draggable from "react-draggable";
|
31
|
-
import { useMedia } from "react-use";
|
32
|
-
import {
|
33
|
-
selectIsAllowedToPublish,
|
34
|
-
selectLocalPeer,
|
35
|
-
selectPeerByID,
|
36
|
-
selectVideoTrackByID,
|
37
|
-
useHMSStore
|
38
|
-
} from "@100mslive/react-sdk";
|
39
|
-
import { ExpandIcon } from "@100mslive/react-icons";
|
40
|
-
var MinimisedTile = ({ setMinimised }) => {
|
41
|
-
return /* @__PURE__ */ React.createElement(Flex, { align: "center", css: { gap: "$6", r: "$1", bg: "$surface_default", p: "$4", color: "$on_surface_high" } }, /* @__PURE__ */ React.createElement(AudioVideoToggle, { hideOptions: true }), /* @__PURE__ */ React.createElement(Text, null, "You"), /* @__PURE__ */ React.createElement(
|
42
|
-
IconButton_default,
|
43
|
-
{
|
44
|
-
className: "__cancel-drag-event",
|
45
|
-
onClick: () => setMinimised(false),
|
46
|
-
css: { bg: "transparent", border: "transparent" }
|
47
|
-
},
|
48
|
-
/* @__PURE__ */ React.createElement(ExpandIcon, null)
|
49
|
-
));
|
50
|
-
};
|
51
|
-
var insetHeightPx = 180;
|
52
|
-
var insetMaxWidthPx = 240;
|
53
|
-
var defaultMobileAspectRatio = 9 / 16;
|
54
|
-
var desktopAspectRatio = 1 / defaultMobileAspectRatio;
|
55
|
-
var InsetTile = ({ peerId }) => {
|
56
|
-
const isMobile = useMedia(config.media.md);
|
57
|
-
const isLandscape = useMedia(config.media.ls);
|
58
|
-
const selector = peerId ? selectPeerByID(peerId) : selectLocalPeer;
|
59
|
-
const peer = useHMSStore(selector);
|
60
|
-
const [minimised, setMinimised] = useSetAppDataByKey(APP_DATA.minimiseInset);
|
61
|
-
const videoTrack = useHMSStore(selectVideoTrackByID(peer == null ? void 0 : peer.videoTrack));
|
62
|
-
const isAllowedToPublish = useHMSStore(selectIsAllowedToPublish);
|
63
|
-
const videoTileProps = useVideoTileContext();
|
64
|
-
let aspectRatio = isMobile ? defaultMobileAspectRatio : desktopAspectRatio;
|
65
|
-
if ((videoTrack == null ? void 0 : videoTrack.width) && (videoTrack == null ? void 0 : videoTrack.height) && !isMobile) {
|
66
|
-
aspectRatio = videoTrack.width / videoTrack.height;
|
67
|
-
}
|
68
|
-
let height = insetHeightPx;
|
69
|
-
let width = height * aspectRatio;
|
70
|
-
if (isLandscape && width > insetMaxWidthPx) {
|
71
|
-
width = 240;
|
72
|
-
height = width / aspectRatio;
|
73
|
-
}
|
74
|
-
const nodeRef = useRef(null);
|
75
|
-
useEffect(() => {
|
76
|
-
const node = nodeRef.current;
|
77
|
-
if (!node || !window.ResizeObserver) {
|
78
|
-
return;
|
79
|
-
}
|
80
|
-
const resizeObserver = new ResizeObserver((entries) => {
|
81
|
-
entries.forEach((entry) => {
|
82
|
-
if (entry.target === node.parentElement) {
|
83
|
-
node.style.transform = `translate(0,0)`;
|
84
|
-
}
|
85
|
-
});
|
86
|
-
});
|
87
|
-
node.parentElement && resizeObserver.observe(node.parentElement);
|
88
|
-
return () => {
|
89
|
-
(node == null ? void 0 : node.parentElement) && (resizeObserver == null ? void 0 : resizeObserver.unobserve(node.parentElement));
|
90
|
-
resizeObserver == null ? void 0 : resizeObserver.disconnect();
|
91
|
-
};
|
92
|
-
}, []);
|
93
|
-
if (!isAllowedToPublish.video && !isAllowedToPublish.audio) {
|
94
|
-
return null;
|
95
|
-
}
|
96
|
-
return /* @__PURE__ */ React.createElement(Draggable, { bounds: "parent", nodeRef, cancel: ".__cancel-drag-event" }, /* @__PURE__ */ React.createElement(
|
97
|
-
Box,
|
98
|
-
{
|
99
|
-
ref: nodeRef,
|
100
|
-
css: __spreadValues({
|
101
|
-
position: "absolute",
|
102
|
-
bottom: 0,
|
103
|
-
right: 0,
|
104
|
-
zIndex: 10,
|
105
|
-
boxShadow: "0 0 8px 0 rgba(0,0,0,0.3)",
|
106
|
-
r: "$2"
|
107
|
-
}, !minimised ? {
|
108
|
-
aspectRatio,
|
109
|
-
h: height
|
110
|
-
} : {})
|
111
|
-
},
|
112
|
-
minimised ? /* @__PURE__ */ React.createElement(MinimisedTile, { setMinimised }) : /* @__PURE__ */ React.createElement(
|
113
|
-
VideoTile_default,
|
114
|
-
__spreadProps(__spreadValues({
|
115
|
-
peerId: peer == null ? void 0 : peer.id,
|
116
|
-
trackId: peer == null ? void 0 : peer.videoTrack,
|
117
|
-
rootCSS: {
|
118
|
-
size: "100%",
|
119
|
-
padding: 0
|
120
|
-
},
|
121
|
-
width,
|
122
|
-
height,
|
123
|
-
containerCSS: { background: "$surface_default" },
|
124
|
-
canMinimise: true,
|
125
|
-
isDragabble: true
|
126
|
-
}, videoTileProps), {
|
127
|
-
hideParticipantNameOnTile: true
|
128
|
-
})
|
129
|
-
)
|
130
|
-
));
|
131
|
-
};
|
132
|
-
|
133
|
-
export {
|
134
|
-
InsetTile
|
135
|
-
};
|
136
|
-
//# sourceMappingURL=chunk-YYVDCP5Z.js.map
|
@@ -1,7 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"version": 3,
|
3
|
-
"sources": ["../src/Prebuilt/components/InsetTile.tsx"],
|
4
|
-
"sourcesContent": ["import React, { useEffect, useRef } from 'react';\nimport Draggable from 'react-draggable';\nimport { useMedia } from 'react-use';\nimport {\n selectIsAllowedToPublish,\n selectLocalPeer,\n selectPeerByID,\n selectVideoTrackByID,\n useHMSStore,\n} from '@100mslive/react-sdk';\nimport { ExpandIcon } from '@100mslive/react-icons';\nimport { Box, Flex } from '../../Layout';\nimport { Text } from '../../Text';\nimport { config as cssConfig } from '../../Theme';\n// @ts-ignore: No implicit Any\nimport IconButton from '../IconButton';\n// @ts-ignore: No implicit Any\nimport { AudioVideoToggle } from './AudioVideoToggle';\n// @ts-ignore: No implicit Any\nimport VideoTile from './VideoTile';\n// @ts-ignore: No implicit Any\nimport { useSetAppDataByKey } from './AppData/useUISettings';\nimport { useVideoTileContext } from './hooks/useVideoTileLayout';\n// @ts-ignore: No implicit Any\nimport { APP_DATA } from '../common/constants';\n\nconst MinimisedTile = ({ setMinimised }: { setMinimised: (value: boolean) => void }) => {\n return (\n <Flex align=\"center\" css={{ gap: '$6', r: '$1', bg: '$surface_default', p: '$4', color: '$on_surface_high' }}>\n <AudioVideoToggle hideOptions={true} />\n <Text>You</Text>\n <IconButton\n className=\"__cancel-drag-event\"\n onClick={() => setMinimised(false)}\n css={{ bg: 'transparent', border: 'transparent' }}\n >\n <ExpandIcon />\n </IconButton>\n </Flex>\n );\n};\n\nconst insetHeightPx = 180;\nconst insetMaxWidthPx = 240;\nconst defaultMobileAspectRatio = 9 / 16;\nconst desktopAspectRatio = 1 / defaultMobileAspectRatio;\n\nexport const InsetTile = ({ peerId }: { peerId?: string }) => {\n const isMobile = useMedia(cssConfig.media.md);\n const isLandscape = useMedia(cssConfig.media.ls);\n const selector = peerId ? selectPeerByID(peerId) : selectLocalPeer;\n const peer = useHMSStore(selector);\n const [minimised, setMinimised] = useSetAppDataByKey(APP_DATA.minimiseInset);\n const videoTrack = useHMSStore(selectVideoTrackByID(peer?.videoTrack));\n const isAllowedToPublish = useHMSStore(selectIsAllowedToPublish);\n const videoTileProps = useVideoTileContext();\n let aspectRatio = isMobile ? defaultMobileAspectRatio : desktopAspectRatio;\n if (videoTrack?.width && videoTrack?.height && !isMobile) {\n aspectRatio = videoTrack.width / videoTrack.height;\n }\n let height = insetHeightPx;\n let width = height * aspectRatio;\n // Convert to 16/9 in landscape mode with a max width of 240\n if (isLandscape && width > insetMaxWidthPx) {\n width = 240;\n height = width / aspectRatio;\n }\n\n const nodeRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const node = nodeRef.current;\n if (!node || !window.ResizeObserver) {\n return;\n }\n const resizeObserver = new ResizeObserver(entries => {\n entries.forEach(entry => {\n if (entry.target === node.parentElement) {\n // reset to original position on resize\n node.style.transform = `translate(0,0)`;\n }\n });\n });\n node.parentElement && resizeObserver.observe(node.parentElement);\n return () => {\n node?.parentElement && resizeObserver?.unobserve(node.parentElement);\n resizeObserver?.disconnect();\n };\n }, []);\n\n if (!isAllowedToPublish.video && !isAllowedToPublish.audio) {\n return null;\n }\n\n return (\n <Draggable bounds=\"parent\" nodeRef={nodeRef} cancel=\".__cancel-drag-event\">\n <Box\n ref={nodeRef}\n css={{\n position: 'absolute',\n bottom: 0,\n right: 0,\n zIndex: 10,\n boxShadow: '0 0 8px 0 rgba(0,0,0,0.3)',\n r: '$2',\n ...(!minimised\n ? {\n aspectRatio: aspectRatio,\n h: height,\n }\n : {}),\n }}\n >\n {minimised ? (\n <MinimisedTile setMinimised={setMinimised} />\n ) : (\n <VideoTile\n peerId={peer?.id}\n trackId={peer?.videoTrack}\n rootCSS={{\n size: '100%',\n padding: 0,\n }}\n width={width}\n height={height}\n containerCSS={{ background: '$surface_default' }}\n canMinimise\n isDragabble\n {...videoTileProps}\n hideParticipantNameOnTile\n />\n )}\n </Box>\n </Draggable>\n );\n};\n"],
|
5
|
-
"mappings": "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",
|
6
|
-
"names": []
|
7
|
-
}
|
package/dist/empty-chat.svg
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
<svg width="184" height="133" viewBox="0 0 184 133" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M144.885 91.3998C145.318 91.023 145.861 90.7947 146.433 90.7483L146.446 90.7473L169.355 89.1614C169.702 89.1376 170.049 89.2101 170.358 89.3712C170.662 89.5305 170.918 89.7702 171.096 90.0642C171.098 90.0672 171.1 90.0703 171.102 90.0734L171.104 90.0766C171.281 90.3744 171.373 90.7154 171.369 91.062C171.365 91.4097 171.265 91.7496 171.08 92.044L158.85 111.504C158.539 111.986 158.081 112.356 157.544 112.56C157.007 112.764 156.419 112.791 155.866 112.636C155.313 112.482 154.823 112.155 154.469 111.703C154.115 111.25 153.915 110.697 153.898 110.123C153.898 110.109 153.898 110.094 153.898 110.08L153.996 100.307L145.347 95.7858C145.334 95.779 145.321 95.7721 145.308 95.7649C144.811 95.4785 144.417 95.0404 144.186 94.5146C143.955 93.9888 143.898 93.4029 144.024 92.8425C144.15 92.2821 144.451 91.7765 144.885 91.3998ZM167.441 91.0088L146.603 92.8952C146.49 92.9053 146.383 92.9508 146.298 93.0251C146.211 93.1005 146.151 93.2016 146.125 93.3137C146.1 93.4257 146.112 93.5429 146.158 93.6481C146.202 93.7484 146.276 93.8327 146.369 93.89L155.26 98.296L167.441 91.0088ZM156.32 100.171L168.547 92.8564L157.039 110.339C156.976 110.434 156.886 110.506 156.78 110.547C156.673 110.587 156.555 110.593 156.444 110.562C156.334 110.531 156.236 110.466 156.165 110.375C156.097 110.289 156.058 110.184 156.052 110.075L156.32 100.171Z" fill="#444954"/>
|
3
|
-
<path d="M83.3248 35.4156C71.7182 47.1017 51.2098 75.5175 62.0292 95.6918C75.5536 120.91 140.453 79.2983 115.364 67.6657C90.2756 56.0331 65.8818 122.018 101.568 120.391C116.398 118.62 131.221 114.699 145.703 105.512" stroke="#293042" stroke-width="2.25" stroke-dasharray="6 6"/>
|
4
|
-
<rect x="0.00256348" y="0.5" width="173.524" height="58.3398" rx="29.1699" fill="#272A31"/>
|
5
|
-
<g opacity="0.4">
|
6
|
-
<rect x="24.7526" y="20.9312" width="111" height="4.5" rx="2.25" fill="#444954"/>
|
7
|
-
</g>
|
8
|
-
<g opacity="0.4">
|
9
|
-
<rect x="38.2526" y="34.4312" width="110.25" height="4.5" rx="2.25" fill="#444954"/>
|
10
|
-
</g>
|
11
|
-
<path d="M40.3918 71.5547L28.4246 55.0999L52.3589 55.0999L40.3918 71.5547Z" fill="#272A31"/>
|
12
|
-
</svg>
|
package/dist/ios-perm-0.png
DELETED
Binary file
|
package/dist/pdf-share.png
DELETED
Binary file
|
package/dist/screen-share.png
DELETED
Binary file
|
@@ -1,12 +0,0 @@
|
|
1
|
-
<svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
-
<path d="M70 68.3333V26.6667C70 24.825 68.5083 23.3333 66.6667 23.3333H13.3333C11.4917 23.3333 10 24.825 10 26.6667V68.3333C10 70.175 11.4917 71.6667 13.3333 71.6667H66.6667C68.5083 71.6667 70 70.175 70 68.3333Z" fill="#272A31"/>
|
3
|
-
<path d="M20 31.6667H60C61.8417 31.6667 63.3333 33.1583 63.3333 35C63.3333 36.8417 61.8417 38.3333 60 38.3333H20C18.1583 38.3333 16.6667 36.8417 16.6667 35C16.6667 33.1583 18.1583 31.6667 20 31.6667Z" fill="#8F9099"/>
|
4
|
-
<path d="M58.3333 36.6667V10C58.3333 9.08 57.5867 8.33334 56.6667 8.33334H55C55 9.25334 54.2533 10 53.3333 10C52.4133 10 51.6667 9.25334 51.6667 8.33334H48.3333C48.3333 9.25334 47.5867 10 46.6667 10C45.7467 10 45 9.25334 45 8.33334H41.6667C41.6667 9.25334 40.92 10 40 10C39.08 10 38.3333 9.25334 38.3333 8.33334H35C35 9.25334 34.2533 10 33.3333 10C32.4133 10 31.6667 9.25334 31.6667 8.33334H28.3333C28.3333 9.25334 27.5867 10 26.6667 10C25.7467 10 25 9.25334 25 8.33334H23.3333C22.4133 8.33334 21.6667 9.08 21.6667 10V36.6667H58.3333Z" fill="#C74E5B"/>
|
5
|
-
<path d="M21.6667 43.3333H58.3333C60.175 43.3333 61.6667 44.825 61.6667 46.6667V50C61.6667 51.8417 60.175 53.3333 58.3333 53.3333H21.6667C19.825 53.3333 18.3333 51.8417 18.3333 50V46.6667C18.3333 44.825 19.825 43.3333 21.6667 43.3333Z" fill="#C5C6D0"/>
|
6
|
-
<path d="M60 66.6667H55C54.08 66.6667 53.3333 65.92 53.3333 65V60C53.3333 59.08 54.08 58.3333 55 58.3333H60C60.92 58.3333 61.6667 59.08 61.6667 60V65C61.6667 65.92 60.92 66.6667 60 66.6667Z" fill="#C5C6D0"/>
|
7
|
-
<path d="M25 66.6667H20C19.08 66.6667 18.3333 65.92 18.3333 65V60C18.3333 59.08 19.08 58.3333 20 58.3333H25C25.92 58.3333 26.6667 59.08 26.6667 60V65C26.6667 65.92 25.92 66.6667 25 66.6667ZM36.6667 66.6667H31.6667C30.7467 66.6667 30 65.92 30 65V60C30 59.08 30.7467 58.3333 31.6667 58.3333H36.6667C37.5867 58.3333 38.3333 59.08 38.3333 60V65C38.3333 65.92 37.5867 66.6667 36.6667 66.6667ZM48.3333 66.6667H43.3333C42.4133 66.6667 41.6667 65.92 41.6667 65V60C41.6667 59.08 42.4133 58.3333 43.3333 58.3333H48.3333C49.2533 58.3333 50 59.08 50 60V65C50 65.92 49.2533 66.6667 48.3333 66.6667Z" fill="#C5C6D0"/>
|
8
|
-
<path d="M58.3333 35H21.6667V38.3333H58.3333V35Z" fill="#C74E5B"/>
|
9
|
-
<path opacity="0.05" d="M45.3033 32.315C44.6383 32.315 44.01 32.0567 43.5367 31.585L40 28.0467L36.465 31.5817C35.9917 32.0533 35.365 32.3133 34.6967 32.3133C34.0283 32.3133 33.4 32.0533 32.9267 31.58L31.75 30.4033C31.2783 29.9333 31.0183 29.3033 31.0183 28.6333C31.0183 27.9667 31.2783 27.3383 31.75 26.8667L35.2867 23.3333L31.7517 19.7983C31.28 19.3283 31.02 18.7 31.02 18.0317C31.02 17.3617 31.28 16.7333 31.7517 16.2617L32.93 15.0833C33.4017 14.6117 34.0283 14.3517 34.6983 14.3517C35.3633 14.3517 35.9917 14.61 36.465 15.0817L40 18.62L43.535 15.0833C44.0083 14.6117 44.635 14.3517 45.3033 14.3517C45.9683 14.3517 46.5967 14.61 47.07 15.0817L48.25 16.2617C48.7217 16.7317 48.9817 17.3617 48.9817 18.0317C48.9817 18.6983 48.7217 19.3267 48.25 19.7983L44.7117 23.3333L48.2483 26.87C49.2217 27.84 49.2233 29.425 48.2517 30.4017L47.07 31.5833C46.5983 32.055 45.9717 32.315 45.3033 32.315Z" fill="black"/>
|
10
|
-
<path opacity="0.07" d="M45.3033 31.4817C44.8583 31.4817 44.44 31.3083 44.125 30.995L40 26.8683L35.875 30.9933C35.56 31.3083 35.1417 31.48 34.6967 31.48C34.25 31.48 33.8317 31.3067 33.5183 30.9917L32.34 29.8133C32.025 29.4983 31.8517 29.08 31.8517 28.6333C31.8517 28.1883 32.025 27.77 32.34 27.455L36.465 23.3333L32.34 19.2083C32.0267 18.895 31.8517 18.4767 31.8517 18.0317C31.8517 17.585 32.025 17.1667 32.34 16.8517L33.5183 15.6733C33.8317 15.36 34.25 15.1867 34.6967 15.1867C35.1417 15.1867 35.56 15.36 35.875 15.6733L40 19.7983L44.125 15.6717C44.44 15.3567 44.8583 15.185 45.3033 15.185C45.7483 15.185 46.1667 15.3583 46.4817 15.6717L47.66 16.8517C47.975 17.1667 48.1483 17.585 48.1483 18.0317C48.1483 18.4767 47.975 18.895 47.66 19.21L43.5333 23.3333L47.66 27.46C48.31 28.1067 48.31 29.1633 47.6617 29.815L46.4817 30.995C46.1667 31.3083 45.7483 31.4817 45.3033 31.4817Z" fill="black"/>
|
11
|
-
<path d="M42.3567 23.3333L47.0717 18.6183C47.3967 18.2933 47.3967 17.765 47.0717 17.44L45.8933 16.2617C45.5667 15.9367 45.04 15.9367 44.715 16.2617L40 20.9767L35.2867 16.2633C34.9617 15.9383 34.4333 15.9383 34.1083 16.2633L32.93 17.4417C32.605 17.7667 32.605 18.295 32.93 18.62L37.6433 23.3333L32.93 28.0467C32.605 28.3717 32.605 28.9 32.93 29.225L34.1083 30.4033C34.4333 30.7283 34.9617 30.7283 35.2867 30.4033L40 25.69L44.715 30.405C45.04 30.73 45.5683 30.73 45.8933 30.405L47.0717 29.2267C47.3967 28.9 47.3967 28.3733 47.0717 28.0483L42.3567 23.3333Z" fill="#FFEDEC"/>
|
12
|
-
</svg>
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import { useEffect } from 'react';
|
2
|
-
import { HMSNotificationTypes, useHMSNotifications } from '@100mslive/react-sdk';
|
3
|
-
// @ts-ignore: No implicit Any
|
4
|
-
import { ToastManager } from '../Toast/ToastManager';
|
5
|
-
|
6
|
-
export const DeviceChangeNotifications = () => {
|
7
|
-
const notification = useHMSNotifications(HMSNotificationTypes.DEVICE_CHANGE_UPDATE);
|
8
|
-
|
9
|
-
useEffect(() => {
|
10
|
-
if (notification) {
|
11
|
-
ToastManager.addToast({
|
12
|
-
title: notification.message,
|
13
|
-
});
|
14
|
-
}
|
15
|
-
}, [notification]);
|
16
|
-
|
17
|
-
return null;
|
18
|
-
};
|
@@ -1,56 +0,0 @@
|
|
1
|
-
import React, { useEffect } from 'react';
|
2
|
-
import { HMSNotificationTypes, useHMSNotifications } from '@100mslive/react-sdk';
|
3
|
-
import { GroupIcon } from '@100mslive/react-icons';
|
4
|
-
import { Box } from '../../../Layout';
|
5
|
-
// @ts-ignore: No implicit Any
|
6
|
-
import { ToastManager } from '../Toast/ToastManager';
|
7
|
-
// @ts-ignore: No implicit Any
|
8
|
-
import { useSubscribedNotifications } from '../AppData/useUISettings';
|
9
|
-
|
10
|
-
export const ErrorNotifications = () => {
|
11
|
-
const notification = useHMSNotifications(HMSNotificationTypes.ERROR);
|
12
|
-
const subscribedNotifications = useSubscribedNotifications() || {};
|
13
|
-
|
14
|
-
useEffect(() => {
|
15
|
-
if (!notification || !notification.data) return;
|
16
|
-
|
17
|
-
const { isTerminal, action, code, message, description } = notification.data;
|
18
|
-
|
19
|
-
if (isTerminal && action !== 'INIT') {
|
20
|
-
if ([500, 6008].includes(code)) {
|
21
|
-
ToastManager.addToast({
|
22
|
-
title: `Error: ${message}`,
|
23
|
-
});
|
24
|
-
} else if (message === 'role limit reached') {
|
25
|
-
ToastManager.addToast({
|
26
|
-
title: 'The room is currently full, try joining later',
|
27
|
-
close: true,
|
28
|
-
icon: (
|
29
|
-
<Box css={{ color: '$alert_error_default' }}>
|
30
|
-
<GroupIcon />
|
31
|
-
</Box>
|
32
|
-
),
|
33
|
-
});
|
34
|
-
} else {
|
35
|
-
ToastManager.addToast({
|
36
|
-
title: message || 'We couldn’t reconnect you. When you’re back online, try joining the room.',
|
37
|
-
close: false,
|
38
|
-
});
|
39
|
-
}
|
40
|
-
return;
|
41
|
-
}
|
42
|
-
// Autoplay error or user denied screen share (cancelled browser pop-up)
|
43
|
-
if ([3008, 3001, 3011].includes(code)) {
|
44
|
-
return;
|
45
|
-
}
|
46
|
-
if (action === 'INIT') {
|
47
|
-
return;
|
48
|
-
}
|
49
|
-
if (!subscribedNotifications.ERROR) return;
|
50
|
-
ToastManager.addToast({
|
51
|
-
title: `Error: ${message} - ${description}`,
|
52
|
-
});
|
53
|
-
}, [notification, subscribedNotifications.ERROR]);
|
54
|
-
|
55
|
-
return null;
|
56
|
-
};
|
@@ -1,24 +0,0 @@
|
|
1
|
-
import { useEffect } from 'react';
|
2
|
-
import { HMSNotificationTypes, selectIsLocalScreenShared } from '@100mslive/hms-video-store';
|
3
|
-
import { useAwayNotifications, useHMSNotifications, useHMSStore } from '@100mslive/react-sdk';
|
4
|
-
import { useRoomLayout } from '../../provider/roomLayoutProvider';
|
5
|
-
import { usePIPWindow } from '../PIP/usePIPWindow';
|
6
|
-
|
7
|
-
export const MessageNotifications = () => {
|
8
|
-
const notification = useHMSNotifications(HMSNotificationTypes.NEW_MESSAGE);
|
9
|
-
const amIScreenSharing = useHMSStore(selectIsLocalScreenShared);
|
10
|
-
const logoURL = useRoomLayout()?.logo?.url;
|
11
|
-
const { pipWindow } = usePIPWindow();
|
12
|
-
const { showNotification } = useAwayNotifications();
|
13
|
-
|
14
|
-
useEffect(() => {
|
15
|
-
if (notification && amIScreenSharing && !notification.data?.ignored && !pipWindow) {
|
16
|
-
showNotification(`New message from ${notification.data.senderName}`, {
|
17
|
-
body: notification.data.message,
|
18
|
-
icon: logoURL,
|
19
|
-
});
|
20
|
-
}
|
21
|
-
}, [notification]);
|
22
|
-
|
23
|
-
return null;
|
24
|
-
};
|
@@ -1,71 +0,0 @@
|
|
1
|
-
import React, { useEffect } from 'react';
|
2
|
-
import {
|
3
|
-
HMSNotificationTypes,
|
4
|
-
selectLocalPeerID,
|
5
|
-
selectPeerNameByID,
|
6
|
-
useHMSNotifications,
|
7
|
-
useHMSStore,
|
8
|
-
useHMSVanillaStore,
|
9
|
-
} from '@100mslive/react-sdk';
|
10
|
-
import { Button } from '../../../Button';
|
11
|
-
// @ts-ignore: No implicit Any
|
12
|
-
import { ToastManager } from '../Toast/ToastManager';
|
13
|
-
import { useRoomLayoutConferencingScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
|
14
|
-
// @ts-ignore: No implicit Any
|
15
|
-
import { usePollViewToggle } from '../AppData/useSidepane';
|
16
|
-
|
17
|
-
const notificationTypes = [HMSNotificationTypes.POLL_STARTED, HMSNotificationTypes.POLL_STOPPED];
|
18
|
-
|
19
|
-
const pollToastKey: Record<string, string> = {};
|
20
|
-
|
21
|
-
export const PollNotificationModal = () => {
|
22
|
-
const togglePollView = usePollViewToggle();
|
23
|
-
const localPeerID = useHMSStore(selectLocalPeerID);
|
24
|
-
const vanillaStore = useHMSVanillaStore();
|
25
|
-
const screenProps = useRoomLayoutConferencingScreen();
|
26
|
-
|
27
|
-
const notification = useHMSNotifications(notificationTypes);
|
28
|
-
|
29
|
-
useEffect(() => {
|
30
|
-
switch (notification?.type) {
|
31
|
-
case HMSNotificationTypes.POLL_STARTED:
|
32
|
-
if (notification.data.startedBy !== localPeerID && screenProps.screenType !== 'hls_live_streaming') {
|
33
|
-
const pollStartedBy = vanillaStore.getState(selectPeerNameByID(notification.data.startedBy)) || 'Participant';
|
34
|
-
|
35
|
-
const pollToastID = ToastManager.addToast({
|
36
|
-
title: `${pollStartedBy} started a ${notification.data.type}: ${notification.data.title}`,
|
37
|
-
action: (
|
38
|
-
<Button
|
39
|
-
onClick={() => togglePollView(notification.data.id)}
|
40
|
-
variant="standard"
|
41
|
-
css={{
|
42
|
-
backgroundColor: '$surface_bright',
|
43
|
-
fontWeight: '$semiBold',
|
44
|
-
color: '$on_surface_high',
|
45
|
-
p: '$xs $md',
|
46
|
-
}}
|
47
|
-
>
|
48
|
-
{notification.data.type === 'quiz' ? 'Answer' : 'Vote'}
|
49
|
-
</Button>
|
50
|
-
),
|
51
|
-
duration: Infinity,
|
52
|
-
});
|
53
|
-
pollToastKey[notification.data.id] = pollToastID;
|
54
|
-
}
|
55
|
-
break;
|
56
|
-
case HMSNotificationTypes.POLL_STOPPED:
|
57
|
-
{
|
58
|
-
const pollID = notification?.data.id;
|
59
|
-
if (pollID && pollToastKey?.[pollID]) {
|
60
|
-
ToastManager.removeToast(pollToastKey?.[notification.data.id]);
|
61
|
-
delete pollToastKey[notification?.data.id];
|
62
|
-
}
|
63
|
-
}
|
64
|
-
break;
|
65
|
-
default:
|
66
|
-
break;
|
67
|
-
}
|
68
|
-
}, [notification]);
|
69
|
-
|
70
|
-
return null;
|
71
|
-
};
|
@@ -1,24 +0,0 @@
|
|
1
|
-
import { useEffect } from 'react';
|
2
|
-
import { HMSNotificationTypes, useHMSNotifications } from '@100mslive/react-sdk';
|
3
|
-
import { useUpdateRoomLayout } from '../../provider/roomLayoutProvider';
|
4
|
-
// @ts-ignore: No implicit Any
|
5
|
-
import { ToastManager } from '../Toast/ToastManager';
|
6
|
-
|
7
|
-
export const RoleChangeNotification = () => {
|
8
|
-
const notification = useHMSNotifications(HMSNotificationTypes.ROLE_UPDATED);
|
9
|
-
const updateRoomLayoutForRole = useUpdateRoomLayout();
|
10
|
-
|
11
|
-
useEffect(() => {
|
12
|
-
if (!notification?.data) {
|
13
|
-
return;
|
14
|
-
}
|
15
|
-
if (notification.data?.isLocal && notification.data?.roleName) {
|
16
|
-
ToastManager.addToast({
|
17
|
-
title: `You are now a ${notification.data.roleName}`,
|
18
|
-
});
|
19
|
-
updateRoomLayoutForRole?.(notification.data.roleName);
|
20
|
-
}
|
21
|
-
}, [notification]);
|
22
|
-
|
23
|
-
return null;
|
24
|
-
};
|