From e797e97b18f2f93782ddad965b4f419079f6a037 Mon Sep 17 00:00:00 2001 From: Joel Date: Thu, 23 Jan 2025 14:01:14 +0800 Subject: [PATCH] chore: some menu --- web/app/account/avatar.tsx | 18 +++---- .../app/annotation/header-opts/index.tsx | 10 ++-- web/app/components/base/modal/index.tsx | 50 +++++++++++++++---- 3 files changed, 53 insertions(+), 25 deletions(-) diff --git a/web/app/account/avatar.tsx b/web/app/account/avatar.tsx index 8fdecc07bf..31434e6976 100644 --- a/web/app/account/avatar.tsx +++ b/web/app/account/avatar.tsx @@ -2,7 +2,7 @@ import { useTranslation } from 'react-i18next' import { Fragment } from 'react' import { useRouter } from 'next/navigation' -import { Menu, Transition } from '@headlessui/react' +import { Menu, MenuButton, MenuItem, MenuItems, Transition } from '@headlessui/react' import Avatar from '@/app/components/base/avatar' import { logout } from '@/service/common' import { useAppContext } from '@/context/app-context' @@ -36,7 +36,7 @@ export default function AppSelector() { ({ open }) => ( <>
- - +
- - +
@@ -74,8 +74,8 @@ export default function AppSelector() {
- - + +
handleLogout()}>
{t('common.userProfile.logout')}
-
-
+ +
) diff --git a/web/app/components/app/annotation/header-opts/index.tsx b/web/app/components/app/annotation/header-opts/index.tsx index 649d6501c3..d57bc74e7d 100644 --- a/web/app/components/app/annotation/header-opts/index.tsx +++ b/web/app/components/app/annotation/header-opts/index.tsx @@ -10,7 +10,7 @@ import { useContext } from 'use-context-selector' import { useCSVDownloader, } from 'react-papaparse' -import { Menu, Transition } from '@headlessui/react' +import { Menu, MenuButton, MenuItems, Transition } from '@headlessui/react' import Button from '../../../base/button' import AddAnnotationModal from '../add-annotation-modal' import type { AnnotationItemBasic } from '../type' @@ -87,11 +87,11 @@ const HeaderOptions: FC = ({ {t('appAnnotation.table.header.bulkImport')} - + {t('appAnnotation.table.header.bulkExport')} - + = ({ leaveFrom="transform opacity-100 scale-100" leaveTo="transform opacity-0 scale-95" > - = ({ - + diff --git a/web/app/components/base/modal/index.tsx b/web/app/components/base/modal/index.tsx index 26cde5fce3..74e4e2f25e 100644 --- a/web/app/components/base/modal/index.tsx +++ b/web/app/components/base/modal/index.tsx @@ -1,4 +1,4 @@ -import { Dialog, Transition } from '@headlessui/react' +import { Dialog, DialogPanel, DialogTitle, Transition } from '@headlessui/react' import { Fragment } from 'react' import { RiCloseLine } from '@remixicon/react' import classNames from '@/utils/classnames' @@ -30,7 +30,7 @@ export default function Modal({ return ( -
- + */} + {/* TODO: to new Transition */} +
- - - {title && {title} - } - {description && + } + {description &&
{description} - } +
} {closable &&
} {children} -
-
+ + */} + {/* TODO: to new Transition */} + + {title && + {title} + } + {description &&
+ {description} +
} + {closable + &&
+ { + e.stopPropagation() + onClose() + } + } /> +
} + {children} +