From 6ec0c8e2960165ee63fd0f32cb4b69c8c738ec09 Mon Sep 17 00:00:00 2001 From: Innei Date: Sat, 8 Apr 2023 21:07:55 +0800 Subject: [PATCH] fix: should close after click Signed-off-by: Innei --- src/components/dashboard/PagesManager.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/dashboard/PagesManager.tsx b/src/components/dashboard/PagesManager.tsx index bfc890dc..3d84a10f 100644 --- a/src/components/dashboard/PagesManager.tsx +++ b/src/components/dashboard/PagesManager.tsx @@ -252,7 +252,7 @@ export const PagesManager: React.FC<{
- {({ open }: { open: boolean }) => ( + {({ open, close }) => ( <> @@ -454,7 +458,8 @@ const usePageMenuItems = ({ const MenuItems: FC<{ isPost: boolean page: Note -}> = ({ isPost, page }) => { + onClick: () => void +}> = ({ isPost, page, onClick: onClose }) => { const { t } = useTranslation(["dashboard", "site"]) return ( @@ -468,6 +473,7 @@ const MenuItems: FC<{ onClick={(e) => { e.preventDefault() item.onClick() + onClose() }} > {item.icon}