diff --git a/web/app/components/header/account-setting/index.tsx b/web/app/components/header/account-setting/index.tsx index d53e5e6479..4fd80541e9 100644 --- a/web/app/components/header/account-setting/index.tsx +++ b/web/app/components/header/account-setting/index.tsx @@ -144,7 +144,7 @@ export default function AccountSetting({
-
+
{[...menuItems[0].items, ...menuItems[1].items].find(item => item.key === activeMenu)?.name}
diff --git a/web/app/components/header/account-setting/members-page/operation/index.tsx b/web/app/components/header/account-setting/members-page/operation/index.tsx index f97dcc7397..7c11ad6e54 100644 --- a/web/app/components/header/account-setting/members-page/operation/index.tsx +++ b/web/app/components/header/account-setting/members-page/operation/index.tsx @@ -3,12 +3,12 @@ import { useTranslation } from 'react-i18next' import { Fragment } from 'react' import { useContext } from 'use-context-selector' import { Menu, Transition } from '@headlessui/react' +import cn from 'classnames' +import { CheckIcon, ChevronDownIcon } from '@heroicons/react/24/outline' +import s from './index.module.css' import type { Member } from '@/models/common' import { deleteMemberOrCancelInvitation, updateMemberRole } from '@/service/common' import { ToastContext } from '@/app/components/base/toast' -import s from './index.module.css' -import cn from 'classnames' -import { ChevronDownIcon, CheckIcon } from '@heroicons/react/24/outline' const itemClassName = ` flex px-3 py-2 cursor-pointer hover:bg-gray-50 rounded-lg @@ -23,14 +23,14 @@ const itemDescClassName = ` leading-[18px] text-xs text-gray-500 whitespace-nowrap ` -interface IOperationProps { +type IOperationProps = { member: Member onOperate: () => void } const Operation = ({ member, - onOperate + onOperate, }: IOperationProps) => { const { t } = useTranslation() const RoleMap = { @@ -44,92 +44,94 @@ const Operation = ({ await deleteMemberOrCancelInvitation({ url: `/workspaces/current/members/${member.id}` }) onOperate() notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') }) - } catch (e) { - + } + catch (e) { + } } const handleUpdateMemberRole = async (role: string) => { try { - await updateMemberRole({ + await updateMemberRole({ url: `/workspaces/current/members/${member.id}/update-role`, - body: { role } + body: { role }, }) onOperate() notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') }) - } catch (e) { - + } + catch (e) { + } } return ( - - { - ({ open }) => ( - <> - + { + ({ open }) => ( + <> + - {RoleMap[member.role] || RoleMap.normal} - - - - + {RoleMap[member.role] || RoleMap.normal} + + + + -
- { - ['admin', 'normal'].map(role => ( - -
handleUpdateMemberRole(role)}> - { - role === member.role - ? - :
- } -
-
{t(`common.members.${role}`)}
-
{t(`common.members.${role}Tip`)}
-
+ s.popup, + )} + > +
+ { + ['admin', 'normal'].map(role => ( + +
handleUpdateMemberRole(role)}> + { + role === member.role + ? + :
+ } +
+
{t(`common.members.${role}`)}
+
{t(`common.members.${role}Tip`)}
- - )) - } -
- -
-
-
-
-
{t('common.members.removeFromTeam')}
-
{t('common.members.removeFromTeamTip')}
+ + )) + } +
+ +
+
+
+
+
{t('common.members.removeFromTeam')}
+
{t('common.members.removeFromTeamTip')}
- - - - - ) - } -
+
+ + + + + ) + } + ) }