diff --git a/web/app/(commonLayout)/plugins/Container.tsx b/web/app/(commonLayout)/plugins/Container.tsx index fde3f0335c..5fee5354a2 100644 --- a/web/app/(commonLayout)/plugins/Container.tsx +++ b/web/app/(commonLayout)/plugins/Container.tsx @@ -35,8 +35,11 @@ const Container = () => { const containerRef = useRef(null) return ( -
+
@@ -96,12 +99,15 @@ const Container = () => {
-
+
- {/* Content for active tab will go here */} + {/* Filter goes here */}
+
+ {/* Plugin cards go here */} +
Drop plugin package here to install diff --git a/web/app/components/base/logo/logo-site.tsx b/web/app/components/base/logo/logo-site.tsx index a399ff3301..4b0e026afd 100644 --- a/web/app/components/base/logo/logo-site.tsx +++ b/web/app/components/base/logo/logo-site.tsx @@ -1,7 +1,6 @@ 'use client' import type { FC } from 'react' import classNames from '@/utils/classnames' -import { useSelector } from '@/context/app-context' type LogoSiteProps = { className?: string @@ -10,17 +9,10 @@ type LogoSiteProps = { const LogoSite: FC = ({ className, }) => { - const { theme } = useSelector((s) => { - return { - theme: s.theme, - } - }) - - const src = theme === 'light' ? '/logo/logo-site.png' : `/logo/logo-site-${theme}.png` return ( logo ) diff --git a/web/app/components/billing/header-billing-btn/index.tsx b/web/app/components/billing/header-billing-btn/index.tsx index a8415524fd..a5bc310d9b 100644 --- a/web/app/components/billing/header-billing-btn/index.tsx +++ b/web/app/components/billing/header-billing-btn/index.tsx @@ -7,11 +7,13 @@ import cn from '@/utils/classnames' import { useProviderContext } from '@/context/provider-context' type Props = { - onClick: () => void + onClick?: () => void + isDisplayOnly?: boolean } const HeaderBillingBtn: FC = ({ onClick, + isDisplayOnly = false, }) => { const { plan, enableBilling, isFetchedPlan } = useProviderContext() const { @@ -25,9 +27,9 @@ const HeaderBillingBtn: FC = ({ })() const classNames = (() => { if (type === Plan.professional) - return 'border-[#E0F2FE] hover:border-[#B9E6FE] bg-[#E0F2FE] text-[#026AA2]' + return `border-[#E0F2FE] ${!isDisplayOnly ? 'hover:border-[#B9E6FE]' : ''} bg-[#E0F2FE] text-[#026AA2]` if (type === Plan.team) - return 'border-[#E0EAFF] hover:border-[#C7D7FE] bg-[#E0EAFF] text-[#3538CD]' + return `border-[#E0EAFF] ${!isDisplayOnly ? 'hover:border-[#C7D7FE]' : ''} bg-[#E0EAFF] text-[#3538CD]` return '' })() @@ -35,10 +37,22 @@ const HeaderBillingBtn: FC = ({ return null if (type === Plan.sandbox) - return + return + + const handleClick = () => { + if (!isDisplayOnly && onClick) + onClick() + } return ( -
+
{name}
) diff --git a/web/app/components/header/account-dropdown/index.tsx b/web/app/components/header/account-dropdown/index.tsx index 03157ed7cb..4c42374ffd 100644 --- a/web/app/components/header/account-dropdown/index.tsx +++ b/web/app/components/header/account-dropdown/index.tsx @@ -9,7 +9,6 @@ import { Menu, Transition } from '@headlessui/react' import Indicator from '../indicator' import AccountAbout from '../account-about' import { mailToSupport } from '../utils/util' -import WorkplaceSelector from './workplace-selector' import classNames from '@/utils/classnames' import I18n from '@/context/i18n' import Avatar from '@/app/components/base/avatar' @@ -101,10 +100,6 @@ export default function AppSelector({ isMobile }: IAppSelector) {
-
-
{t('common.userProfile.workspace')}
- -
setShowAccountSettingModal({ payload: 'account' })}> diff --git a/web/app/components/header/account-dropdown/workplace-selector/index.tsx b/web/app/components/header/account-dropdown/workplace-selector/index.tsx index 801f0b3d52..b32cb13227 100644 --- a/web/app/components/header/account-dropdown/workplace-selector/index.tsx +++ b/web/app/components/header/account-dropdown/workplace-selector/index.tsx @@ -2,33 +2,20 @@ import { Fragment } from 'react' import { useContext } from 'use-context-selector' import { useTranslation } from 'react-i18next' import { Menu, Transition } from '@headlessui/react' -import s from './index.module.css' +import { RiArrowDownSLine } from '@remixicon/react' import cn from '@/utils/classnames' import { switchWorkspace } from '@/service/common' import { useWorkspacesContext } from '@/context/workspace-context' -import { ChevronRight } from '@/app/components/base/icons/src/vender/line/arrows' -import { Check } from '@/app/components/base/icons/src/vender/line/general' +import HeaderBillingBtn from '@/app/components/billing/header-billing-btn' +import { useProviderContext } from '@/context/provider-context' import { ToastContext } from '@/app/components/base/toast' -const itemClassName = ` - flex items-center px-3 py-2 h-10 cursor-pointer -` -const itemIconClassName = ` - shrink-0 mr-2 flex items-center justify-center w-6 h-6 bg-[#EFF4FF] rounded-md text-xs font-medium text-primary-600 -` -const itemNameClassName = ` - grow mr-2 text-sm text-gray-700 text-left -` -const itemCheckClassName = ` - shrink-0 w-4 h-4 text-primary-600 -` - const WorkplaceSelector = () => { const { t } = useTranslation() const { notify } = useContext(ToastContext) const { workspaces } = useWorkspacesContext() + const { enableBilling } = useProviderContext() const currentWorkspace = workspaces.find(v => v.current) - const handleSwitchWorkspace = async (tenant_id: string) => { try { if (currentWorkspace?.id === tenant_id) @@ -49,13 +36,13 @@ const WorkplaceSelector = () => { <> -
{currentWorkspace?.name[0].toLocaleUpperCase()}
-
{currentWorkspace?.name}
- +
{currentWorkspace?.name[0].toLocaleUpperCase()}
+
{currentWorkspace?.name}
+
{ -
+
+
+ {t('common.userProfile.workspace')} +
{ workspaces.map(workspace => ( -
handleSwitchWorkspace(workspace.id)}> -
{workspace.name[0].toLocaleUpperCase()}
-
{workspace.name}
- {workspace.current && } +
handleSwitchWorkspace(workspace.id)}> +
{workspace.name[0].toLocaleUpperCase()}
+
{workspace.name}
+ {enableBilling && ( +
+ +
+ )}
)) } diff --git a/web/app/components/header/index.tsx b/web/app/components/header/index.tsx index 035cc6fd1e..8f41dee938 100644 --- a/web/app/components/header/index.tsx +++ b/web/app/components/header/index.tsx @@ -16,6 +16,7 @@ import GithubStar from './github-star' import { WorkspaceProvider } from '@/context/workspace-context' import { useAppContext } from '@/context/app-context' import LogoSite from '@/app/components/base/logo/logo-site' +import WorkplaceSelector from '@/app/components/header/account-dropdown/workplace-selector' import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints' import { useProviderContext } from '@/context/provider-context' import { useModalContext } from '@/context/modal-context' @@ -48,7 +49,7 @@ const Header = () => { // eslint-disable-next-line react-hooks/exhaustive-deps }, [selectedSegment]) return ( -
+
{isMobile &&
{ >
} - {!isMobile && <> - + {!isMobile + &&
+ - {enableBilling && ( -
- -
- )} - - } +
/
+
+ + + + {enableBilling && ( +
+ +
+ )} +
+
+ }
{isMobile && (
+
/
{enableBilling && (
@@ -94,9 +103,7 @@ const Header = () => {
- - - +
{(isMobile && isShowNavMenu) && (
diff --git a/web/app/components/header/nav/index.tsx b/web/app/components/header/nav/index.tsx index bfb4324320..de98593ddd 100644 --- a/web/app/components/header/nav/index.tsx +++ b/web/app/components/header/nav/index.tsx @@ -68,7 +68,7 @@ const Nav = ({ { curNav && isActivated && ( <> -
/
+
/