From 4b92d80b8fa8c138af3916d5d75547e95ea8c767 Mon Sep 17 00:00:00 2001 From: Zhongjie Wu Date: Wed, 30 Jan 2019 19:33:21 +0800 Subject: [PATCH] Make "home" optional in breadcrumb (#3416) --- src/components/PageHeader/breadcrumb.js | 26 +++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/components/PageHeader/breadcrumb.js b/src/components/PageHeader/breadcrumb.js index 28c71b06..e6afcb54 100644 --- a/src/components/PageHeader/breadcrumb.js +++ b/src/components/PageHeader/breadcrumb.js @@ -100,18 +100,20 @@ export default class BreadcrumbView extends PureComponent { ) : null; }); - // Add home breadcrumbs to your head - extraBreadcrumbItems.unshift( - - {createElement( - linkElement, - { - [linkElement === 'a' ? 'href' : 'to']: '/', - }, - home || 'Home' - )} - - ); + // Add home breadcrumbs to your head if defined + if (home) { + extraBreadcrumbItems.unshift( + + {createElement( + linkElement, + { + [linkElement === 'a' ? 'href' : 'to']: '/', + }, + home + )} + + ); + } return ( {extraBreadcrumbItems} -- GitLab