Skip to content

Commit c32671e

Browse files
committed
let user resize sidebar
1 parent 1c7e291 commit c32671e

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

app/javascript/components/workflows/student/exams/show/components/navbar/NavAccordionItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const NavAccordionItem: React.FC<NavAccordionItemProps> = (props) => {
3636
onClick={(): void => onSectionClick(eventKey)}
3737
>
3838
<RenderIcon I={Icon} className="" />
39-
<span aria-hidden="true" className="width-0">&nbsp;</span>
39+
<span aria-hidden="true" className="mw-0">&nbsp;</span>
4040
<Collapse
4141
in={expanded}
4242
dimension="width"

app/javascript/components/workflows/student/exams/show/components/navbar/index.css

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
.sidebar-small {
2-
width: var(--sidebar-small);
2+
transition: 0.35s max-width ease-in-out, 0.35s min-width ease-in-out;
3+
min-width: var(--sidebar-small);
4+
max-width: var(--sidebar-small);
35
}
46

57
.sidebar-expanded {
6-
width: var(--sidebar-expanded);
8+
transition: 0.35s max-width ease-in-out, 0.35s min-width ease-in-out;
9+
min-width: var(--sidebar-expanded);
10+
max-width: 50%;
11+
resize: horizontal;
12+
overflow: auto;
13+
}
14+
15+
.mw-0 {
16+
max-width: 0;
717
}
818

919
.collapse:not(.width):not(.show) {

app/javascript/components/workflows/student/exams/show/components/navbar/index.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,7 @@ const ExamNavbar: React.FC<{
116116
const additionalClass = expanded ? 'sidebar-expanded' : 'sidebar-small';
117117
return (
118118
<div
119-
id="sidebar"
120119
className={`
121-
transition
122120
bg-dark
123121
text-white
124122
float-left
@@ -140,7 +138,7 @@ const ExamNavbar: React.FC<{
140138
Hourglass
141139
</h1>
142140
</Collapse>
143-
<h1 aria-hidden="true" className="width-0">&nbsp;</h1>
141+
<h1 aria-hidden="true" className="mw-0">&nbsp;</h1>
144142
<Button
145143
className="ml-2"
146144
onClick={(): void => {

0 commit comments

Comments
 (0)