Browse Source

level = 0 用特别的颜色

visuddhinanda 2 years ago
parent
commit
5fdc40e86d
1 changed files with 14 additions and 2 deletions
  1. 14 2
      dashboard/src/components/corpus/TocPath.tsx

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

@@ -33,7 +33,7 @@ const TocPathWidget = ({
   onChange,
   onChange,
 }: IWidgetTocPath): JSX.Element => {
 }: IWidgetTocPath): JSX.Element => {
   const navigate = useNavigate();
   const navigate = useNavigate();
-  const [searchParams, setSearchParams] = useSearchParams();
+  const [searchParams] = useSearchParams();
   const fullPath = (
   const fullPath = (
     <Breadcrumb
     <Breadcrumb
       style={{ whiteSpace: "nowrap", width: "100%", fontSize: style?.fontSize }}
       style={{ whiteSpace: "nowrap", width: "100%", fontSize: style?.fontSize }}
@@ -73,7 +73,19 @@ const TocPathWidget = ({
           >
           >
             <Typography.Link>
             <Typography.Link>
               {item.level < 99 ? (
               {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>
                 <Tag>{item.title}</Tag>
               )}
               )}