diff --git a/web/app/components/base/premium-badge/index.tsx b/web/app/components/base/premium-badge/index.tsx index 1af527cd16..ce260fcf80 100644 --- a/web/app/components/base/premium-badge/index.tsx +++ b/web/app/components/base/premium-badge/index.tsx @@ -53,7 +53,7 @@ const PremiumBadge: React.FC = ({
v const UpgradeBtn: FC = ({ className, isPlain = false, - isFull = false, isShort = false, - size = 'md', onClick: _onClick, loc, }) => { @@ -63,22 +60,19 @@ const UpgradeBtn: FC = ({ return return ( -
- -
{t(`billing.upgradeBtn.${isShort ? 'encourageShort' : 'encourage'}`)}
- -
+ +
+ + {t(`billing.upgradeBtn.${isShort ? 'encourageShort' : 'encourage'}`)} + +
+ ) } export default React.memo(UpgradeBtn) diff --git a/web/app/components/header/account-setting/index.tsx b/web/app/components/header/account-setting/index.tsx index 9df7065733..b8d265c263 100644 --- a/web/app/components/header/account-setting/index.tsx +++ b/web/app/components/header/account-setting/index.tsx @@ -4,6 +4,7 @@ import { useEffect, useRef, useState } from 'react' import { RiBrain2Fill, RiBrain2Line, + RiCloseLine, RiColorFilterFill, RiColorFilterLine, RiDatabase2Fill, @@ -16,6 +17,7 @@ import { RiPuzzle2Line, RiTranslate2, } from '@remixicon/react' +import Button from '../../base/button' import MembersPage from './members-page' import LanguagePage from './language-page' import ApiBasedExtensionPage from './api-based-extension-page' @@ -178,34 +180,47 @@ export default function AccountSetting({ }
-
-
-
{activeItem?.name}
- { - activeItem?.description && ( -
{activeItem?.description}
- ) - } - {activeItem?.key === 'provider' && ( -
- setSearchValue(e.target.value)} - value={searchValue} - /> -
- )} +
+
+ +
ESC
-
- {activeMenu === 'provider' && } - {activeMenu === 'members' && } - {activeMenu === 'billing' && } - {activeMenu === 'data-source' && } - {activeMenu === 'api-based-extension' && } - {activeMenu === 'custom' && } - {activeMenu === 'language' && } +
+
+
{activeItem?.name}
+ { + activeItem?.description && ( +
{activeItem?.description}
+ ) + } + {activeItem?.key === 'provider' && ( +
+ setSearchValue(e.target.value)} + value={searchValue} + /> +
+ )} +
+
+ {activeMenu === 'provider' && } + {activeMenu === 'members' && } + {activeMenu === 'billing' && } + {activeMenu === 'data-source' && } + {activeMenu === 'api-based-extension' && } + {activeMenu === 'custom' && } + {activeMenu === 'language' && } +
diff --git a/web/app/components/header/account-setting/menu-dialog.tsx b/web/app/components/header/account-setting/menu-dialog.tsx index 19639488da..3db8475c51 100644 --- a/web/app/components/header/account-setting/menu-dialog.tsx +++ b/web/app/components/header/account-setting/menu-dialog.tsx @@ -1,8 +1,6 @@ import { Fragment, useCallback, useEffect } from 'react' import type { ReactNode } from 'react' -import { RiCloseLine } from '@remixicon/react' import { Dialog, Transition } from '@headlessui/react' -import Button from '@/app/components/base/button' import cn from '@/utils/classnames' type DialogProps = { @@ -47,18 +45,6 @@ const MenuDialog = ({ leaveTo="opacity-0 scale-95" > -
-
- -
ESC
-
{children} diff --git a/web/app/components/header/index.tsx b/web/app/components/header/index.tsx index c6befcc0d9..425834d7b9 100644 --- a/web/app/components/header/index.tsx +++ b/web/app/components/header/index.tsx @@ -21,6 +21,7 @@ import WorkplaceSelector from '@/app/components/header/account-dropdown/workplac import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints' import { useProviderContext } from '@/context/provider-context' import { useModalContext } from '@/context/modal-context' +import { useTranslation } from 'react-i18next' const navClassName = ` flex items-center relative mr-0 sm:mr-3 px-3 h-8 rounded-xl @@ -30,6 +31,7 @@ const navClassName = ` const Header = () => { const { isCurrentWorkspaceEditor, isCurrentWorkspaceDatasetOperator } = useAppContext() + const { t } = useTranslation() const selectedSegment = useSelectedLayoutSegment() const media = useBreakpoints() @@ -74,7 +76,7 @@ const Header = () => {
- Upgrade + {t('billing.upgradeBtn.encourage')}
@@ -96,7 +98,7 @@ const Header = () => {
- Upgrade + {t('billing.upgradeBtn.encourage')}