From 4346f61b0cfaf9eee69e8c6f819ecf3f676717f6 Mon Sep 17 00:00:00 2001 From: Joel Date: Fri, 30 Jan 2026 18:10:25 +0800 Subject: [PATCH] chore: hide disable try tab when not support (#31759) --- web/app/components/explore/try-app/tab.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/web/app/components/explore/try-app/tab.tsx b/web/app/components/explore/try-app/tab.tsx index cbd8e1db85..55d0900fad 100644 --- a/web/app/components/explore/try-app/tab.tsx +++ b/web/app/components/explore/try-app/tab.tsx @@ -2,6 +2,7 @@ import type { FC } from 'react' import * as React from 'react' import { useTranslation } from 'react-i18next' +import { IS_CLOUD_EDITION } from '@/config' import TabHeader from '../../base/tab-header' export enum TypeEnum { @@ -21,10 +22,13 @@ const Tab: FC = ({ disableTry, }) => { const { t } = useTranslation() - const tabs = [ - { id: TypeEnum.TRY, name: t('tryApp.tabHeader.try', { ns: 'explore' }), disabled: disableTry }, - { id: TypeEnum.DETAIL, name: t('tryApp.tabHeader.detail', { ns: 'explore' }) }, - ] + + const tabs = React.useMemo(() => { + return [ + IS_CLOUD_EDITION ? { id: TypeEnum.TRY, name: t('tryApp.tabHeader.try', { ns: 'explore' }), disabled: disableTry } : null, + { id: TypeEnum.DETAIL, name: t('tryApp.tabHeader.detail', { ns: 'explore' }) }, + ].filter(item => item !== null) as { id: TypeEnum, name: string }[] + }, [t, disableTry]) return (