Skip to content

Commit 2b836e7

Browse files
committed
ui: fix hamburger menu going offscreen when the page is scrolled
1 parent 941c5a2 commit 2b836e7

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

app/src/components/layout/Layout.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ const Styled = {
1717
width: 100%;
1818
margin: 0 auto;
1919
`,
20-
Hamburger: styled.span`
20+
Hamburger: styled.span<CollapsedProps>`
2121
display: inline-block;
22-
position: absolute;
22+
position: ${props => (props.collapsed ? 'absolute' : 'fixed')};
2323
top: 35px;
24-
left: 10px;
24+
margin-left: 10px;
2525
z-index: 2;
2626
padding: 4px;
2727
@@ -72,7 +72,10 @@ const StandardLayout: React.FC = observer(({ children }) => {
7272
return (
7373
<Background>
7474
<Container>
75-
<Hamburger onClick={settingsStore.toggleSidebar}>
75+
<Hamburger
76+
collapsed={!settingsStore.sidebarVisible}
77+
onClick={settingsStore.toggleSidebar}
78+
>
7679
<Menu size="large" />
7780
</Hamburger>
7881
<Aside collapsed={!settingsStore.sidebarVisible}>

0 commit comments

Comments
 (0)