diff --git a/web/app/components/tools/marketplace.tsx b/web/app/components/tools/marketplace.tsx new file mode 100644 index 0000000000..d38b165615 --- /dev/null +++ b/web/app/components/tools/marketplace.tsx @@ -0,0 +1,262 @@ +import { RiArrowUpDoubleLine } from '@remixicon/react' +import Card from '@/app/components/plugins/card' +import CardMoreInfo from '@/app/components/plugins/card/card-more-info' +import { toolNotion } from '@/app/components/plugins/card/card-mock' +import { useGetLanguage } from '@/context/i18n' + +type MarketplaceProps = { + onMarketplaceScroll: () => void +} +const Marketplace = ({ + onMarketplaceScroll, +}: MarketplaceProps) => { + const locale = useGetLanguage() + + return ( +
+ onMarketplaceScroll()} + /> +
+
More from Marketplace
+
+ Discover + + models + + , + + tools + + , + + extensions + + and + + bundles + + in Dify Marketplace +
+
+
+
Featured
+
Our top picks to get you started
+
+ + } + /> + + } + /> + + } + /> + + } + /> + + } + /> +
+
+
+
Popular
+
Explore the library and discover the incredible work of our community
+
+ + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> +
+
+
+ ) +} + +export default Marketplace diff --git a/web/app/components/tools/provider-list.tsx b/web/app/components/tools/provider-list.tsx index 6598bb6d08..8b44ecd296 100644 --- a/web/app/components/tools/provider-list.tsx +++ b/web/app/components/tools/provider-list.tsx @@ -1,8 +1,9 @@ 'use client' -import { useEffect, useMemo, useState } from 'react' +import { useEffect, useMemo, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' import { RiCloseLine } from '@remixicon/react' import type { Collection } from './types' +import Marketplace from './marketplace' import cn from '@/utils/classnames' import { useTabSearchParams } from '@/hooks/use-tab-searchparams' import TabSliderNew from '@/app/components/base/tab-slider-new' @@ -12,16 +13,17 @@ import { DotsGrid } from '@/app/components/base/icons/src/vender/line/general' import { Colors } from '@/app/components/base/icons/src/vender/line/others' import { Route } from '@/app/components/base/icons/src/vender/line/mapsAndTravel' import CustomCreateCard from '@/app/components/tools/provider/custom-create-card' -import ContributeCard from '@/app/components/tools/provider/contribute' import ProviderDetail from '@/app/components/tools/provider/detail' import Empty from '@/app/components/tools/add-tool-modal/empty' import { fetchCollectionList } from '@/service/tools' import Card from '@/app/components/plugins/card' import { useGetLanguage } from '@/context/i18n' +import CardMoreInfo from '@/app/components/plugins/card/card-more-info' const ProviderList = () => { const { t } = useTranslation() const language = useGetLanguage() + const containerRef = useRef(null) const [activeTab, setActiveTab] = useTabSearchParams({ defaultTab: 'builtin', @@ -70,7 +72,10 @@ const ProviderList = () => { return (
-
+
{ 'relative grid content-start grid-cols-1 gap-4 px-12 pt-2 pb-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 grow shrink-0', currentProvider && 'pr-6 sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3', )}> - {activeTab === 'builtin' && } {activeTab === 'api' && } {filteredCollectionList.map(collection => ( { ...collection, brief: collection.description, } as any} + footer={ + + } /> ))} {!filteredCollectionList.length &&
}
+ { + containerRef.current?.scrollTo({ top: containerRef.current.scrollHeight, behavior: 'smooth' }) + }} />