Skip to content

Commit

Permalink
Make "home" optional in breadcrumb (ant-design#3416)
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-w-opus authored and chenshuai2144 committed Jan 30, 2019
1 parent 007c5c2 commit 4b92d80
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/components/PageHeader/breadcrumb.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,20 @@ export default class BreadcrumbView extends PureComponent {
</Breadcrumb.Item>
) : null;
});
// Add home breadcrumbs to your head
extraBreadcrumbItems.unshift(
<Breadcrumb.Item key="home">
{createElement(
linkElement,
{
[linkElement === 'a' ? 'href' : 'to']: '/',
},
home || 'Home'
)}
</Breadcrumb.Item>
);
// Add home breadcrumbs to your head if defined
if (home) {
extraBreadcrumbItems.unshift(
<Breadcrumb.Item key="home">
{createElement(
linkElement,
{
[linkElement === 'a' ? 'href' : 'to']: '/',
},
home
)}
</Breadcrumb.Item>
);
}
return (
<Breadcrumb className={styles.breadcrumb} separator={breadcrumbSeparator}>
{extraBreadcrumbItems}
Expand Down

0 comments on commit 4b92d80

Please sign in to comment.