From bd58f49628d0485add35b922829575b7336ba45d Mon Sep 17 00:00:00 2001 From: Florian Dejonckheere Date: Sun, 10 Dec 2023 15:19:39 +0100 Subject: [PATCH] Don't overlap buttons --- src/components/energy_alerts_popover.tsx | 55 +++++++++++++----------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/src/components/energy_alerts_popover.tsx b/src/components/energy_alerts_popover.tsx index 822d451..8ddfba6 100644 --- a/src/components/energy_alerts_popover.tsx +++ b/src/components/energy_alerts_popover.tsx @@ -92,16 +92,8 @@ export default function EnergyAlertsPopover(): ReactElement { ) : ( alerts.map((alert) => ( - { - e.preventDefault() - setOpen(false) - setSettings(false) - markAsRead(alert) - navigate('/suggestions') - }} className={`flex flex-col transition-all last:rounded-b-lg ${ alert.unread ? 'bg-sky-50 hover:bg-sky-100 dark:bg-slate-600 dark:hover:bg-slate-500' @@ -115,26 +107,37 @@ export default function EnergyAlertsPopover(): ReactElement { }`} >
- - {(alert.type === 'info' && ( - - )) || - (alert.type === 'warning' && ( - + { + e.preventDefault() + setOpen(false) + setSettings(false) + markAsRead(alert) + navigate('/suggestions') + }} + > + + {(alert.type === 'info' && ( + )) || - (alert.type === 'error' && ( - - ))} + (alert.type === 'warning' && ( + + )) || + (alert.type === 'error' && ( + + ))} - - - {alert.title} - - - {alert.message} + + + {alert.title} + + + {alert.message} + - + {alert.unread && ( )}
- + )) )}