From 7a48b8babfafe52c637e27eb86814d9dcb618651 Mon Sep 17 00:00:00 2001 From: Matt Kime Date: Wed, 8 Jan 2020 15:52:09 -0600 Subject: [PATCH] provide empty icon if none provided --- .../management_sidebar_nav.tsx | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/plugins/management/public/components/management_sidebar_nav/management_sidebar_nav.tsx b/src/plugins/management/public/components/management_sidebar_nav/management_sidebar_nav.tsx index 551857a375146..cb0b82d0f0bde 100644 --- a/src/plugins/management/public/components/management_sidebar_nav/management_sidebar_nav.tsx +++ b/src/plugins/management/public/components/management_sidebar_nav/management_sidebar_nav.tsx @@ -59,20 +59,16 @@ const managementSectionOrAppToNav = (appOrSection: ManagementApp | ManagementSec }); const managementSectionToNavSection = (section: ManagementSection) => { - if (section.icon) { - return { - icon: , - ...managementSectionOrAppToNav(section), - }; - } - // euiIconType takes precedence - if (section.euiIconType) { - return { - icon: , - ...managementSectionOrAppToNav(section), - }; - } - return { ...managementSectionOrAppToNav(section) }; + const iconType = section.euiIconType + ? section.euiIconType + : section.icon + ? section.icon + : 'empty'; + + return { + icon: , + ...managementSectionOrAppToNav(section), + }; }; const managementAppToNavItem = (selectedId?: string, parentId?: string) => (