From 8d8d5b523575cdc9406f19d7ebcb9fc1a0816951 Mon Sep 17 00:00:00 2001 From: Joel Date: Wed, 23 Oct 2024 11:45:36 +0800 Subject: [PATCH] chore: handle verified --- web/app/components/plugins/card/index.tsx | 4 ++-- web/app/components/plugins/install-plugin/utils.ts | 7 ++++--- web/app/components/plugins/types.ts | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/web/app/components/plugins/card/index.tsx b/web/app/components/plugins/card/index.tsx index 1ba801eac3..14dffe8f37 100644 --- a/web/app/components/plugins/card/index.tsx +++ b/web/app/components/plugins/card/index.tsx @@ -36,7 +36,7 @@ const Card = ({ }: Props) => { const locale = useGetLanguage() - const { type, name, org, label, brief, icon } = payload + const { type, name, org, label, brief, icon, verified } = payload const getLocalizedText = (obj: Record | undefined) => obj?.[locale] || obj?.['en-US'] || '' @@ -60,7 +60,7 @@ const Card = ({
- <RiVerifiedBadgeLine className="shrink-0 ml-0.5 w-4 h-4 text-text-accent" /> + {verified && <RiVerifiedBadgeLine className="shrink-0 ml-0.5 w-4 h-4 text-text-accent" />} {titleLeft} {/* This can be version badge */} </div> <OrgInfo diff --git a/web/app/components/plugins/install-plugin/utils.ts b/web/app/components/plugins/install-plugin/utils.ts index f3d9158d53..bd5453dd8c 100644 --- a/web/app/components/plugins/install-plugin/utils.ts +++ b/web/app/components/plugins/install-plugin/utils.ts @@ -1,4 +1,4 @@ -import type { Plugin, PluginDeclaration } from "../types" +import type { Plugin, PluginDeclaration } from '../types' export const pluginManifestToCardPluginProps = (pluginManifest: PluginDeclaration): Plugin => { return { @@ -11,11 +11,12 @@ export const pluginManifestToCardPluginProps = (pluginManifest: PluginDeclaratio label: pluginManifest.label, brief: pluginManifest.description, icon: pluginManifest.icon, + verified: pluginManifest.verified, introduction: '', repository: '', install_count: 0, endpoint: { - settings: [] - } + settings: [], + }, } } diff --git a/web/app/components/plugins/types.ts b/web/app/components/plugins/types.ts index 654625a6bd..a2c11a8d6c 100644 --- a/web/app/components/plugins/types.ts +++ b/web/app/components/plugins/types.ts @@ -94,6 +94,7 @@ export type Plugin = { version: string latest_version: string icon: string + verified: boolean label: Record<Locale, string> brief: Record<Locale, string> // Repo readme.md content