mirror of
https://github.com/outline/outline.git
synced 2026-11-25 15:15:15 +03:00
fix: Mobile sidebar functionality
This commit is contained in:
1 parent
8cb4a06595
commit
0bb9fb8fff
2 files changed
+15
-19
No files matched your search
@@ -1,5 +1,5 @@
|
||||
// @flow
|
||||
import { inject } from "mobx-react";
|
||||
import { observer, inject } from "mobx-react";
|
||||
import { CloseIcon, MenuIcon } from "outline-icons";
|
||||
import * as React from "react";
|
||||
import { withRouter } from "react-router-dom";
|
||||
@@ -28,10 +28,6 @@ function Sidebar({ location, children, ui }: Props) {
|
||||
}
|
||||
}, [ui, location]);
|
||||
|
||||
const toggleSidebar = React.useCallback(() => {
|
||||
ui.toggleMobileSidebar();
|
||||
}, []);
|
||||
|
||||
const content = (
|
||||
<Container
|
||||
editMode={ui.editMode}
|
||||
@@ -39,7 +35,7 @@ function Sidebar({ location, children, ui }: Props) {
|
||||
column
|
||||
>
|
||||
<Toggle
|
||||
onClick={toggleSidebar}
|
||||
onClick={ui.toggleMobileSidebar}
|
||||
mobileSidebarVisible={ui.mobileSidebarVisible}
|
||||
>
|
||||
{ui.mobileSidebarVisible ? (
|
||||
@@ -116,4 +112,4 @@ const Toggle = styled.a`
|
||||
`};
|
||||
`;
|
||||
|
||||
export default withRouter(inject("ui")(Sidebar));
|
||||
export default withRouter(inject("ui")(observer(Sidebar)));
|
||||
+12
-12
@@ -109,34 +109,34 @@ class UiStore {
|
||||
};
|
||||
|
||||
@action
|
||||
enableEditMode() {
|
||||
enableEditMode = () => {
|
||||
this.editMode = true;
|
||||
}
|
||||
};
|
||||
|
||||
@action
|
||||
disableEditMode() {
|
||||
disableEditMode = () => {
|
||||
this.editMode = false;
|
||||
}
|
||||
};
|
||||
|
||||
@action
|
||||
enableProgressBar() {
|
||||
enableProgressBar = () => {
|
||||
this.progressBarVisible = true;
|
||||
}
|
||||
};
|
||||
|
||||
@action
|
||||
disableProgressBar() {
|
||||
disableProgressBar = () => {
|
||||
this.progressBarVisible = false;
|
||||
}
|
||||
};
|
||||
|
||||
@action
|
||||
toggleMobileSidebar() {
|
||||
toggleMobileSidebar = () => {
|
||||
this.mobileSidebarVisible = !this.mobileSidebarVisible;
|
||||
}
|
||||
};
|
||||
|
||||
@action
|
||||
hideMobileSidebar() {
|
||||
hideMobileSidebar = () => {
|
||||
this.mobileSidebarVisible = false;
|
||||
}
|
||||
};
|
||||
|
||||
@action
|
||||
showToast = (
|
||||
|
||||
Reference in new issue
Block a user