Skip to content

Commit

Permalink
Merge branch 'develop' into feat/copy-message
Browse files Browse the repository at this point in the history
  • Loading branch information
devanshkansagra authored Dec 22, 2024
2 parents 8a8b4b3 + 9a3b7ac commit ad575e6
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 5 deletions.
4 changes: 3 additions & 1 deletion packages/react/src/views/ChatHeader/ChatHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
usePinnedMessageStore,
useStarredMessageStore,
useFileStore,
useSidebarStore,
} from '../../store';
import { DynamicHeader } from '../DynamicHeader';
import useFetchChatData from '../../hooks/useFetchChatData';
Expand Down Expand Up @@ -84,7 +85,7 @@ const ChatHeader = ({
const setIsUserAuthenticated = useUserStore(
(state) => state.setIsUserAuthenticated
);

const setShowSidebar = useSidebarStore((state) => state.setShowSidebar);
const dispatchToastMessage = useToastBarDispatch();
const { getMessagesAndRoles } = useFetchChatData(showRoles);
const setMessageLimit = useSettingsStore((state) => state.setMessageLimit);
Expand Down Expand Up @@ -130,6 +131,7 @@ const ChatHeader = ({
try {
await RCInstance.logout();
setMessages([]);
setShowSidebar(false);
setUserAvatarUrl(null);
useMessageStore.setState({ isMessageLoaded: false });
} catch (e) {
Expand Down
12 changes: 11 additions & 1 deletion packages/react/src/views/GlobalStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const getGlobalStyles = (theme) => css`
margin: 0;
padding: 0;
}
.ec-embedded-chat body {
font-family: ${theme.typography.default.fontFamily};
font-size: ${theme.typography.default.fontSize}px;
Expand Down Expand Up @@ -36,6 +35,17 @@ const getGlobalStyles = (theme) => css`
.ec-embedded-chat ::-webkit-scrollbar-button {
display: none;
}
@media (max-width: 780px) {
.ec-sidebar {
position: absolute;
width: 100% !important;
height: calc(100% - 56.39px) !important;
min-width: 250px !important;
left: 0;
bottom: 0;
background: ${theme.colors.background}!important;
}
}
`;

const GlobalStyles = () => {
Expand Down
5 changes: 3 additions & 2 deletions packages/react/src/views/Message/Message.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import { Attachments } from '../AttachmentHandler';
import { Markdown } from '../Markdown';
import MessageHeader from './MessageHeader';
import { useMessageStore, useUserStore } from '../../store';
import { useMessageStore, useUserStore, useSidebarStore } from '../../store';
import RCContext from '../../context/RCInstance';
import { MessageBody } from './MessageBody';
import { MessageReactions } from './MessageReactions';
Expand Down Expand Up @@ -49,7 +49,7 @@ const Message = ({

const { RCInstance, ECOptions } = useContext(RCContext);
showAvatar = ECOptions?.showAvatar && showAvatar;

const { showSidebar, setShowSidebar } = useSidebarStore();
const authenticatedUserId = useUserStore((state) => state.userId);
const authenticatedUserUsername = useUserStore((state) => state.username);
const userRoles = useUserStore((state) => state.roles);
Expand Down Expand Up @@ -176,6 +176,7 @@ const Message = ({

const handleOpenThread = (msg) => async () => {
openThread(msg);
setShowSidebar(false);
};

const isStarred = message.starred?.find((u) => u._id === authenticatedUserId);
Expand Down
3 changes: 3 additions & 0 deletions packages/react/src/views/Message/Message.styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ export const getMessageDividerStyles = (theme) => {
margin-bottom: 0.75rem;
padding-left: 1.25rem;
padding-right: 1.25rem;
@media (max-width: 780px) {
z-index: 1;
}
`,

dividerContent: css`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ export const MessageAggregator = ({
iconName={iconName}
searchProps={searchProps}
onClose={() => setExclusiveState(null)}
style={{ padding: 0 }}
style={{
width: '400px',
padding: 0,
zIndex: window.innerWidth <= 780 ? 1 : null,
}}
{...(viewType === 'Popup'
? {
isPopupHeader: true,
Expand Down Expand Up @@ -126,6 +130,9 @@ export const MessageAggregator = ({
isInSidebar
style={{
flex: 1,
paddingLeft: 3,
paddingRight: 2,
minWidth: 0,
}}
/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const Roominfo = () => {
title="Room Information"
iconName="info"
onClose={() => setExclusiveState(null)}
style={{ width: '400px', zIndex: window.innerWidth <= 780 ? 1 : null }}
{...(viewType === 'Popup'
? {
isPopupHeader: true,
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/views/RoomMembers/RoomMember.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const RoomMembers = ({ members }) => {
title="Members"
iconName="members"
onClose={() => setExclusiveState(null)}
style={{ width: '400px', zIndex: window.innerWidth <= 780 ? 1 : null }}
{...(viewType === 'Popup'
? {
isPopupHeader: true,
Expand Down

0 comments on commit ad575e6

Please sign in to comment.