From 4a548021c3e096d0510bf5eb8dbf4424a8dce75f Mon Sep 17 00:00:00 2001 From: Bruno Quaresma Date: Wed, 19 Mar 2025 10:52:04 -0300 Subject: [PATCH] fix: close popover when notification settings are clicked (#17001) When a user clicks in the notification settings does not make sense to keep the popover open, instead, we want to close it. --- .../notifications/NotificationsInbox/InboxPopover.tsx | 11 ++++++++--- .../NotificationsInbox/NotificationsInbox.tsx | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/site/src/modules/notifications/NotificationsInbox/InboxPopover.tsx b/site/src/modules/notifications/NotificationsInbox/InboxPopover.tsx index b180891889..e487d4303f 100644 --- a/site/src/modules/notifications/NotificationsInbox/InboxPopover.tsx +++ b/site/src/modules/notifications/NotificationsInbox/InboxPopover.tsx @@ -8,7 +8,7 @@ import { import { ScrollArea } from "components/ScrollArea/ScrollArea"; import { Spinner } from "components/Spinner/Spinner"; import { RefreshCwIcon, SettingsIcon } from "lucide-react"; -import type { FC } from "react"; +import { type FC, useState } from "react"; import { Link as RouterLink } from "react-router-dom"; import { cn } from "utils/cn"; import { InboxButton } from "./InboxButton"; @@ -34,8 +34,10 @@ export const InboxPopover: FC = ({ onMarkAllAsRead, onMarkNotificationAsRead, }) => { + const [isOpen, setIsOpen] = useState(defaultOpen); + return ( - + @@ -61,7 +63,10 @@ export const InboxPopover: FC = ({ Mark all as read