diff --git a/src/components/Breadcrumb/index.tsx b/src/components/Breadcrumb/index.tsx index a42e563..0015236 100644 --- a/src/components/Breadcrumb/index.tsx +++ b/src/components/Breadcrumb/index.tsx @@ -32,7 +32,7 @@ function flatten([ export function Breadcrumb({ relativePath, basePath }: IBreadcrumbProps) { const paths = relativePath.split("/") const breadcrumbItems = flatten([traversePaths(paths, basePath)]) - + let foldersDepth = 0; return ( @@ -52,14 +52,25 @@ export function Breadcrumb({ relativePath, basePath }: IBreadcrumbProps) { /> + {breadcrumbItems.map(item => { if (item.type === "folder") { - return ( + foldersDepth++; + if (foldersDepth > 1) { + return ( - + { item.title } - ) + ) + } else { + return ( + + + + + ) + } } return ( diff --git a/src/components/ResourcesSidebar/index.tsx b/src/components/ResourcesSidebar/index.tsx index 30b5260..c5f6456 100644 --- a/src/components/ResourcesSidebar/index.tsx +++ b/src/components/ResourcesSidebar/index.tsx @@ -99,7 +99,7 @@ function Folder({ item }: { item: IFolder }) { {sortedChildren.map(node => ( - + ))} @@ -120,7 +120,7 @@ const FirstLevelFolder = memo(({ item }: { item: IFolder }) => { {humanize(item.title)} {sortedChildren.map(node => ( - + ))}