Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Commit

Permalink
Don't overlap buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
floriandejonckheere committed Dec 10, 2023
1 parent e27622a commit bd58f49
Showing 1 changed file with 29 additions and 26 deletions.
55 changes: 29 additions & 26 deletions src/components/energy_alerts_popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,8 @@ export default function EnergyAlertsPopover(): ReactElement {
</div>
) : (
alerts.map((alert) => (
<a
<div
key={alert.id}
href="#"
onClick={(e) => {
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'
Expand All @@ -115,26 +107,37 @@ export default function EnergyAlertsPopover(): ReactElement {
}`}
>
<div className="flex items-center justify-between p-4 md:p-5">
<span className="flex items-center me-5">
{(alert.type === 'info' && (
<InformationCircleIcon className="w-10 h-10 dark:text-gray-200" />
)) ||
(alert.type === 'warning' && (
<ShieldExclamationIcon className="w-10 h-10 dark:text-gray-200" />
<a
href="#"
onClick={(e) => {
e.preventDefault()
setOpen(false)
setSettings(false)
markAsRead(alert)
navigate('/suggestions')
}}
>
<span className="flex items-center me-5">
{(alert.type === 'info' && (
<InformationCircleIcon className="w-10 h-10 dark:text-gray-200" />
)) ||
(alert.type === 'error' && (
<ExclamationTriangleIcon className="w-10 h-10 dark:text-gray-200" />
))}
(alert.type === 'warning' && (
<ShieldExclamationIcon className="w-10 h-10 dark:text-gray-200" />
)) ||
(alert.type === 'error' && (
<ExclamationTriangleIcon className="w-10 h-10 dark:text-gray-200" />
))}

<span className="ms-5">
<span className="block font-medium text-gray-800 dark:text-gray-200">
{alert.title}
</span>
<span className="block text-sm text-gray-500 dark:text-gray-400">
{alert.message}
<span className="ms-5">
<span className="block font-medium text-gray-800 dark:text-gray-200">
{alert.title}
</span>
<span className="block text-sm text-gray-500 dark:text-gray-400">
{alert.message}
</span>
</span>
</span>
</span>
</a>
{alert.unread && (
<a
href="#"
Expand All @@ -155,7 +158,7 @@ export default function EnergyAlertsPopover(): ReactElement {
</a>
)}
</div>
</a>
</div>
))
)}
</div>
Expand Down

0 comments on commit bd58f49

Please sign in to comment.