collapsible left panel

This commit is contained in:
Jan Prochazka
2019-12-30 22:49:38 +01:00
parent e2094fdfda
commit 30af732820
2 changed files with 18 additions and 11 deletions

View File

@@ -45,7 +45,11 @@ export default function WidgetIconPanel() {
const setCurrentWidget = useSetCurrentWidget();
return widgets.map(({ icon, name }) => (
<IconWrapper key={icon} isSelected={name === currentWidget} onClick={() => setCurrentWidget(name)}>
<IconWrapper
key={icon}
isSelected={name === currentWidget}
onClick={() => setCurrentWidget(name === currentWidget ? null : name)}
>
<FontIcon name={icon} />
</IconWrapper>
));