diff --git a/packages/napcat-webui-frontend/src/components/sidebar/index.tsx b/packages/napcat-webui-frontend/src/components/sidebar/index.tsx index daa46449..57687482 100644 --- a/packages/napcat-webui-frontend/src/components/sidebar/index.tsx +++ b/packages/napcat-webui-frontend/src/components/sidebar/index.tsx @@ -1,7 +1,7 @@ import { Button } from '@heroui/button'; import { Image } from '@heroui/image'; import clsx from 'clsx'; -import { motion } from 'motion/react'; +import { AnimatePresence, motion } from 'motion/react'; import React from 'react'; import { IoMdLogOut } from 'react-icons/io'; import { MdDarkMode, MdLightMode } from 'react-icons/md'; @@ -18,10 +18,11 @@ import Menus from './menus'; interface SideBarProps { open: boolean items: MenuItem[] + onClose?: () => void } const SideBar: React.FC = (props) => { - const { open, items } = props; + const { open, items, onClose } = props; const { toggleTheme, isDark } = useTheme(); const { revokeAuth } = useAuth(); const dialog = useDialog(); @@ -33,60 +34,75 @@ const SideBar: React.FC = (props) => { }); }; return ( - - -
- -
- NapCat -
-
-
- -
- - + NapCat +
- +
+ +
+ + +
+
+
- + ); }; diff --git a/packages/napcat-webui-frontend/src/layouts/default.tsx b/packages/napcat-webui-frontend/src/layouts/default.tsx index 7bb0d385..ae7dee72 100644 --- a/packages/napcat-webui-frontend/src/layouts/default.tsx +++ b/packages/napcat-webui-frontend/src/layouts/default.tsx @@ -85,7 +85,11 @@ const Layout: React.FC<{ children: React.ReactNode; }> = ({ children }) => { backgroundSize: 'cover', }} > - + setOpenSideBar(false)} + />
= ({ children }) => { >