Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed UI issues for Sidebar #634

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from
1 change: 0 additions & 1 deletion packages/react/src/views/ChatHeader/ChatHeader.styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const getChatHeaderStyles = ({ theme, mode }) => {
? darken(theme.colors.background, 0.03)
: lighten(theme.colors.background, 1)};
width: 100%;
z-index: 1200;
display: flex;
flex-direction: column;
padding: 0.75rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const useDynamicHeaderStyles = () => {
justify-content: space-between;
align-items: center;
width: 100%;
z-index: 1200;
padding-block-start: 10px;
`,

Expand Down
13 changes: 12 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,18 @@ 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;
z-index: 1;
background: ${theme.colors.background}!important;
}
}
`;

const GlobalStyles = () => {
Expand Down
7 changes: 4 additions & 3 deletions packages/react/src/views/Message/Message.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { memo, useContext } from 'react';
import PropTypes from 'prop-types';
import { format } from 'date-fns';
import { format, set } from 'date-fns';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

importing set ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it was automatically imported by vs code . It doesn't have a use case in this context, I'll remove it.

import {
Box,
useToastBarDispatch,
Expand All @@ -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 @@ -48,7 +48,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 [setMessageToReport, toggleShowReportMessage] = useMessageStore(
Expand Down Expand Up @@ -130,6 +130,7 @@ const Message = ({

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

const isStarred = message.starred?.find((u) => u._id === authenticatedUserId);
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/views/Message/Message.styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const getMessageDividerStyles = (theme) => {
line-height: 1rem;
position: relative;
display: flex;
z-index: 1000;
z-index: 1;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little afraid about z-index changes. It might disturb the existing flow in some situation. Is this required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@Spiral-Memory , actually due to a high value of z-index, the message divider was appearing on top of the sidebar like the image shown , so I had to decrease the value.

align-items: center;
margin-top: 0.5rem;
margin-bottom: 0.75rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const MessageAggregator = ({
iconName={iconName}
searchProps={searchProps}
onClose={() => setExclusiveState(null)}
style={{ padding: 0 }}
style={{ zIndex: 1 }}
{...(viewType === 'Popup'
? {
isPopupHeader: true,
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={{ zIndex: 1 }}
{...(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={{ zIndex: 1 }}
{...(viewType === 'Popup'
? {
isPopupHeader: true,
Expand Down
Loading