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

Make "home" optional in breadcrumb (#3416)

parent 007c5c2c
...@@ -100,18 +100,20 @@ export default class BreadcrumbView extends PureComponent { ...@@ -100,18 +100,20 @@ 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
extraBreadcrumbItems.unshift( if (home) {
<Breadcrumb.Item key="home"> extraBreadcrumbItems.unshift(
{createElement( <Breadcrumb.Item key="home">
linkElement, {createElement(
{ linkElement,
[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