Skip to content

Commit

Permalink
Update publish-alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
raviteja83 authored Mar 4, 2024
2 parents 3284626 + 31f3c0c commit 1c63784
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 5 deletions.
21 changes: 18 additions & 3 deletions packages/roomkit-react/src/Prebuilt/components/Chat/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export const Chat = () => {
if (!elements?.chat) {
return null;
}
const streaming = isMobileHLSStream || isLandscapeStream;

return (
<Flex
Expand All @@ -55,12 +56,12 @@ export const Chat = () => {
gap: '$4',
}}
>
{isMobile && elements?.chat?.is_overlay ? null : <PinnedMessage />}
{isMobile && elements?.chat?.is_overlay && !streaming ? null : <PinnedMessage />}
<ChatBody ref={listRef} scrollToBottom={scrollToBottom} />

<ChatPaused />
<ChatBlocked />
{isMobile && elements?.chat?.is_overlay ? <PinnedMessage /> : null}
{isMobile && elements?.chat?.is_overlay && !streaming ? <PinnedMessage /> : null}
{isChatEnabled ? (
<ChatFooter onSend={scrollToBottom}>
<NewMessageIndicator scrollToBottom={scrollToBottom} listRef={listRef} />
Expand All @@ -70,7 +71,7 @@ export const Chat = () => {
<Box
css={{
position: 'absolute',
...match({ isLandscapeStream, isChatEnabled })
...match({ isLandscapeStream, isMobileHLSStream, isChatEnabled })
.with(
{
isLandscapeStream: true,
Expand All @@ -85,6 +86,20 @@ export const Chat = () => {
},
() => ({ bottom: '$20', right: '$10' }),
)
.with(
{
isMobileHLSStream: true,
isChatEnabled: false,
},
() => ({ bottom: '$19', right: '$8' }),
)
.with(
{
isMobileHLSStream: true,
isChatEnabled: true,
},
() => ({ bottom: '$17', right: '$8' }),
)
.with(
{
isLandscapeStream: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { config as cssConfig } from '../../../Theme';
import emptyChat from '../../images/empty-chat.svg';
import { useRoomLayoutConferencingScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
import { useIsPeerBlacklisted } from '../hooks/useChatBlacklist';
import { useLandscapeHLSStream, useMobileHLSStream } from '../../common/hooks';

export const EmptyChat = () => {
const { elements } = useRoomLayoutConferencingScreen();
Expand All @@ -18,8 +19,11 @@ export const EmptyChat = () => {
elements.chat.private_chat_enabled ||
(elements.chat.roles_whitelist && elements.chat.roles_whitelist.length)) &&
!isLocalPeerBlacklisted;
const isMobileHLSStream = useMobileHLSStream();
const isLandscapeStream = useLandscapeHLSStream();
const streaming = isMobileHLSStream || isLandscapeStream;

if (isMobile && elements?.chat?.is_overlay) return <></>;
if (isMobile && elements?.chat?.is_overlay && !streaming) return <></>;

return (
<Flex
Expand Down
3 changes: 2 additions & 1 deletion packages/roomkit-react/src/Prebuilt/layouts/HLSView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,11 @@ const HLSView = () => {
action: (
<Button
onClick={() => {
hmsActions.setAppData({
hmsActions.setAppData(APP_DATA.pollState, {
[POLL_STATE.pollInView]: pollId,
[POLL_STATE.view]: POLL_VIEWS.VOTE,
});
hmsActions.setAppData(APP_DATA.sidePane, SIDE_PANE_OPTIONS.POLLS);
}}
variant="standard"
css={{
Expand Down
6 changes: 6 additions & 0 deletions packages/roomkit-react/src/Prebuilt/layouts/SidePane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ const Wrapper = styled('div', {
},
},
},
roomDescription: {
true: {
overflowY: 'auto',
},
},
hideControls: {
true: {},
},
Expand Down Expand Up @@ -151,6 +156,7 @@ const SidePane = ({
mobileStream: isMobileHLSStream,
hideControls,
overlayChat: !!elements?.chat?.is_overlay,
roomDescription: isMobile && sidepane === SIDE_PANE_OPTIONS.ROOM_DETAILS,
};

const SidepaneComponent = match(sidepane)
Expand Down

0 comments on commit 1c63784

Please sign in to comment.