Skip to content

Commit

Permalink
provide empty icon if none provided
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkime committed Jan 8, 2020
1 parent d3d7a7b commit 7a48b8b
Showing 1 changed file with 10 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,16 @@ const managementSectionOrAppToNav = (appOrSection: ManagementApp | ManagementSec
});

const managementSectionToNavSection = (section: ManagementSection) => {
if (section.icon) {
return {
icon: <EuiIcon type={section.icon} size="m" />,
...managementSectionOrAppToNav(section),
};
}
// euiIconType takes precedence
if (section.euiIconType) {
return {
icon: <EuiIcon type={section.euiIconType} size="m" />,
...managementSectionOrAppToNav(section),
};
}
return { ...managementSectionOrAppToNav(section) };
const iconType = section.euiIconType
? section.euiIconType
: section.icon
? section.icon
: 'empty';

return {
icon: <EuiIcon type={iconType} size="m" />,
...managementSectionOrAppToNav(section),
};
};

const managementAppToNavItem = (selectedId?: string, parentId?: string) => (
Expand Down

0 comments on commit 7a48b8b

Please sign in to comment.