From d2b48afcc6a97f5986adf864d4fe179fe3aa8d48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20S=C3=A1nchez-Gallego?= Date: Mon, 9 Jan 2023 21:38:52 -0800 Subject: [PATCH] Fix drawer icons not opening windows --- src/renderer/Main/Drawer.tsx | 41 ++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/src/renderer/Main/Drawer.tsx b/src/renderer/Main/Drawer.tsx index 5d40845..6f2bdb3 100644 --- a/src/renderer/Main/Drawer.tsx +++ b/src/renderer/Main/Drawer.tsx @@ -75,12 +75,25 @@ type ItemProps = { name: string; icon: React.ReactElement; text?: string; + open?: boolean; }; function Item(props: ItemProps) { - const { name, icon, text } = props; + const { name, icon, text, open = false } = props; - return ; + const openNewWindow = React.useCallback((windowName: string) => { + window.electron.app.openNewWindow(windowName); + }, []); + + return ( + + ); } export default function Drawer() { @@ -94,15 +107,31 @@ export default function Drawer() { - } text='New log window' /> + } + text='New log window' + open={open} + /> } text='Snapshots' + open={open} + /> + } + text='Guider' + open={open} + /> + } + text='HAL' + open={open} /> - } text='Guider' /> - } text='HAL' /> - } text='Chat' /> + } text='Chat' open={open} />