File tree Expand file tree Collapse file tree 7 files changed +30
-5
lines changed
MessageAggregators/common Expand file tree Collapse file tree 7 files changed +30
-5
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import {
2121 usePinnedMessageStore ,
2222 useStarredMessageStore ,
2323 useFileStore ,
24+ useSidebarStore ,
2425} from '../../store' ;
2526import { DynamicHeader } from '../DynamicHeader' ;
2627import useFetchChatData from '../../hooks/useFetchChatData' ;
@@ -84,7 +85,7 @@ const ChatHeader = ({
8485 const setIsUserAuthenticated = useUserStore (
8586 ( state ) => state . setIsUserAuthenticated
8687 ) ;
87-
88+ const setShowSidebar = useSidebarStore ( ( state ) => state . setShowSidebar ) ;
8889 const dispatchToastMessage = useToastBarDispatch ( ) ;
8990 const { getMessagesAndRoles } = useFetchChatData ( showRoles ) ;
9091 const setMessageLimit = useSettingsStore ( ( state ) => state . setMessageLimit ) ;
@@ -130,6 +131,7 @@ const ChatHeader = ({
130131 try {
131132 await RCInstance . logout ( ) ;
132133 setMessages ( [ ] ) ;
134+ setShowSidebar ( false ) ;
133135 setUserAvatarUrl ( null ) ;
134136 useMessageStore . setState ( { isMessageLoaded : false } ) ;
135137 } catch ( e ) {
Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ const getGlobalStyles = (theme) => css`
88 margin : 0 ;
99 padding : 0 ;
1010 }
11-
1211 .ec-embedded-chat body {
1312 font-family : ${ theme . typography . default . fontFamily } ;
1413 font-size : ${ theme . typography . default . fontSize } px;
@@ -36,6 +35,17 @@ const getGlobalStyles = (theme) => css`
3635 .ec-embedded-chat ::-webkit-scrollbar-button {
3736 display : none;
3837 }
38+ @media (max-width : 780px ) {
39+ .ec-sidebar {
40+ position : absolute;
41+ width : 100% !important ;
42+ height : calc (100% - 56.39px ) !important ;
43+ min-width : 250px !important ;
44+ left : 0 ;
45+ bottom : 0 ;
46+ background : ${ theme . colors . background } !important ;
47+ }
48+ }
3949` ;
4050
4151const GlobalStyles = ( ) => {
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import {
1111import { Attachments } from '../AttachmentHandler' ;
1212import { Markdown } from '../Markdown' ;
1313import MessageHeader from './MessageHeader' ;
14- import { useMessageStore , useUserStore } from '../../store' ;
14+ import { useMessageStore , useUserStore , useSidebarStore } from '../../store' ;
1515import RCContext from '../../context/RCInstance' ;
1616import { MessageBody } from './MessageBody' ;
1717import { MessageReactions } from './MessageReactions' ;
@@ -49,7 +49,7 @@ const Message = ({
4949
5050 const { RCInstance, ECOptions } = useContext ( RCContext ) ;
5151 showAvatar = ECOptions ?. showAvatar && showAvatar ;
52-
52+ const { showSidebar , setShowSidebar } = useSidebarStore ( ) ;
5353 const authenticatedUserId = useUserStore ( ( state ) => state . userId ) ;
5454 const authenticatedUserUsername = useUserStore ( ( state ) => state . username ) ;
5555 const userRoles = useUserStore ( ( state ) => state . roles ) ;
@@ -137,6 +137,7 @@ const Message = ({
137137
138138 const handleOpenThread = ( msg ) => async ( ) => {
139139 openThread ( msg ) ;
140+ setShowSidebar ( false ) ;
140141 } ;
141142
142143 const isStarred = message . starred ?. find ( ( u ) => u . _id === authenticatedUserId ) ;
Original file line number Diff line number Diff line change @@ -81,6 +81,9 @@ export const getMessageDividerStyles = (theme) => {
8181 margin-bottom : 0.75rem ;
8282 padding-left : 1.25rem ;
8383 padding-right : 1.25rem ;
84+ @media (max-width : 780px ) {
85+ z-index : 1 ;
86+ }
8487 ` ,
8588
8689 dividerContent : css `
Original file line number Diff line number Diff line change @@ -70,7 +70,11 @@ export const MessageAggregator = ({
7070 iconName = { iconName }
7171 searchProps = { searchProps }
7272 onClose = { ( ) => setExclusiveState ( null ) }
73- style = { { padding : 0 } }
73+ style = { {
74+ width : '400px' ,
75+ padding : 0 ,
76+ zIndex : window . innerWidth <= 780 ? 1 : null ,
77+ } }
7478 { ...( viewType === 'Popup'
7579 ? {
7680 isPopupHeader : true ,
@@ -126,6 +130,9 @@ export const MessageAggregator = ({
126130 isInSidebar
127131 style = { {
128132 flex : 1 ,
133+ paddingLeft : 3 ,
134+ paddingRight : 2 ,
135+ minWidth : 0 ,
129136 } }
130137 />
131138
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ const Roominfo = () => {
3030 title = "Room Information"
3131 iconName = "info"
3232 onClose = { ( ) => setExclusiveState ( null ) }
33+ style = { { width : '400px' , zIndex : window . innerWidth <= 780 ? 1 : null } }
3334 { ...( viewType === 'Popup'
3435 ? {
3536 isPopupHeader : true ,
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ const RoomMembers = ({ members }) => {
5555 title = "Members"
5656 iconName = "members"
5757 onClose = { ( ) => setExclusiveState ( null ) }
58+ style = { { width : '400px' , zIndex : window . innerWidth <= 780 ? 1 : null } }
5859 { ...( viewType === 'Popup'
5960 ? {
6061 isPopupHeader : true ,
You can’t perform that action at this time.
0 commit comments