diff --git a/packages/roomkit-react/src/Prebuilt/components/Chat/Chat.tsx b/packages/roomkit-react/src/Prebuilt/components/Chat/Chat.tsx index 1ce47c121e..ae455703d7 100644 --- a/packages/roomkit-react/src/Prebuilt/components/Chat/Chat.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/Chat/Chat.tsx @@ -10,17 +10,20 @@ import { Box, Flex } from '../../../Layout'; import { config as cssConfig } from '../../../Theme'; // @ts-ignore: No implicit any import { EmojiReaction } from '../EmojiReaction'; +import { MoreSettings } from '../MoreSettings/MoreSettings'; +import { RaiseHand } from '../RaiseHand'; import { ChatBody } from './ChatBody'; import { ChatFooter } from './ChatFooter'; import { ChatBlocked, ChatPaused } from './ChatStates'; import { PinnedMessage } from './PinnedMessage'; import { useRoomLayoutConferencingScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen'; import { useSidepaneResetOnLayoutUpdate } from '../AppData/useSidepaneResetOnLayoutUpdate'; +import { useIsPeerBlacklisted } from '../hooks/useChatBlacklist'; import { useLandscapeHLSStream, useMobileHLSStream } from '../../common/hooks'; import { SESSION_STORE_KEY, SIDE_PANE_OPTIONS } from '../../common/constants'; export const Chat = () => { - const { elements } = useRoomLayoutConferencingScreen(); + const { elements, screenType } = useRoomLayoutConferencingScreen(); const listRef = useRef(null); const hmsActions = useHMSActions(); const vanillaStore = useHMSVanillaStore(); @@ -29,6 +32,7 @@ export const Chat = () => { const isMobileHLSStream = useMobileHLSStream(); const isLandscapeStream = useLandscapeHLSStream(); useSidepaneResetOnLayoutUpdate('chat', SIDE_PANE_OPTIONS.CHAT); + const isLocalPeerBlacklisted = useIsPeerBlacklisted({ local: true }); const scrollToBottom = useCallback( (unreadCount = 0) => { @@ -57,20 +61,27 @@ export const Chat = () => { > {isMobile && elements?.chat?.is_overlay && !streaming ? null : } - - - + + + + {streaming && (!isChatEnabled || isLocalPeerBlacklisted) && ( + <> + + + + )} + {isMobile && elements?.chat?.is_overlay && !streaming ? : null} {isChatEnabled ? ( ) : null} - {(isMobileHLSStream || isLandscapeStream) && ( + {streaming && ( { { isMobileHLSStream: true, isChatEnabled: true, + isLocalPeerBlacklisted: false, }, () => ({ bottom: '$17', right: '$8' }), ) @@ -103,6 +115,14 @@ export const Chat = () => { { isLandscapeStream: false, isChatEnabled: true, + isLocalPeerBlacklisted: true, + }, + () => ({ bottom: '$18', right: '$8' }), + ) + .with( + { + isMobileHLSStream: true, + isLocalPeerBlacklisted: true, }, () => ({ bottom: '$20', right: '$8' }), ) diff --git a/packages/roomkit-react/src/Prebuilt/components/Chat/ChatStates.tsx b/packages/roomkit-react/src/Prebuilt/components/Chat/ChatStates.tsx index a55665a013..9c1308be78 100644 --- a/packages/roomkit-react/src/Prebuilt/components/Chat/ChatStates.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/Chat/ChatStates.tsx @@ -30,7 +30,7 @@ export const ChatPaused = () => {