From 0a76f8dbd1b6adb4775926a7067666046cf33d80 Mon Sep 17 00:00:00 2001 From: yorn <1057707203@qq.com> Date: Thu, 8 May 2025 17:38:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AF=84=E6=9F=A5=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E4=B8=AD=E7=94=A8=E6=88=B7=E6=93=8D=E4=BD=9C=E7=9A=84?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=88=B7=E6=96=B0=E4=B8=BA=E7=83=AD=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/layout/Breadcrumb.tsx | 13 +- app/components/layout/Layout.tsx | 23 +- app/components/reviews/FileInfo.tsx | 92 +------ app/components/reviews/ReviewPointsList.tsx | 10 +- app/components/reviews/ReviewTabs.tsx | 158 +++++++++-- app/routes/_index.tsx | 9 +- app/routes/reviews.tsx | 281 +++++++++++++------- 7 files changed, 356 insertions(+), 230 deletions(-) diff --git a/app/components/layout/Breadcrumb.tsx b/app/components/layout/Breadcrumb.tsx index 1985936..c044320 100644 --- a/app/components/layout/Breadcrumb.tsx +++ b/app/components/layout/Breadcrumb.tsx @@ -18,6 +18,7 @@ interface PreviousRouteData { interface Handle { breadcrumb: string | ((data: unknown) => string); previousRoute?: PreviousRouteData | ((data: unknown) => PreviousRouteData | undefined); + breadcrumbClassName?: string; } interface Match { @@ -64,12 +65,22 @@ export function Breadcrumb({ items = [], className = '' }: BreadcrumbProps) { }) .flat(); // 扁平化数组 + // 获取自定义类名 + const getCustomClassName = () => { + const lastMatch = matches[matches.length - 1]; + return lastMatch?.handle?.breadcrumbClassName || ''; + }; + if (breadcrumbs.length === 0) { return null; } + // 应用自定义类名 + const customClassName = getCustomClassName(); + const finalClassName = `mb-4 ${className} ${customClassName}`.trim(); + return ( -