diff --git a/web/app/components/base/tab-header/index.tsx b/web/app/components/base/tab-header/index.tsx index 846277e5db..c208612d30 100644 --- a/web/app/components/base/tab-header/index.tsx +++ b/web/app/components/base/tab-header/index.tsx @@ -16,6 +16,8 @@ export type ITabHeaderProps = { items: Item[] value: string itemClassName?: string + itemWrapClassName?: string + activeItemClassName?: string onChange: (value: string) => void } @@ -23,6 +25,8 @@ const TabHeader: FC = ({ items, value, itemClassName, + itemWrapClassName, + activeItemClassName, onChange, }) => { const renderItem = ({ id, name, icon, extra, disabled }: Item) => ( @@ -30,8 +34,9 @@ const TabHeader: FC = ({ key={id} className={cn( 'system-md-semibold relative flex cursor-pointer items-center border-b-2 border-transparent pb-2 pt-2.5', - id === value ? 'border-components-tab-active text-text-primary' : 'text-text-tertiary', + id === value ? cn('border-components-tab-active text-text-primary', activeItemClassName) : 'text-text-tertiary', disabled && 'cursor-not-allowed opacity-30', + itemWrapClassName, )} onClick={() => !disabled && onChange(id)} > diff --git a/web/app/components/explore/try-app/index.tsx b/web/app/components/explore/try-app/index.tsx index 80b6f52568..42d33f77ee 100644 --- a/web/app/components/explore/try-app/index.tsx +++ b/web/app/components/explore/try-app/index.tsx @@ -3,6 +3,8 @@ import type { FC } from 'react' import React, { useState } from 'react' import Modal from '@/app/components/base/modal/index' import Tab, { TypeEnum } from './tab' +import Button from '../../base/button' +import { RiCloseLine } from '@remixicon/react' type Props = { appId: string @@ -19,12 +21,23 @@ const TryApp: FC = ({ - +
+ + +
+ {appId}
) diff --git a/web/app/components/explore/try-app/tab.tsx b/web/app/components/explore/try-app/tab.tsx index bba049dd84..030edec7bd 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 React from 'react' import TabHeader from '../../base/tab-header' +import { useTranslation } from 'react-i18next' export enum TypeEnum { TRY = 'try', @@ -17,18 +18,20 @@ const Tab: FC = ({ value, onChange, }) => { + const { t } = useTranslation() const tabs = [ - { id: TypeEnum.TRY, name: 'Try App' }, - { id: TypeEnum.DETAIL, name: 'App Details' }, + { id: TypeEnum.TRY, name: t('explore.tryApp.tabHeader.try') }, + { id: TypeEnum.DETAIL, name: t('explore.tryApp.tabHeader.detail') }, ] return ( -
- void} - /> -
+ void} + itemClassName='ml-0 system-md-semibold-uppercase' + itemWrapClassName='pt-2' + activeItemClassName='border-util-colors-blue-brand-blue-brand-500' + /> ) } export default React.memo(Tab) diff --git a/web/i18n/en-US/explore.ts b/web/i18n/en-US/explore.ts index bd016f9da9..7b9bdd5de5 100644 --- a/web/i18n/en-US/explore.ts +++ b/web/i18n/en-US/explore.ts @@ -30,6 +30,12 @@ const translation = { addToWorkspace: 'Use template', try: 'Details', }, + tryApp: { + tabHeader: { + try: 'Try it', + detail: 'Orchestration Details', + }, + }, appCustomize: { title: 'Create app from {{name}}', subTitle: 'App icon & name', diff --git a/web/i18n/zh-Hans/explore.ts b/web/i18n/zh-Hans/explore.ts index 3688c75063..c2f32b57b1 100644 --- a/web/i18n/zh-Hans/explore.ts +++ b/web/i18n/zh-Hans/explore.ts @@ -31,6 +31,12 @@ const translation = { try: '详情', customize: '自定义', }, + tryApp: { + tabHeader: { + try: '试用', + detail: '编排详情', + }, + }, appCustomize: { title: '从 {{name}} 创建应用程序', subTitle: '应用程序图标和名称',