Skip to content

Commit a15986e

Browse files
Update src/components/BreadCrumbs.res
Co-authored-by: Copilot <[email protected]>
1 parent 95b07eb commit a15986e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/components/BreadCrumbs.res

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ let make = () => {
88

99
<div className="w-full captions overflow-x-auto text-gray-60 mb-8">
1010
{paths
11-
->Array.mapWithIndex((path, i) =>
12-
<>
13-
<ReactRouter.Link.String key={path} to=path prefetch={#intent}>
11+
->Array.mapWithIndex((path, i) => {
12+
let cumulativePath =
13+
"/" ++ (paths->Array.slice(0, i + 1)->Array.joinWith("/"))
14+
15+
<React.Fragment key={cumulativePath}>
16+
<ReactRouter.Link.String to=cumulativePath prefetch={#intent}>
1417
{React.string(path->String.capitalize)}
1518
</ReactRouter.Link.String>
1619
{i == lastIndex ? React.null : React.string(" / ")}
17-
</>
18-
)
20+
</React.Fragment>
21+
})
1922
->React.array}
2023
</div>
2124
}

0 commit comments

Comments
 (0)