auto close sideMenu on mobile and removed close button on sider

main
alex 2023-10-19 09:37:57 +02:00
parent e3f78ce092
commit 730eee9751
2 changed files with 11 additions and 9 deletions

View File

@ -322,12 +322,20 @@ export default function SideMenu({
topic: pathname,
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]);
return (
<Sider
theme="light"
//style={{ overflow: "auto", position: "fixed", height: "100vh" }}
style={{
overflow: "auto",
height: "100vh",
@ -337,7 +345,7 @@ export default function SideMenu({
bottom: 0,
}}
breakpoint="lg"
collapsedWidth="0"
collapsedWidth={1}
collapsed={isSideMenuCollapsed}
onCollapse={(collapsed) => setIsSideMenuCollapsed(collapsed)}
>

View File

@ -27,13 +27,7 @@ import {
} from "../../utils";
import { Link } from "react-router-dom";
import { useTranslation } from "react-i18next";
import {
CopyOutlined,
EyeInvisibleOutlined,
EyeOutlined,
FileTextOutlined,
KeyOutlined,
} from "@ant-design/icons";
import { FileTextOutlined, KeyOutlined } from "@ant-design/icons";
import { MyUserAvatar } from "../../Components/MyAvatar";
import { useUserProfileContext } from "../../Contexts/UserProfileContext";
import { useWebSocketContext } from "../../Contexts/WebSocketContext";