From 09dae7269a84cc364c4222c5d0e054a2f4ab84ce Mon Sep 17 00:00:00 2001 From: Qiao Date: Tue, 3 Feb 2026 14:23:13 +0800 Subject: [PATCH] =?UTF-8?q?style(webui):=20=E4=BC=98=E5=8C=96=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E5=95=86=E5=BA=97=E6=A0=B7=E5=BC=8F=EF=BC=8C=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E5=9B=BA=E5=AE=9A=E5=A4=B4=E9=83=A8=20(#1585)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 修复 qq_login.tsx 类型错误 - onSelectionChange 的 key 参数可能为 null,添加空值检查 * style(webui): refactor plugin store layout with sticky header --- .../src/pages/dashboard/plugin_store.tsx | 158 ++++++++++-------- 1 file changed, 86 insertions(+), 72 deletions(-) diff --git a/packages/napcat-webui-frontend/src/pages/dashboard/plugin_store.tsx b/packages/napcat-webui-frontend/src/pages/dashboard/plugin_store.tsx index f8c52ff1..32236498 100644 --- a/packages/napcat-webui-frontend/src/pages/dashboard/plugin_store.tsx +++ b/packages/napcat-webui-frontend/src/pages/dashboard/plugin_store.tsx @@ -9,6 +9,7 @@ import toast from 'react-hot-toast'; import { IoMdRefresh, IoMdSearch, IoMdSettings } from 'react-icons/io'; import clsx from 'clsx'; import { EventSourcePolyfill } from 'event-source-polyfill'; +import { useLocalStorage } from '@uidotdev/usehooks'; import PluginStoreCard, { InstallStatus } from '@/components/display_card/plugin_store_card'; import PluginManager, { PluginItem } from '@/controllers/plugin_manager'; @@ -226,68 +227,70 @@ export default function PluginStorePage () { } }; + const [backgroundImage] = useLocalStorage(key.backgroundImage, ''); + const hasBackground = !!backgroundImage; + return ( <> 插件商店 - NapCat WebUI
- {/* 头部 */} -
-
-

插件商店

- + {/* 固定头部区域 */} +
+ {/* 头部 */} +
+
+

插件商店

+ +
+ + {/* 商店列表源卡片 */} + + +
+
+ 列表源: + {getStoreSourceDisplayName()} +
+ + + +
+
+
- {/* 商店列表源卡片 */} - - -
-
- 列表源: - {getStoreSourceDisplayName()} -
- - - -
-
-
-
- - {/* 搜索框 */} -
- } - value={searchQuery} - onValueChange={setSearchQuery} - className="max-w-md" - /> -
- - {/* 标签页 */} -
- {/* 加载遮罩 - 只遮住插件列表区域 */} - {loading && ( -
- -
- )} + {/* 搜索框 */} +
+ } + value={searchQuery} + onValueChange={setSearchQuery} + className="max-w-md" + /> +
+ {/* 标签页导航 */} {tabs.map((tab) => ( - -
- {categorizedPlugins[tab.key]?.map((plugin) => { - const installInfo = getPluginInstallInfo(plugin); - return ( - handleInstall(plugin)} - /> - ); - })} -
-
+ /> ))}
+ + {/* 插件列表区域 */} +
+ {/* 加载遮罩 - 只遮住插件列表区域 */} + {loading && ( +
+ +
+ )} + + +
+ {categorizedPlugins[activeTab]?.map((plugin) => { + const installInfo = getPluginInstallInfo(plugin); + return ( + handleInstall(plugin)} + /> + ); + })} +
+
{/* 商店列表源选择弹窗 */}