Commit 4b92d80b authored by Zhongjie Wu's avatar Zhongjie Wu Committed by ι™ˆεΈ…

Make "home" optional in breadcrumb (#3416)

parent 007c5c2c
...@@ -100,7 +100,8 @@ export default class BreadcrumbView extends PureComponent { ...@@ -100,7 +100,8 @@ export default class BreadcrumbView extends PureComponent {
</Breadcrumb.Item> </Breadcrumb.Item>
) : null; ) : null;
}); });
// Add home breadcrumbs to your head // Add home breadcrumbs to your head if defined
if (home) {
extraBreadcrumbItems.unshift( extraBreadcrumbItems.unshift(
<Breadcrumb.Item key="home"> <Breadcrumb.Item key="home">
{createElement( {createElement(
...@@ -108,10 +109,11 @@ export default class BreadcrumbView extends PureComponent { ...@@ -108,10 +109,11 @@ export default class BreadcrumbView extends PureComponent {
{ {
[linkElement === 'a' ? 'href' : 'to']: '/', [linkElement === 'a' ? 'href' : 'to']: '/',
}, },
home || 'Home' home
)} )}
</Breadcrumb.Item> </Breadcrumb.Item>
); );
}
return ( return (
<Breadcrumb className={styles.breadcrumb} separator={breadcrumbSeparator}> <Breadcrumb className={styles.breadcrumb} separator={breadcrumbSeparator}>
{extraBreadcrumbItems} {extraBreadcrumbItems}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment