From 5e3160e6f6d0d692cee9e89b45a36ef6a93df2ad Mon Sep 17 00:00:00 2001 From: JzoNg Date: Sat, 19 Oct 2024 18:23:32 +0800 Subject: [PATCH] fix title & description of tool provider --- web/app/components/plugins/card/index.tsx | 5 ++--- web/app/components/tools/provider-list.tsx | 13 +++++-------- web/i18n/en-US/tools.ts | 2 +- web/i18n/zh-Hans/tools.ts | 2 +- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/web/app/components/plugins/card/index.tsx b/web/app/components/plugins/card/index.tsx index ef0c146512..049d92536b 100644 --- a/web/app/components/plugins/card/index.tsx +++ b/web/app/components/plugins/card/index.tsx @@ -1,6 +1,5 @@ 'use client' import React from 'react' -import { useContext } from 'use-context-selector' import { RiVerifiedBadgeLine } from '@remixicon/react' import type { Plugin } from '../types' import Icon from '../card/base/card-icon' @@ -10,7 +9,7 @@ import OrgInfo from './base/org-info' import Description from './base/description' import Placeholder from './base/placeholder' import cn from '@/utils/classnames' -import I18n from '@/context/i18n' +import { useGetLanguage } from '@/context/i18n' type Props = { className?: string @@ -35,7 +34,7 @@ const Card = ({ isLoading = false, loadingFileName, }: Props) => { - const { locale } = useContext(I18n) + const locale = useGetLanguage() const { type, name, org, label, brief, icon } = payload diff --git a/web/app/components/tools/provider-list.tsx b/web/app/components/tools/provider-list.tsx index 6f8fbc76bf..8f222bb637 100644 --- a/web/app/components/tools/provider-list.tsx +++ b/web/app/components/tools/provider-list.tsx @@ -9,10 +9,7 @@ import { useTabSearchParams } from '@/hooks/use-tab-searchparams' import TabSliderNew from '@/app/components/base/tab-slider-new' import LabelFilter from '@/app/components/tools/labels/filter' import SearchInput from '@/app/components/base/search-input' -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 CustomCreateCard from '@/app/components/tools/provider/custom-create-card' import ProviderDetail from '@/app/components/tools/provider/detail' import Empty from '@/app/components/tools/add-tool-modal/empty' import { fetchCollectionList } from '@/service/tools' @@ -31,9 +28,9 @@ const ProviderList = () => { defaultTab: 'builtin', }) const options = [ - { value: 'builtin', text: t('tools.type.builtIn'), icon: }, - { value: 'api', text: t('tools.type.custom'), icon: }, - { value: 'workflow', text: t('tools.type.workflow'), icon: }, + { value: 'builtin', text: t('tools.type.builtIn') }, + { value: 'api', text: t('tools.type.custom') }, + { value: 'workflow', text: t('tools.type.workflow') }, ] const [tagFilterValue, setTagFilterValue] = useState([]) const handleTagsChange = (value: string[]) => { @@ -100,7 +97,7 @@ const ProviderList = () => { '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 === 'api' && } + {/* {activeTab === 'api' && } */} {filteredCollectionList.map(collection => (