Преглед изворни кода

level = 0 用特别的颜色

visuddhinanda пре 2 година
родитељ
комит
5fdc40e86d
1 измењених фајлова са 14 додато и 2 уклоњено
  1. 14 2
      dashboard/src/components/corpus/TocPath.tsx

+ 14 - 2
dashboard/src/components/corpus/TocPath.tsx

@@ -33,7 +33,7 @@ const TocPathWidget = ({
   onChange,
 }: IWidgetTocPath): JSX.Element => {
   const navigate = useNavigate();
-  const [searchParams, setSearchParams] = useSearchParams();
+  const [searchParams] = useSearchParams();
   const fullPath = (
     <Breadcrumb
       style={{ whiteSpace: "nowrap", width: "100%", fontSize: style?.fontSize }}
@@ -73,7 +73,19 @@ const TocPathWidget = ({
           >
             <Typography.Link>
               {item.level < 99 ? (
-                <PaliText text={item.title} />
+                <span
+                  style={
+                    item.level === 0
+                      ? {
+                          padding: 4,
+                          backgroundColor: "#92880052",
+                          borderRadius: 4,
+                        }
+                      : undefined
+                  }
+                >
+                  <PaliText text={item.title} />
+                </span>
               ) : (
                 <Tag>{item.title}</Tag>
               )}