Skip to content

Commit a17f10d

Browse files
committed
let user resize sidebar
1 parent 4bac67d commit a17f10d

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
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: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,22 @@
1010
cursor: pointer;
1111
}
1212

13-
.transition {
14-
transition: 0.35s width ease-in-out;
15-
}
16-
1713
.sidebar-small {
18-
width: var(--sidebar-small);
14+
transition: 0.35s max-width ease-in-out, 0.35s min-width ease-in-out;
15+
min-width: var(--sidebar-small);
16+
max-width: var(--sidebar-small);
1917
}
2018

2119
.sidebar-expanded {
22-
width: var(--sidebar-expanded);
20+
transition: 0.35s max-width ease-in-out, 0.35s min-width ease-in-out;
21+
min-width: var(--sidebar-expanded);
22+
max-width: 50%;
23+
resize: horizontal;
24+
overflow: auto;
2325
}
2426

25-
.width-0 {
26-
width: 0;
27+
.mw-0 {
28+
max-width: 0;
2729
}
2830

2931
.collapse:not(.width):not(.show) {
@@ -34,7 +36,7 @@
3436
position: relative;
3537
height: 0;
3638
overflow: hidden;
37-
transition: height 0.35s ease-in-out;
39+
transition: height 0.35s ease-in-out;
3840
}
3941

4042
@media (prefers-reduced-motion: reduce) {

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
@@ -87,9 +87,7 @@ const ExamNavbar: React.FC<{
8787
const additionalClass = expanded ? 'sidebar-expanded' : 'sidebar-small';
8888
return (
8989
<div
90-
id="sidebar"
9190
className={`
92-
transition
9391
bg-dark
9492
text-white
9593
float-left
@@ -111,7 +109,7 @@ const ExamNavbar: React.FC<{
111109
Hourglass
112110
</h1>
113111
</Collapse>
114-
<h1 aria-hidden="true" className="width-0">&nbsp;</h1>
112+
<h1 aria-hidden="true" className="mw-0">&nbsp;</h1>
115113
<Button
116114
className="ml-2"
117115
onClick={(): void => {

0 commit comments

Comments
 (0)