Skip to content

Commit 89a065f

Browse files
disable-navigation-wrapper function
1 parent 2775412 commit 89a065f

File tree

2 files changed

+47
-11
lines changed

2 files changed

+47
-11
lines changed

src/app/organisms/room/RoomViewHeader.jsx

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,28 +59,40 @@ function RoomViewHeader({ roomId }) {
5959

6060
setTimeout(forceUnloadedAvatars, 200);
6161

62+
const navigationSidebarCallback = () => {
63+
if (window.matchMedia('screen and (max-width: 768px)').matches) {
64+
selectRoomMode('navigation');
65+
openNavigation();
66+
} else if ($('body').hasClass('disable-navigation-wrapper')) {
67+
$('body').removeClass('disable-navigation-wrapper');
68+
} else {
69+
$('body').addClass('disable-navigation-wrapper');
70+
}
71+
};
72+
6273
return (
6374
<Header>
6475

6576
<ul className='navbar-nav mr-auto'>
6677

6778
<li className="nav-item back-navigation">
79+
6880
<IconButton
69-
className="nav-link"
81+
className="nav-link nav-sidebar-1"
7082
fa="fa-solid fa-chevron-left"
7183
tooltip="Navigation sidebar"
7284
tooltipPlacement="bottom"
73-
onClick={() => {
74-
if (window.matchMedia('screen and (max-width: 768px)').matches) {
75-
selectRoomMode('navigation');
76-
openNavigation();
77-
} else if ($('body').hasClass('disable-navigation-wrapper')) {
78-
$('body').removeClass('disable-navigation-wrapper');
79-
} else {
80-
$('body').addClass('disable-navigation-wrapper');
81-
}
82-
}}
85+
onClick={navigationSidebarCallback}
8386
/>
87+
88+
<IconButton
89+
className="nav-link nav-sidebar-2"
90+
fa="fa-solid fa-chevron-right"
91+
tooltip="Navigation sidebar"
92+
tooltipPlacement="bottom"
93+
onClick={navigationSidebarCallback}
94+
/>
95+
8496
</li>
8597

8698
<li className="nav-item avatar-base">

src/scss/Client.scss

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,34 @@
6969
.room-view--dropped > .navbar {
7070
top: 2px;
7171
}
72+
73+
.room-view .nav-sidebar-2 {
74+
display: none !important;
75+
}
76+
}
77+
78+
/* Navigation Wrapper hide */
79+
body:not(.disable-navigation-wrapper) {
80+
.room-view .nav-sidebar-2 {
81+
display: none !important;
82+
}
7283
}
7384

7485
@media (min-width: 768px) {
7586
.room-view > .navbar {
7687
background-color: var(--bg-surface);
7788
}
89+
90+
.disable-navigation-wrapper {
91+
#space-header,
92+
#profile-sidebar {
93+
display: none;
94+
}
95+
.navigation-wrapper {
96+
width: 80px;
97+
}
98+
.room-view .nav-sidebar-1 {
99+
display: none !important;
100+
}
101+
}
78102
}

0 commit comments

Comments
 (0)