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

Merged
merged 22 commits into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4bd0e53
Fixed UI issues for Sidebar
abirc8010 Oct 1, 2024
6d34acc
Merge branch 'develop' into make-sidebar-responsive
abirc8010 Oct 6, 2024
67ac114
Fixed sidebar height issue
abirc8010 Oct 7, 2024
4f779b9
Removed unnecessary spacing
abirc8010 Oct 11, 2024
7355815
Merge branch 'develop' into make-sidebar-responsive
Spiral-Memory Nov 2, 2024
f9cefcd
Fixed reply in thread issue
abirc8010 Nov 2, 2024
2b76bb9
Adjusted dynamic header visibility
abirc8010 Nov 2, 2024
57434e2
Merge branch 'RocketChat:develop' into make-sidebar-responsive
abirc8010 Nov 6, 2024
eda168b
Merge branch 'develop' into make-sidebar-responsive
Spiral-Memory Nov 10, 2024
2956300
Merge branch 'develop' into make-sidebar-responsive
abirc8010 Nov 11, 2024
b0d26cc
Merge branch 'develop' into make-sidebar-responsive
abirc8010 Nov 11, 2024
8779fea
Merge branch 'develop' into make-sidebar-responsive
abirc8010 Nov 29, 2024
8f4990d
Merge branch 'develop' into make-sidebar-responsive
abirc8010 Dec 15, 2024
f5967d9
Merge branch 'develop' into make-sidebar-responsive
abirc8010 Dec 15, 2024
1d9aea9
Revert zIndex changes
abirc8010 Dec 15, 2024
4c16eed
Linting fix
abirc8010 Dec 15, 2024
76a5e71
Run prettier
abirc8010 Dec 15, 2024
4438840
Remove zIndex
abirc8010 Dec 15, 2024
c1fc25d
Adjusted zIndex for ViewComponent
abirc8010 Dec 15, 2024
8a5590d
Fix sidebar width
abirc8010 Dec 15, 2024
3f7d144
Remove global css for sidebar
abirc8010 Dec 16, 2024
60ef15d
Merge branch 'develop' into make-sidebar-responsive
abirc8010 Dec 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -137,6 +137,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
Loading