Skip to content

Commit

Permalink
Merge pull request #111 from vtexdocs/fix/breadcrumbs-link
Browse files Browse the repository at this point in the history
fix: breadcrumbs rendering link instead of text
  • Loading branch information
PedroAntunesCosta authored Oct 4, 2024
2 parents 1a9aecd + 3096511 commit 8dd010e
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions src/components/breadcrumb/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,20 @@ interface Props {
const Breadcrumb = ({ breadcrumbList }: Props) => {
return (
<Flex sx={styles.breadcrumb}>
{breadcrumbList.map((item, idx) =>
item.type === 'category' ? (
<>
<Text>{item.name}</Text>
{idx < breadcrumbList.length - 1 ? (
<IconCaret direction="right" size={16} />
) : (
''
)}
</>
) : (
<>
{breadcrumbList.map((item, idx) => (
<>
{item.type === 'markdown' ? (
<Link sx={styles.breadcrumbItem} href={item.slug}>
{item.name}
</Link>
{idx < breadcrumbList.length - 1 ? (
<IconCaret direction="right" size={16} />
) : (
''
)}
</>
)
)}
) : (
<Text>{item.name}</Text>
)}
{idx < breadcrumbList.length - 1 ? (
<IconCaret direction="right" size={16} />
) : null}
</>
))}
</Flex>
)
}
Expand Down

0 comments on commit 8dd010e

Please sign in to comment.