auto close sideMenu on mobile and removed close button on sider
parent
e3f78ce092
commit
730eee9751
|
@ -322,12 +322,20 @@ export default function SideMenu({
|
||||||
topic: pathname,
|
topic: pathname,
|
||||||
browserTabSession: BrowserTabSession,
|
browserTabSession: BrowserTabSession,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// auto close sideMenu on mobile
|
||||||
|
if (
|
||||||
|
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
|
||||||
|
navigator.userAgent
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
setIsSideMenuCollapsed(true);
|
||||||
|
}
|
||||||
}, [location.pathname]);
|
}, [location.pathname]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Sider
|
<Sider
|
||||||
theme="light"
|
theme="light"
|
||||||
//style={{ overflow: "auto", position: "fixed", height: "100vh" }}
|
|
||||||
style={{
|
style={{
|
||||||
overflow: "auto",
|
overflow: "auto",
|
||||||
height: "100vh",
|
height: "100vh",
|
||||||
|
@ -337,7 +345,7 @@ export default function SideMenu({
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
}}
|
}}
|
||||||
breakpoint="lg"
|
breakpoint="lg"
|
||||||
collapsedWidth="0"
|
collapsedWidth={1}
|
||||||
collapsed={isSideMenuCollapsed}
|
collapsed={isSideMenuCollapsed}
|
||||||
onCollapse={(collapsed) => setIsSideMenuCollapsed(collapsed)}
|
onCollapse={(collapsed) => setIsSideMenuCollapsed(collapsed)}
|
||||||
>
|
>
|
||||||
|
|
|
@ -27,13 +27,7 @@ import {
|
||||||
} from "../../utils";
|
} from "../../utils";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import {
|
import { FileTextOutlined, KeyOutlined } from "@ant-design/icons";
|
||||||
CopyOutlined,
|
|
||||||
EyeInvisibleOutlined,
|
|
||||||
EyeOutlined,
|
|
||||||
FileTextOutlined,
|
|
||||||
KeyOutlined,
|
|
||||||
} from "@ant-design/icons";
|
|
||||||
import { MyUserAvatar } from "../../Components/MyAvatar";
|
import { MyUserAvatar } from "../../Components/MyAvatar";
|
||||||
import { useUserProfileContext } from "../../Contexts/UserProfileContext";
|
import { useUserProfileContext } from "../../Contexts/UserProfileContext";
|
||||||
import { useWebSocketContext } from "../../Contexts/WebSocketContext";
|
import { useWebSocketContext } from "../../Contexts/WebSocketContext";
|
||||||
|
|
Loading…
Reference in New Issue