@100mslive/roomkit-react 0.1.14-alpha.1 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{HLSView-JTO7E2KW.js → HLSView-662T7R7H.js} +2 -2
- package/dist/Prebuilt/common/constants.d.ts +1 -0
- package/dist/Prebuilt/common/hooks.d.ts +24 -0
- package/dist/Prebuilt/components/Chat/{Navigation.d.ts → ArrowNavigation.d.ts} +1 -2
- package/dist/Prebuilt/components/Chat/ChatFooter.d.ts +2 -4
- package/dist/Prebuilt/components/Chat/ChatSelector.d.ts +5 -0
- package/dist/Prebuilt/components/Chat/ChatSelectorContainer.d.ts +2 -0
- package/dist/Prebuilt/components/Chat/ChatStates.d.ts +3 -0
- package/dist/Prebuilt/components/Chat/StickIndicator.d.ts +5 -0
- package/dist/Prebuilt/components/Chat/useUnreadCount.d.ts +4 -0
- package/dist/Prebuilt/components/ChatSettings.d.ts +2 -0
- package/dist/Prebuilt/components/Preview/PreviewForm.d.ts +2 -1
- package/dist/Prebuilt/components/SidePaneTabs.d.ts +0 -2
- package/dist/Prebuilt/components/TileMenu/TileMenuContent.d.ts +19 -0
- package/dist/Prebuilt/components/VirtualBackground/VBOption.d.ts +2 -1
- package/dist/Prebuilt/components/hooks/useChatBlacklist.d.ts +2 -1
- package/dist/Prebuilt/components/hooks/useSetPinnedMessages.d.ts +1 -1
- package/dist/Prebuilt/layouts/SidePane.d.ts +1 -3
- package/dist/{chunk-TOKLXTAS.js → chunk-2B7YYNHQ.js} +1651 -1229
- package/dist/chunk-2B7YYNHQ.js.map +7 -0
- package/dist/index.cjs.js +2074 -1609
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.js +1 -1
- package/dist/meta.cjs.json +451 -115
- package/dist/meta.esbuild.json +457 -121
- package/package.json +6 -6
- package/src/Prebuilt/common/constants.ts +1 -0
- package/src/Prebuilt/common/{hooks.js → hooks.ts} +4 -5
- package/src/Prebuilt/components/AppData/AppData.tsx +1 -0
- package/src/Prebuilt/components/AppData/useUISettings.js +2 -1
- package/src/Prebuilt/components/AuthToken.jsx +16 -8
- package/src/Prebuilt/components/Chat/{Navigation.tsx → ArrowNavigation.tsx} +3 -19
- package/src/Prebuilt/components/Chat/Chat.jsx +15 -44
- package/src/Prebuilt/components/Chat/ChatBody.jsx +114 -69
- package/src/Prebuilt/components/Chat/ChatFooter.tsx +128 -130
- package/src/Prebuilt/components/Chat/ChatSelector.tsx +225 -0
- package/src/Prebuilt/components/Chat/ChatSelectorContainer.tsx +158 -0
- package/src/Prebuilt/components/Chat/{ChatStates.jsx → ChatStates.tsx} +4 -4
- package/src/Prebuilt/components/Chat/PinnedMessage.tsx +59 -41
- package/src/Prebuilt/components/Chat/StickIndicator.tsx +24 -0
- package/src/Prebuilt/components/Chat/useUnreadCount.ts +19 -0
- package/src/Prebuilt/components/ChatSettings.tsx +68 -0
- package/src/Prebuilt/components/Footer/ParticipantList.jsx +2 -1
- package/src/Prebuilt/components/Header/ParticipantFilter.jsx +2 -1
- package/src/Prebuilt/components/Notifications/ChatNotifications.tsx +1 -1
- package/src/Prebuilt/components/Preview/PreviewForm.tsx +3 -0
- package/src/Prebuilt/components/Preview/PreviewJoin.tsx +2 -1
- package/src/Prebuilt/components/SidePaneTabs.tsx +48 -50
- package/src/Prebuilt/components/TileMenu/{TileMenuContent.jsx → TileMenuContent.tsx} +72 -41
- package/src/Prebuilt/components/VirtualBackground/VBCollection.tsx +2 -1
- package/src/Prebuilt/components/VirtualBackground/VBOption.tsx +3 -0
- package/src/Prebuilt/components/VirtualBackground/VBToggle.jsx +1 -1
- package/src/Prebuilt/components/hooks/useChatBlacklist.ts +8 -6
- package/src/Prebuilt/components/hooks/useSetPinnedMessages.ts +2 -7
- package/src/Prebuilt/layouts/SidePane.tsx +1 -5
- package/src/Prebuilt/provider/roomLayoutProvider/constants/index.ts +1 -0
- package/dist/chunk-TOKLXTAS.js.map +0 -7
- package/src/Prebuilt/components/Chat/ChatSelector.jsx +0 -161
- package/src/Prebuilt/components/Chat/ChatSelectorContainer.jsx +0 -81
- package/src/Prebuilt/components/Chat/useUnreadCount.js +0 -17
- /package/dist/{HLSView-JTO7E2KW.js.map → HLSView-662T7R7H.js.map} +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
2
2
|
import { useMedia } from 'react-use';
|
3
|
-
import {
|
3
|
+
import { DefaultConferencingScreen_Elements } from '@100mslive/types-prebuilt';
|
4
4
|
import { selectPeerCount, useHMSStore } from '@100mslive/react-sdk';
|
5
5
|
import { CrossIcon } from '@100mslive/react-icons';
|
6
6
|
// @ts-ignore: No implicit Any
|
@@ -10,13 +10,13 @@ import { PaginatedParticipants } from './Footer/PaginatedParticipants';
|
|
10
10
|
import { ParticipantList } from './Footer/ParticipantList';
|
11
11
|
import { Box, config as cssConfig, Flex, IconButton, Tabs, Text } from '../..';
|
12
12
|
import { Tooltip } from '../../Tooltip';
|
13
|
+
import { ChatSettings } from './ChatSettings';
|
13
14
|
// @ts-ignore: No implicit Any
|
14
15
|
import { useRoomLayoutConferencingScreen } from '../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
|
15
16
|
// @ts-ignore: No implicit Any
|
16
17
|
import { useIsSidepaneTypeOpen, useSidepaneReset, useSidepaneToggle } from './AppData/useSidepane';
|
17
18
|
// @ts-ignore: No implicit Any
|
18
19
|
import { getFormattedCount } from '../common/utils';
|
19
|
-
// @ts-ignore: No implicit Any
|
20
20
|
import { SIDE_PANE_OPTIONS } from '../common/constants';
|
21
21
|
|
22
22
|
const tabTriggerCSS = {
|
@@ -40,9 +40,8 @@ const ParticipantCount = ({ count }: { count: number }) => {
|
|
40
40
|
|
41
41
|
export const SidePaneTabs = React.memo<{
|
42
42
|
active: 'Participants | Chat';
|
43
|
-
screenType: keyof ConferencingScreen;
|
44
43
|
hideControls?: boolean;
|
45
|
-
}>(({ active = SIDE_PANE_OPTIONS.CHAT,
|
44
|
+
}>(({ active = SIDE_PANE_OPTIONS.CHAT, hideControls }) => {
|
46
45
|
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
|
47
46
|
const toggleParticipants = useSidepaneToggle(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
48
47
|
const resetSidePane = useSidepaneReset();
|
@@ -58,6 +57,7 @@ export const SidePaneTabs = React.memo<{
|
|
58
57
|
const isOverlayChat = !!elements?.chat?.is_overlay && isMobile;
|
59
58
|
const { off_stage_roles = [] } = (elements as DefaultConferencingScreen_Elements)?.on_stage_exp || {};
|
60
59
|
const isChatOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.CHAT);
|
60
|
+
const showChatSettings = showChat && isChatOpen && (!isMobile || !isOverlayChat);
|
61
61
|
|
62
62
|
useEffect(() => {
|
63
63
|
if (activeTab === SIDE_PANE_OPTIONS.CHAT && !showChat && showParticipants) {
|
@@ -103,7 +103,7 @@ export const SidePaneTabs = React.memo<{
|
|
103
103
|
}}
|
104
104
|
>
|
105
105
|
{isOverlayChat && isChatOpen && showChat ? (
|
106
|
-
<Chat
|
106
|
+
<Chat />
|
107
107
|
) : (
|
108
108
|
<>
|
109
109
|
{hideTabs ? (
|
@@ -118,11 +118,7 @@ export const SidePaneTabs = React.memo<{
|
|
118
118
|
)}
|
119
119
|
</Text>
|
120
120
|
|
121
|
-
{showChat ?
|
122
|
-
<Chat screenType={screenType} />
|
123
|
-
) : (
|
124
|
-
<ParticipantList offStageRoles={off_stage_roles} onActive={setActiveRole} />
|
125
|
-
)}
|
121
|
+
{showChat ? <Chat /> : <ParticipantList offStageRoles={off_stage_roles} onActive={setActiveRole} />}
|
126
122
|
</>
|
127
123
|
) : (
|
128
124
|
<Tabs.Root
|
@@ -133,55 +129,57 @@ export const SidePaneTabs = React.memo<{
|
|
133
129
|
size: '100%',
|
134
130
|
}}
|
135
131
|
>
|
136
|
-
<
|
137
|
-
<Tabs.
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
132
|
+
<Flex css={{ w: '100%' }}>
|
133
|
+
<Tabs.List css={{ flexGrow: 1, borderRadius: '$2', bg: '$surface_default' }}>
|
134
|
+
<Tabs.Trigger
|
135
|
+
value={SIDE_PANE_OPTIONS.CHAT}
|
136
|
+
onClick={toggleChat}
|
137
|
+
css={{
|
138
|
+
...tabTriggerCSS,
|
139
|
+
color: activeTab !== SIDE_PANE_OPTIONS.CHAT ? '$on_surface_low' : '$on_surface_high',
|
140
|
+
}}
|
141
|
+
>
|
142
|
+
{chat_title}
|
143
|
+
</Tabs.Trigger>
|
144
|
+
<Tabs.Trigger
|
145
|
+
value={SIDE_PANE_OPTIONS.PARTICIPANTS}
|
146
|
+
onClick={toggleParticipants}
|
147
|
+
css={{
|
148
|
+
...tabTriggerCSS,
|
149
|
+
color: activeTab !== SIDE_PANE_OPTIONS.PARTICIPANTS ? '$on_surface_low' : '$on_surface_high',
|
150
|
+
}}
|
151
|
+
>
|
152
|
+
Participants <ParticipantCount count={peerCount} />
|
153
|
+
</Tabs.Trigger>
|
154
|
+
</Tabs.List>
|
155
|
+
{showChatSettings ? <ChatSettings /> : null}
|
156
|
+
{isOverlayChat && isChatOpen ? null : (
|
157
|
+
<IconButton
|
158
|
+
css={{ my: '$1', color: '$on_surface_medium', '&:hover': { color: '$on_surface_high' } }}
|
159
|
+
onClick={e => {
|
160
|
+
e.stopPropagation();
|
161
|
+
if (activeTab === SIDE_PANE_OPTIONS.CHAT) {
|
162
|
+
toggleChat();
|
163
|
+
} else {
|
164
|
+
toggleParticipants();
|
165
|
+
}
|
166
|
+
}}
|
167
|
+
data-testid="close_chat"
|
168
|
+
>
|
169
|
+
<CrossIcon />
|
170
|
+
</IconButton>
|
171
|
+
)}
|
172
|
+
</Flex>
|
158
173
|
<Tabs.Content value={SIDE_PANE_OPTIONS.PARTICIPANTS} css={{ p: 0 }}>
|
159
174
|
<ParticipantList offStageRoles={off_stage_roles} onActive={setActiveRole} />
|
160
175
|
</Tabs.Content>
|
161
176
|
<Tabs.Content value={SIDE_PANE_OPTIONS.CHAT} css={{ p: 0 }}>
|
162
|
-
<Chat
|
177
|
+
<Chat />
|
163
178
|
</Tabs.Content>
|
164
179
|
</Tabs.Root>
|
165
180
|
)}
|
166
181
|
</>
|
167
182
|
)}
|
168
|
-
|
169
|
-
{isOverlayChat && isChatOpen ? null : (
|
170
|
-
<IconButton
|
171
|
-
css={{ position: 'absolute', right: '$9', top: '$11', '@md': { top: '$8', right: '$6' } }}
|
172
|
-
onClick={e => {
|
173
|
-
e.stopPropagation();
|
174
|
-
if (activeTab === SIDE_PANE_OPTIONS.CHAT) {
|
175
|
-
toggleChat();
|
176
|
-
} else {
|
177
|
-
toggleParticipants();
|
178
|
-
}
|
179
|
-
}}
|
180
|
-
data-testid="close_chat"
|
181
|
-
>
|
182
|
-
<CrossIcon />
|
183
|
-
</IconButton>
|
184
|
-
)}
|
185
183
|
</Flex>
|
186
184
|
);
|
187
185
|
});
|
@@ -1,6 +1,10 @@
|
|
1
1
|
import React, { Fragment } from 'react';
|
2
2
|
import { useMedia } from 'react-use';
|
3
|
+
import { HMSException } from '@100mslive/hms-video';
|
3
4
|
import {
|
5
|
+
HMSSimulcastLayerDefinition,
|
6
|
+
HMSTrackID,
|
7
|
+
HMSVideoTrack,
|
4
8
|
selectPermissions,
|
5
9
|
selectSessionStore,
|
6
10
|
selectTrackByID,
|
@@ -27,13 +31,24 @@ import { Slider } from '../../../Slider';
|
|
27
31
|
import { Text } from '../../../Text';
|
28
32
|
import { config as cssConfig } from '../../../Theme';
|
29
33
|
import { StyledMenuTile } from '../../../TileMenu';
|
34
|
+
import { useHMSPrebuiltContext } from '../../AppContext';
|
35
|
+
// @ts-ignore
|
30
36
|
import { ToastManager } from '../Toast/ToastManager';
|
37
|
+
// @ts-ignore
|
31
38
|
import { useSetAppDataByKey } from '../AppData/useUISettings';
|
39
|
+
// @ts-ignore
|
32
40
|
import { useDropdownSelection } from '../hooks/useDropdownSelection';
|
33
41
|
import { APP_DATA, REMOTE_STOP_SCREENSHARE_TYPE, SESSION_STORE_KEY } from '../../common/constants';
|
34
42
|
|
35
|
-
export const isSameTile = ({
|
36
|
-
trackId
|
43
|
+
export const isSameTile = ({
|
44
|
+
trackId,
|
45
|
+
videoTrackID,
|
46
|
+
audioTrackID,
|
47
|
+
}: {
|
48
|
+
trackId: HMSTrackID;
|
49
|
+
videoTrackID: string;
|
50
|
+
audioTrackID: string;
|
51
|
+
}) => trackId && ((videoTrackID && videoTrackID === trackId) || (audioTrackID && audioTrackID === trackId));
|
37
52
|
|
38
53
|
const spacingCSS = { '@md': { my: '$8', fontWeight: '$semiBold', fontSize: 'sm' } };
|
39
54
|
|
@@ -42,15 +57,18 @@ const SpotlightActions = ({
|
|
42
57
|
onSpotLightClick = () => {
|
43
58
|
return;
|
44
59
|
},
|
60
|
+
}: {
|
61
|
+
peerId: string;
|
62
|
+
onSpotLightClick: () => void;
|
45
63
|
}) => {
|
46
64
|
const hmsActions = useHMSActions();
|
47
65
|
const spotlightPeerId = useHMSStore(selectSessionStore(SESSION_STORE_KEY.SPOTLIGHT));
|
48
66
|
const isTileSpotlighted = spotlightPeerId === peerId;
|
49
67
|
|
50
|
-
const setSpotlightPeerId =
|
68
|
+
const setSpotlightPeerId = (peerIdToSpotlight?: string) =>
|
51
69
|
hmsActions.sessionStore
|
52
|
-
.set(SESSION_STORE_KEY.SPOTLIGHT,
|
53
|
-
.catch(err => ToastManager.addToast({ title: err.description }));
|
70
|
+
.set(SESSION_STORE_KEY.SPOTLIGHT, peerIdToSpotlight)
|
71
|
+
.catch((err: HMSException) => ToastManager.addToast({ title: err.description }));
|
54
72
|
|
55
73
|
return (
|
56
74
|
<StyledMenuTile.ItemButton
|
@@ -70,7 +88,7 @@ const SpotlightActions = ({
|
|
70
88
|
);
|
71
89
|
};
|
72
90
|
|
73
|
-
const PinActions = ({ audioTrackID, videoTrackID }) => {
|
91
|
+
const PinActions = ({ audioTrackID, videoTrackID }: { videoTrackID: string; audioTrackID: string }) => {
|
74
92
|
const [pinnedTrackId, setPinnedTrackId] = useSetAppDataByKey(APP_DATA.pinnedTrackId);
|
75
93
|
|
76
94
|
const isTilePinned = isSameTile({
|
@@ -105,20 +123,20 @@ const MinimiseInset = () => {
|
|
105
123
|
);
|
106
124
|
};
|
107
125
|
|
108
|
-
const SimulcastLayers = ({ trackId }) => {
|
109
|
-
const track = useHMSStore(selectTrackByID(trackId));
|
126
|
+
const SimulcastLayers = ({ trackId }: { trackId: HMSTrackID }) => {
|
127
|
+
const track: HMSVideoTrack = useHMSStore(selectTrackByID(trackId)) as HMSVideoTrack;
|
110
128
|
const actions = useHMSActions();
|
111
129
|
const bg = useDropdownSelection();
|
112
130
|
if (!track?.layerDefinitions?.length || track.degraded || !track.enabled) {
|
113
131
|
return null;
|
114
132
|
}
|
115
|
-
const currentLayer = track.layerDefinitions.find(layer => layer.layer === track.layer);
|
133
|
+
const currentLayer = track.layerDefinitions.find((layer: HMSSimulcastLayerDefinition) => layer.layer === track.layer);
|
116
134
|
return (
|
117
135
|
<Fragment>
|
118
136
|
<StyledMenuTile.ItemButton css={{ color: '$on_surface_medium', cursor: 'default' }}>
|
119
137
|
Select maximum resolution
|
120
138
|
</StyledMenuTile.ItemButton>
|
121
|
-
{track.layerDefinitions.map(layer => {
|
139
|
+
{track.layerDefinitions.map((layer: HMSSimulcastLayerDefinition) => {
|
122
140
|
return (
|
123
141
|
<StyledMenuTile.ItemButton
|
124
142
|
key={layer.layer}
|
@@ -183,25 +201,36 @@ const SimulcastLayers = ({ trackId }) => {
|
|
183
201
|
);
|
184
202
|
};
|
185
203
|
|
186
|
-
export const TileMenuContent =
|
204
|
+
export const TileMenuContent = ({
|
205
|
+
videoTrackID,
|
206
|
+
audioTrackID,
|
207
|
+
isLocal,
|
208
|
+
isScreenshare,
|
209
|
+
showSpotlight,
|
210
|
+
showPinAction,
|
211
|
+
peerID,
|
212
|
+
canMinimise,
|
213
|
+
closeSheetOnClick = () => {
|
214
|
+
return;
|
215
|
+
},
|
216
|
+
openNameChangeModal = () => {
|
217
|
+
return;
|
218
|
+
},
|
219
|
+
}: {
|
220
|
+
videoTrackID: string;
|
221
|
+
audioTrackID: string;
|
222
|
+
isLocal: boolean;
|
223
|
+
isScreenshare: boolean;
|
224
|
+
showSpotlight: boolean;
|
225
|
+
showPinAction: boolean;
|
226
|
+
peerID: string;
|
227
|
+
canMinimise: boolean;
|
228
|
+
closeSheetOnClick: () => void;
|
229
|
+
openNameChangeModal: () => void;
|
230
|
+
}) => {
|
187
231
|
const actions = useHMSActions();
|
188
|
-
const
|
189
|
-
const {
|
190
|
-
videoTrackID,
|
191
|
-
audioTrackID,
|
192
|
-
isLocal,
|
193
|
-
isScreenshare,
|
194
|
-
showSpotlight,
|
195
|
-
showPinAction,
|
196
|
-
peerID,
|
197
|
-
canMinimise,
|
198
|
-
closeSheetOnClick = () => {
|
199
|
-
return;
|
200
|
-
},
|
201
|
-
openNameChangeModal = () => {
|
202
|
-
return;
|
203
|
-
},
|
204
|
-
} = props;
|
232
|
+
const removeOthers: boolean | undefined = useHMSStore(selectPermissions)?.removeOthers;
|
233
|
+
const { userName } = useHMSPrebuiltContext();
|
205
234
|
|
206
235
|
const { isAudioEnabled, isVideoEnabled, setVolume, toggleAudio, toggleVideo, volume } = useRemoteAVToggle(
|
207
236
|
audioTrackID,
|
@@ -215,22 +244,24 @@ export const TileMenuContent = props => {
|
|
215
244
|
const isMobile = useMedia(cssConfig.media.md);
|
216
245
|
|
217
246
|
return isLocal ? (
|
218
|
-
(showPinAction || canMinimise) && (
|
247
|
+
(showPinAction || canMinimise || !userName || showSpotlight) && (
|
219
248
|
<>
|
220
249
|
{showPinAction && <PinActions audioTrackID={audioTrackID} videoTrackID={videoTrackID} />}
|
221
250
|
{showSpotlight && <SpotlightActions peerId={peerID} onSpotLightClick={() => closeSheetOnClick()} />}
|
222
251
|
{canMinimise && <MinimiseInset />}
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
252
|
+
{!userName && (
|
253
|
+
<StyledMenuTile.ItemButton
|
254
|
+
onClick={() => {
|
255
|
+
openNameChangeModal();
|
256
|
+
closeSheetOnClick();
|
257
|
+
}}
|
258
|
+
>
|
259
|
+
<PencilIcon height={20} width={20} />
|
260
|
+
<Text variant="sm" css={{ '@md': { fontWeight: '$semiBold' }, c: '$on_surface_high' }}>
|
261
|
+
Change Name
|
262
|
+
</Text>
|
263
|
+
</StyledMenuTile.ItemButton>
|
264
|
+
)}
|
234
265
|
</>
|
235
266
|
)
|
236
267
|
) : (
|
@@ -271,7 +302,7 @@ export const TileMenuContent = props => {
|
|
271
302
|
Volume ({volume})
|
272
303
|
</Box>
|
273
304
|
</Flex>
|
274
|
-
<Slider css={{ my: '0.5rem' }} step={5} value={[volume]} onValueChange={e => setVolume(e[0])} />
|
305
|
+
<Slider css={{ my: '0.5rem' }} step={5} value={[volume || 100]} onValueChange={e => setVolume?.(e[0])} />
|
275
306
|
</StyledMenuTile.VolumeItem>
|
276
307
|
) : null}
|
277
308
|
|
@@ -30,8 +30,9 @@ export const VBCollection = ({
|
|
30
30
|
{title}
|
31
31
|
</Text>
|
32
32
|
<Box css={{ py: '$4', display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: '$8' }}>
|
33
|
-
{options.map(option => (
|
33
|
+
{options.map((option, index) => (
|
34
34
|
<VBOption.Root
|
35
|
+
testid={option.type === HMSVirtualBackgroundTypes.IMAGE ? `virtual_bg_option-${index}` : option.type}
|
35
36
|
key={option?.mediaURL || option?.title}
|
36
37
|
{...option}
|
37
38
|
isActive={
|
@@ -7,13 +7,16 @@ const Root = ({
|
|
7
7
|
mediaURL,
|
8
8
|
isActive,
|
9
9
|
children,
|
10
|
+
testid = '',
|
10
11
|
}: {
|
11
12
|
onClick?: () => Promise<void>;
|
12
13
|
mediaURL?: string;
|
13
14
|
isActive: boolean;
|
14
15
|
children?: React.JSX.Element[];
|
16
|
+
testid: string;
|
15
17
|
}) => (
|
16
18
|
<Flex
|
19
|
+
data-testid={testid}
|
17
20
|
direction="column"
|
18
21
|
align="center"
|
19
22
|
css={{
|
@@ -17,7 +17,7 @@ export const VBToggle = () => {
|
|
17
17
|
|
18
18
|
return (
|
19
19
|
<Tooltip side="top" disabled={isVBOpen} title="Configure Virtual Background">
|
20
|
-
<IconButton active={!isVBOpen} onClick={toggleVB}>
|
20
|
+
<IconButton active={!isVBOpen} onClick={toggleVB} data-testid="virtual_bg_btn">
|
21
21
|
<VirtualBackgroundIcon />
|
22
22
|
</IconButton>
|
23
23
|
</Tooltip>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { useCallback } from 'react';
|
2
|
-
import { useHMSActions } from '@100mslive/react-sdk';
|
2
|
+
import { selectSessionStore, useHMSActions, useHMSStore } from '@100mslive/react-sdk';
|
3
3
|
// @ts-ignore
|
4
4
|
import { ToastManager } from '../Toast/ToastManager';
|
5
5
|
import { SESSION_STORE_KEY } from '../../common/constants';
|
@@ -8,14 +8,16 @@ export const useChatBlacklist = (
|
|
8
8
|
sessionStoreKey: SESSION_STORE_KEY.CHAT_MESSAGE_BLACKLIST | SESSION_STORE_KEY.CHAT_PEER_BLACKLIST,
|
9
9
|
) => {
|
10
10
|
const hmsActions = useHMSActions();
|
11
|
+
const blacklistedIDs = useHMSStore(selectSessionStore(sessionStoreKey));
|
11
12
|
|
12
13
|
const blacklistItem = useCallback(
|
13
|
-
async (
|
14
|
+
async (blacklistID: string) => {
|
14
15
|
await hmsActions.sessionStore
|
15
|
-
.set(sessionStoreKey, [...blacklistedIDs, blacklistID])
|
16
|
-
.catch(err => ToastManager.addToast({ title: err.description }))
|
17
|
-
|
16
|
+
.set(sessionStoreKey, [...(blacklistedIDs || []), blacklistID])
|
17
|
+
.catch(err => ToastManager.addToast({ title: err.description }));
|
18
|
+
},
|
19
|
+
[hmsActions, sessionStoreKey, blacklistedIDs],
|
18
20
|
);
|
19
21
|
|
20
|
-
return { blacklistItem };
|
22
|
+
return { blacklistItem, blacklistedIDs };
|
21
23
|
};
|
@@ -54,14 +54,9 @@ export const useSetPinnedMessages = () => {
|
|
54
54
|
);
|
55
55
|
|
56
56
|
const unpinBlacklistedMessages = useCallback(
|
57
|
-
async (
|
58
|
-
pinnedMessages: PinnedMessage[] = [],
|
59
|
-
blacklistedPeerIDSet: Set<string>,
|
60
|
-
blacklistedMessageIDSet: Set<string>,
|
61
|
-
) => {
|
57
|
+
async (pinnedMessages: PinnedMessage[] = [], blacklistedMessageIDSet: Set<string>) => {
|
62
58
|
const filteredPinnedMessages = pinnedMessages?.filter(
|
63
|
-
pinnedMessage =>
|
64
|
-
!blacklistedMessageIDSet?.has(pinnedMessage.id) && !blacklistedPeerIDSet.has(pinnedMessage.authorId),
|
59
|
+
pinnedMessage => !blacklistedMessageIDSet?.has(pinnedMessage.id),
|
65
60
|
);
|
66
61
|
|
67
62
|
await hmsActions.sessionStore
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import React, { useEffect } from 'react';
|
2
2
|
import { useMedia } from 'react-use';
|
3
|
-
import { ConferencingScreen } from '@100mslive/types-prebuilt';
|
4
3
|
import { selectAppData, selectVideoTrackByPeerID, useHMSStore } from '@100mslive/react-sdk';
|
5
4
|
import { Polls } from '../components/Polls/Polls';
|
6
5
|
import { SidePaneTabs } from '../components/SidePaneTabs';
|
@@ -15,15 +14,12 @@ import { config as cssConfig } from '../../Theme';
|
|
15
14
|
import { useSidepaneReset } from '../components/AppData/useSidepane';
|
16
15
|
import { useRoomLayoutConferencingScreen } from '../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
|
17
16
|
import { translateAcross } from '../../utils';
|
18
|
-
// @ts-ignore: No implicit Any
|
19
17
|
import { APP_DATA, SIDE_PANE_OPTIONS } from '../common/constants';
|
20
18
|
|
21
19
|
const SidePane = ({
|
22
|
-
screenType,
|
23
20
|
tileProps,
|
24
21
|
hideControls = false,
|
25
22
|
}: {
|
26
|
-
screenType: keyof ConferencingScreen;
|
27
23
|
tileProps?: TileCustomisationProps;
|
28
24
|
hideControls?: boolean;
|
29
25
|
}) => {
|
@@ -38,7 +34,7 @@ const SidePane = ({
|
|
38
34
|
ViewComponent = <Polls />;
|
39
35
|
}
|
40
36
|
if (sidepane === SIDE_PANE_OPTIONS.PARTICIPANTS || sidepane === SIDE_PANE_OPTIONS.CHAT) {
|
41
|
-
ViewComponent = <SidePaneTabs
|
37
|
+
ViewComponent = <SidePaneTabs hideControls={hideControls} active={sidepane} />;
|
42
38
|
}
|
43
39
|
if (sidepane === SIDE_PANE_OPTIONS.VB) {
|
44
40
|
ViewComponent = <VBPicker {...elements.virtual_background} />;
|