From ae8fd61ea4be5871bd9bcd07eb38c791a6fabeb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Tue, 12 May 2020 20:41:03 +0200 Subject: [PATCH] feat: support internal routes --- frontend/src/component/menu/drawer.jsx | 41 ++++++++++++++++++-------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/frontend/src/component/menu/drawer.jsx b/frontend/src/component/menu/drawer.jsx index fe4b020920..755303f28d 100644 --- a/frontend/src/component/menu/drawer.jsx +++ b/frontend/src/component/menu/drawer.jsx @@ -14,6 +14,33 @@ function getIcon(name) { } } +function renderLink(link) { + if (link.path) { + return ( + + {getIcon(link.icon)} {link.value} + + ); + } else { + return ( + + {getIcon(link.icon)} {link.value} + + ); + } +} + export const DrawerMenu = ({ links = [] }) => ( @@ -36,19 +63,7 @@ export const DrawerMenu = ({ links = [] }) => ( ))}
- - {links.map(link => ( - - {getIcon(link.icon)} {link.value} - - ))} - + {links.map(renderLink)}
);