fix: marketplace collection label description

This commit is contained in:
StyleZhang 2024-11-19 16:42:49 +08:00
parent a867040b88
commit 27b1a51572
6 changed files with 12 additions and 8 deletions

View File

@ -1,12 +1,14 @@
import PluginPage from '@/app/components/plugins/plugin-page' import PluginPage from '@/app/components/plugins/plugin-page'
import PluginsPanel from '@/app/components/plugins/plugin-page/plugins-panel' import PluginsPanel from '@/app/components/plugins/plugin-page/plugins-panel'
import Marketplace from '@/app/components/plugins/marketplace' import Marketplace from '@/app/components/plugins/marketplace'
import { getLocaleOnServer } from '@/i18n/server'
const PluginList = async () => { const PluginList = async () => {
const locale = await getLocaleOnServer()
return ( return (
<PluginPage <PluginPage
plugins={<PluginsPanel />} plugins={<PluginsPanel />}
marketplace={<Marketplace />} marketplace={<Marketplace locale={locale} />}
/> />
) )
} }

View File

@ -9,7 +9,7 @@ import { getMarketplaceCollectionsAndPlugins } from './utils'
import { TanstackQueryIniter } from '@/context/query-client' import { TanstackQueryIniter } from '@/context/query-client'
type MarketplaceProps = { type MarketplaceProps = {
locale?: string locale: string
showInstallButton?: boolean showInstallButton?: boolean
searchParams?: SearchParams searchParams?: SearchParams
} }

View File

@ -10,7 +10,7 @@ type ListProps = {
marketplaceCollectionPluginsMap: Record<string, Plugin[]> marketplaceCollectionPluginsMap: Record<string, Plugin[]>
plugins?: Plugin[] plugins?: Plugin[]
showInstallButton?: boolean showInstallButton?: boolean
locale?: string locale: string
} }
const List = ({ const List = ({
marketplaceCollections, marketplaceCollections,

View File

@ -2,12 +2,13 @@
import type { MarketplaceCollection } from '../types' import type { MarketplaceCollection } from '../types'
import CardWrapper from './card-wrapper' import CardWrapper from './card-wrapper'
import type { Plugin } from '@/app/components/plugins/types' import type { Plugin } from '@/app/components/plugins/types'
import { getLanguage } from '@/i18n/language'
type ListWithCollectionProps = { type ListWithCollectionProps = {
marketplaceCollections: MarketplaceCollection[] marketplaceCollections: MarketplaceCollection[]
marketplaceCollectionPluginsMap: Record<string, Plugin[]> marketplaceCollectionPluginsMap: Record<string, Plugin[]>
showInstallButton?: boolean showInstallButton?: boolean
locale?: string locale: string
} }
const ListWithCollection = ({ const ListWithCollection = ({
marketplaceCollections, marketplaceCollections,
@ -23,8 +24,8 @@ const ListWithCollection = ({
key={collection.name} key={collection.name}
className='py-3' className='py-3'
> >
<div className='title-xl-semi-bold text-text-primary'>{collection.name}</div> <div className='title-xl-semi-bold text-text-primary'>{collection.label[getLanguage(locale)]}</div>
<div className='system-xs-regular text-text-tertiary'>{collection.description}</div> <div className='system-xs-regular text-text-tertiary'>{collection.description[getLanguage(locale)]}</div>
<div className='grid grid-cols-4 gap-3 mt-2'> <div className='grid grid-cols-4 gap-3 mt-2'>
{ {
marketplaceCollectionPluginsMap[collection.name].map(plugin => ( marketplaceCollectionPluginsMap[collection.name].map(plugin => (

View File

@ -11,7 +11,7 @@ type ListWrapperProps = {
marketplaceCollections: MarketplaceCollection[] marketplaceCollections: MarketplaceCollection[]
marketplaceCollectionPluginsMap: Record<string, Plugin[]> marketplaceCollectionPluginsMap: Record<string, Plugin[]>
showInstallButton?: boolean showInstallButton?: boolean
locale?: string locale: string
} }
const ListWrapper = ({ const ListWrapper = ({
marketplaceCollections, marketplaceCollections,

View File

@ -2,7 +2,8 @@ import type { Plugin } from '../types'
export type MarketplaceCollection = { export type MarketplaceCollection = {
name: string name: string
description: string label: Record<string, string>
description: Record<string, string>
rule: string rule: string
created_at: string created_at: string
updated_at: string updated_at: string