From e701ceeeba661ae30a3980a009a7a589e86f994a Mon Sep 17 00:00:00 2001 From: Junyan Qin Date: Sat, 30 Aug 2025 17:19:16 +0800 Subject: [PATCH] perf: dark theme --- .../PluginDetailDialog.tsx | 90 +++++++++++++------ 1 file changed, 62 insertions(+), 28 deletions(-) diff --git a/web/src/app/home/plugins/plugin-market/plugin-detail-dialog/PluginDetailDialog.tsx b/web/src/app/home/plugins/plugin-market/plugin-detail-dialog/PluginDetailDialog.tsx index 2bb29f8d..4421d972 100644 --- a/web/src/app/home/plugins/plugin-market/plugin-detail-dialog/PluginDetailDialog.tsx +++ b/web/src/app/home/plugins/plugin-market/plugin-detail-dialog/PluginDetailDialog.tsx @@ -84,18 +84,23 @@ export default function PluginDetailDialog({ className="w-16 h-16 rounded-xl border bg-gray-50 object-cover flex-shrink-0" />
-

+

{extractI18nObject(plugin!.label) || plugin!.name}

-
+
{plugin!.author} / {plugin!.name}
- v{plugin!.latest_version} - + + v{plugin!.latest_version} + + {plugin!.install_count.toLocaleString()} {t('market.downloads')} @@ -105,7 +110,7 @@ export default function PluginDetailDialog({ e.stopPropagation(); window.open(plugin!.repository, '_blank'); }} - className="flex items-center gap-1 px-2 py-1 text-xs bg-gray-100 hover:bg-gray-200 rounded-md transition-colors" + className="flex items-center gap-1 px-2 py-1 text-xs bg-gray-100 hover:bg-gray-200 rounded-md transition-colors dark:bg-gray-800 dark:text-white dark:hover:bg-gray-700 cursor-pointer" > @@ -120,7 +125,7 @@ export default function PluginDetailDialog({ const PluginDescription = () => (
-

+

{extractI18nObject(plugin!.description) || t('market.noDescription')}

@@ -139,38 +144,55 @@ export default function PluginDetailDialog({ ); const ReadmeContent = () => ( -
+
( -
- +
+
), - thead: ({ ...props }) => , + thead: ({ ...props }) => ( + + ), tbody: ({ ...props }) => ( - + ), th: ({ ...props }) => ( + ), // 删除线支持 del: ({ ...props }) => ( - + ), // Todo 列表支持 input: ({ type, checked, ...props }) => { @@ -180,23 +202,35 @@ export default function PluginDetailDialog({ type="checkbox" checked={checked} disabled - className="mr-2 rounded border-gray-300 text-blue-600 focus:ring-blue-500 cursor-default" + className="mr-2 rounded border-gray-300 text-blue-600 focus:ring-blue-500 cursor-default dark:border-gray-700" {...props} /> ); } return ; }, - ul: ({ ...props }) =>
    , - ol: ({ ...props }) =>
      , + ul: ({ ...props }) => ( +
        + ), + ol: ({ ...props }) => ( +
          + ), li: ({ ...props }) =>
        1. , h1: ({ ...props }) => ( -

          +

          ), h2: ({ ...props }) => ( -

          +

          + ), + p: ({ ...props }) => ( +

          ), - p: ({ ...props }) =>

          , code: ({ className, children, ...props }) => { const match = /language-(\w+)/.exec(className || ''); const isCodeBlock = match ? true : false; @@ -205,7 +239,7 @@ export default function PluginDetailDialog({ if (isCodeBlock) { return ( {children} @@ -216,7 +250,7 @@ export default function PluginDetailDialog({ // 内联代码样式 - 淡灰色底 return ( {children} @@ -225,7 +259,7 @@ export default function PluginDetailDialog({ }, pre: ({ ...props }) => (

                       
          -            {t('cloud.loading')}
          +            {t('market.loading')}
                     
                   ) : plugin ? (
                     
          {/* 插件信息区域 */} -
          +
          @@ -272,12 +306,12 @@ export default function PluginDetailDialog({ {/* README 区域 */}
          -
          +
          {isLoadingReadme ? (
          - {t('cloud.loading')} + {t('market.loading')}
          ) : (

), td: ({ ...props }) => ( ), tr: ({ ...props }) => ( -