Skip to content

Instantly share code, notes, and snippets.

@janizde
Last active January 17, 2021 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janizde/01e25aa30563cb4904136d64f13e48de to your computer and use it in GitHub Desktop.
Save janizde/01e25aa30563cb4904136d64f13e48de to your computer and use it in GitHub Desktop.
const Breadcrumb = classBound.ol('breadcrumb');
const BreadcrumbItem = classBound.li('breadcrumb-item', { isActive: 'active' });
const BreadcrumbLink = classBound.a('breadcrumb-link');
const BreadcrumbContainer: React.FC<{ items: Item[]; activeId: number }> =
({ items, activeId }) => (
<Breadcrumb aria-label="breadcrumb">
{items.map(item => {
<BreadcrumbItem key={item.id} isActive={item.id === activeId}>
<BreadcrumbLink href={item.url} target="_blank">{item.name}</BreadcrumbLink>
</BreadcrumbItem>
})}
</Breadcrumb>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment