Skip to content

Commit

Permalink
fix(core): Fix breadcrumb links on PDP (#728)
Browse files Browse the repository at this point in the history
  • Loading branch information
christensenep authored Apr 3, 2024
1 parent 19c22ca commit fa83629
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/sweet-frogs-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bigcommerce/catalyst-core": patch
---

Fix breadcrumbs on PDP to have correct links
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const BreadCrumbs = async ({ productId }: Props) => {
return (
<nav>
<ul className="m-0 flex flex-wrap items-center p-0 md:container md:mx-auto ">
{category.breadcrumbs.map((breadcrumb, i, arr) => {
{category.breadcrumbs.map(({ name, path }, i, arr) => {
const isLast = arr.length - 1 === i;

return (
Expand All @@ -26,9 +26,9 @@ export const BreadCrumbs = async ({ productId }: Props) => {
'font-semibold': !isLast,
'font-extrabold': isLast,
})}
key={breadcrumb.name}
key={name}
>
<Link href="#">{breadcrumb.name}</Link>
<Link href={path ?? '#'}>{name}</Link>
{!isLast && <span className="mx-2">/</span>}
</li>
);
Expand Down
1 change: 1 addition & 0 deletions apps/core/client/queries/get-product.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ const PRODUCT_FRAGMENT = graphql(
edges {
node {
name
path
}
}
}
Expand Down

0 comments on commit fa83629

Please sign in to comment.