From be79b01890450ff7f69559e670887fa5045521b3 Mon Sep 17 00:00:00 2001 From: KaustubhKumar05 Date: Wed, 30 Aug 2023 15:30:55 +0530 Subject: [PATCH 1/4] fix: alignment for sender name and time --- .../roomkit-react/src/Prebuilt/components/Chat/ChatBody.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/roomkit-react/src/Prebuilt/components/Chat/ChatBody.jsx b/packages/roomkit-react/src/Prebuilt/components/Chat/ChatBody.jsx index b7670e363e..7a82997abe 100644 --- a/packages/roomkit-react/src/Prebuilt/components/Chat/ChatBody.jsx +++ b/packages/roomkit-react/src/Prebuilt/components/Chat/ChatBody.jsx @@ -257,7 +257,7 @@ const ChatMessage = React.memo(({ index, style = {}, message, setRowHeight, onPi }} as="div" > - + {message.senderName === 'You' || !message.senderName ? ( {message.senderName || 'Anonymous'} From 1204cc262dc38744ceb9877d1d9eb80a26628233 Mon Sep 17 00:00:00 2001 From: KaustubhKumar05 Date: Wed, 30 Aug 2023 15:35:33 +0530 Subject: [PATCH 2/4] fix: remove active speaker mode --- .../src/Prebuilt/common/constants.js | 1 - .../Prebuilt/components/AppData/AppData.jsx | 10 ++---- .../components/Settings/LayoutSettings.jsx | 10 ------ .../Prebuilt/layouts/ActiveSpeakerView.jsx | 34 ------------------- 4 files changed, 2 insertions(+), 53 deletions(-) delete mode 100755 packages/roomkit-react/src/Prebuilt/layouts/ActiveSpeakerView.jsx diff --git a/packages/roomkit-react/src/Prebuilt/common/constants.js b/packages/roomkit-react/src/Prebuilt/common/constants.js index 86213c33df..17c1ca8273 100644 --- a/packages/roomkit-react/src/Prebuilt/common/constants.js +++ b/packages/roomkit-react/src/Prebuilt/common/constants.js @@ -9,7 +9,6 @@ export const QUERY_PARAM_NAME = 'name'; export const QUERY_PARAM_VIEW_MODE = 'ui_mode'; export const QUERY_PARAM_AUTH_TOKEN = 'auth_token'; export const QUERY_PARAM_PREVIEW_AS_ROLE = 'preview_as_role'; -export const UI_MODE_ACTIVE_SPEAKER = 'activespeaker'; export const UI_MODE_GRID = 'grid'; export const MAX_TOASTS = 5; export const RTMP_RECORD_RESOLUTION_MIN = 480; diff --git a/packages/roomkit-react/src/Prebuilt/components/AppData/AppData.jsx b/packages/roomkit-react/src/Prebuilt/components/AppData/AppData.jsx index 94e07be46a..519adbfb70 100644 --- a/packages/roomkit-react/src/Prebuilt/components/AppData/AppData.jsx +++ b/packages/roomkit-react/src/Prebuilt/components/AppData/AppData.jsx @@ -1,5 +1,4 @@ import React, { useEffect } from 'react'; -import { useSearchParam } from 'react-use'; import { HMSRoomState, selectAvailableRoleNames, @@ -24,9 +23,7 @@ import { DEFAULT_HLS_ROLE_KEY, DEFAULT_HLS_VIEWER_ROLE, DEFAULT_WAITING_VIEWER_ROLE, - QUERY_PARAM_VIEW_MODE, SIDE_PANE_OPTIONS, - UI_MODE_ACTIVE_SPEAKER, UI_MODE_GRID, UI_SETTINGS, } from '../../common/constants'; @@ -83,7 +80,6 @@ export const AppData = React.memo(({ appDetails, tokenEndpoint }) => { const roleNames = useHMSStore(selectAvailableRoleNames); const rolesMap = useHMSStore(selectRolesMap); const localPeerRole = useHMSStore(selectLocalPeerRoleName); - const isDefaultModeActiveSpeaker = useSearchParam(QUERY_PARAM_VIEW_MODE) === UI_MODE_ACTIVE_SPEAKER; useEffect(() => { if (!isConnected && sidePane && sidePane !== SIDE_PANE_OPTIONS.PARTICIPANTS) { @@ -104,12 +100,10 @@ export const AppData = React.memo(({ appDetails, tokenEndpoint }) => { const uiSettings = preferences || {}; const updatedSettings = { ...uiSettings, - [UI_SETTINGS.uiViewMode]: isDefaultModeActiveSpeaker - ? UI_MODE_ACTIVE_SPEAKER - : uiSettings.uiViewMode || UI_MODE_GRID, + [UI_SETTINGS.uiViewMode]: uiSettings.uiViewMode || UI_MODE_GRID, }; hmsActions.setAppData(APP_DATA.uiSettings, updatedSettings, true); - }, [preferences, isDefaultModeActiveSpeaker, hmsActions]); + }, [preferences, hmsActions]); useEffect(() => { const appData = { diff --git a/packages/roomkit-react/src/Prebuilt/components/Settings/LayoutSettings.jsx b/packages/roomkit-react/src/Prebuilt/components/Settings/LayoutSettings.jsx index ce76652a10..c429aeeddb 100644 --- a/packages/roomkit-react/src/Prebuilt/components/Settings/LayoutSettings.jsx +++ b/packages/roomkit-react/src/Prebuilt/components/Settings/LayoutSettings.jsx @@ -25,16 +25,6 @@ export const LayoutSettings = () => { return ( - { - setUISettings({ - [UI_SETTINGS.uiViewMode]: value ? UI_MODE_ACTIVE_SPEAKER : UI_MODE_GRID, - }); - }} - id="activeSpeakerMode" - label="Active Speaker Mode" - /> { - const dominantSpeaker = useHMSStore(selectDominantSpeaker); - const latestDominantSpeakerRef = useRef(dominantSpeaker); - const peers = (useHMSStore(selectPeers) || []).filter( - peer => peer.videoTrack || peer.audioTrack || peer.auxiliaryTracks.length > 0, - ); - // if there is no current dominant speaker latest keeps pointing to last - if (dominantSpeaker) { - latestDominantSpeakerRef.current = dominantSpeaker; - } - if (peers.length === 0) { - return null; - } - // show local peer if there hasn't been any dominant speaker - const activeSpeaker = latestDominantSpeakerRef.current || peers[0]; - const showSidePane = activeSpeaker && peers.length > 1; - - return ( - - - - - {showSidePane && peer.id !== activeSpeaker.id)} />} - - ); -}; - -export default ActiveSpeakerView; From a2a423370cf0fbc5f91f4ebf6c2d200a372bb133 Mon Sep 17 00:00:00 2001 From: KaustubhKumar05 Date: Wed, 30 Aug 2023 15:41:35 +0530 Subject: [PATCH 3/4] fix: unused imports --- .../src/Prebuilt/components/Settings/LayoutSettings.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/roomkit-react/src/Prebuilt/components/Settings/LayoutSettings.jsx b/packages/roomkit-react/src/Prebuilt/components/Settings/LayoutSettings.jsx index c429aeeddb..b2981d4ac3 100644 --- a/packages/roomkit-react/src/Prebuilt/components/Settings/LayoutSettings.jsx +++ b/packages/roomkit-react/src/Prebuilt/components/Settings/LayoutSettings.jsx @@ -4,7 +4,7 @@ import { Box, Flex, Slider, Text } from '../../../'; import SwitchWithLabel from './SwitchWithLabel'; import { useSetUiSettings } from '../AppData/useUISettings'; import { settingOverflow } from './common.js'; -import { UI_MODE_ACTIVE_SPEAKER, UI_MODE_GRID, UI_SETTINGS } from '../../common/constants'; +import { UI_SETTINGS } from '../../common/constants'; export const LayoutSettings = () => { const hmsActions = useHMSActions(); From c9b2bbb3a256ba0a7430beb6882245a27f287e56 Mon Sep 17 00:00:00 2001 From: KaustubhKumar05 Date: Wed, 30 Aug 2023 15:44:44 +0530 Subject: [PATCH 4/4] fix: unused import --- .../src/Prebuilt/components/Settings/LayoutSettings.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/roomkit-react/src/Prebuilt/components/Settings/LayoutSettings.jsx b/packages/roomkit-react/src/Prebuilt/components/Settings/LayoutSettings.jsx index b2981d4ac3..8abe512dd3 100644 --- a/packages/roomkit-react/src/Prebuilt/components/Settings/LayoutSettings.jsx +++ b/packages/roomkit-react/src/Prebuilt/components/Settings/LayoutSettings.jsx @@ -10,7 +10,7 @@ export const LayoutSettings = () => { const hmsActions = useHMSActions(); const isLocalVideoEnabled = useHMSStore(selectIsLocalVideoEnabled); const isLocalScreenShared = useHMSStore(selectIsLocalScreenShared); - const [{ isAudioOnly, uiViewMode, maxTileCount, mirrorLocalVideo }, setUISettings] = useSetUiSettings(); + const [{ isAudioOnly, maxTileCount, mirrorLocalVideo }, setUISettings] = useSetUiSettings(); const toggleIsAudioOnly = useCallback( async isAudioOnlyModeOn => { if (isAudioOnlyModeOn) {