mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-08 16:06:13 +02:00
Renamed count to foldersDepth
This commit is contained in:
@@ -32,7 +32,7 @@ function flatten([
|
|||||||
export function Breadcrumb({ relativePath, basePath }: IBreadcrumbProps) {
|
export function Breadcrumb({ relativePath, basePath }: IBreadcrumbProps) {
|
||||||
const paths = relativePath.split("/")
|
const paths = relativePath.split("/")
|
||||||
const breadcrumbItems = flatten([traversePaths(paths, basePath)])
|
const breadcrumbItems = flatten([traversePaths(paths, basePath)])
|
||||||
let count = 0;
|
let foldersDepth = 0;
|
||||||
return (
|
return (
|
||||||
<SC.BreadcrumbWrapper>
|
<SC.BreadcrumbWrapper>
|
||||||
<SC.LinkWrapper>
|
<SC.LinkWrapper>
|
||||||
@@ -55,8 +55,8 @@ export function Breadcrumb({ relativePath, basePath }: IBreadcrumbProps) {
|
|||||||
|
|
||||||
{breadcrumbItems.map(item => {
|
{breadcrumbItems.map(item => {
|
||||||
if (item.type === "folder") {
|
if (item.type === "folder") {
|
||||||
count++;
|
foldersDepth++;
|
||||||
if (count > 1) {
|
if (foldersDepth > 1) {
|
||||||
return (
|
return (
|
||||||
<SC.LinkWrapper key={item.path}>
|
<SC.LinkWrapper key={item.path}>
|
||||||
{ item.title }
|
{ item.title }
|
||||||
|
|||||||
Reference in New Issue
Block a user