From 34652010f5e80dbdca0658df479404fd1a8ec601 Mon Sep 17 00:00:00 2001 From: Joel Date: Tue, 29 Oct 2024 18:09:41 +0800 Subject: [PATCH] feat: add market url prefix --- web/.env.example | 4 +++- .../block-selector/market-place-plugin/list.tsx | 15 +++++++++++++++ web/app/layout.tsx | 3 ++- web/config/index.ts | 15 +++++++++++---- web/i18n/en-US/plugin.ts | 1 + 5 files changed, 32 insertions(+), 6 deletions(-) diff --git a/web/.env.example b/web/.env.example index 4316bc76ea..e0f6839b95 100644 --- a/web/.env.example +++ b/web/.env.example @@ -10,8 +10,10 @@ NEXT_PUBLIC_API_PREFIX=http://localhost:5001/console/api # console or api domain. # example: http://udify.app/api NEXT_PUBLIC_PUBLIC_API_PREFIX=http://localhost:5001/api -# The URL for MARKETPLACE +# The APIFREX for MARKETPLACE NEXT_PUBLIC_MARKETPLACE_API_PREFIX=http://localhost:5002/api +# The URL for MARKETPLACE +NEXT_PUBLIC_MARKETPLACE_URL_PREFIX= # SENTRY NEXT_PUBLIC_SENTRY_DSN= diff --git a/web/app/components/workflow/block-selector/market-place-plugin/list.tsx b/web/app/components/workflow/block-selector/market-place-plugin/list.tsx index 9861cf2a9e..9078d85216 100644 --- a/web/app/components/workflow/block-selector/market-place-plugin/list.tsx +++ b/web/app/components/workflow/block-selector/market-place-plugin/list.tsx @@ -5,15 +5,20 @@ import useStickyScroll, { ScrollPosition } from '../use-sticky-scroll' import Item from './item' import type { Plugin } from '@/app/components/plugins/types.ts' import cn from '@/utils/classnames' +import Link from 'next/link' +import { marketplaceUrlPrefix } from '@/config' +import { RiArrowRightUpLine } from '@remixicon/react' // import { RiArrowRightUpLine } from '@remixicon/react' type Props = { wrapElemRef: React.RefObject + hasSearchText: boolean list: Plugin[] } const List = ({ wrapElemRef, + hasSearchText, list, }: Props, ref: any) => { const { t } = useTranslation() @@ -46,6 +51,16 @@ const List = ({ nextToStickyELemRef.current?.scrollIntoView({ behavior: 'smooth', block: 'start' }) } + if (!hasSearchText) { + return ( + + {t('plugin.findMoreInMarketplace')} + + + ) + } + return ( <>