File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
site/src/modules/notifications/NotificationsInbox Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 8
8
import { ScrollArea } from "components/ScrollArea/ScrollArea" ;
9
9
import { Spinner } from "components/Spinner/Spinner" ;
10
10
import { RefreshCwIcon , SettingsIcon } from "lucide-react" ;
11
- import type { FC } from "react" ;
11
+ import { type FC , useState } from "react" ;
12
12
import { Link as RouterLink } from "react-router-dom" ;
13
13
import { cn } from "utils/cn" ;
14
14
import { InboxButton } from "./InboxButton" ;
@@ -34,8 +34,10 @@ export const InboxPopover: FC<InboxPopoverProps> = ({
34
34
onMarkAllAsRead,
35
35
onMarkNotificationAsRead,
36
36
} ) => {
37
+ const [ isOpen , setIsOpen ] = useState ( defaultOpen ) ;
38
+
37
39
return (
38
- < Popover defaultOpen = { defaultOpen } >
40
+ < Popover open = { isOpen } onOpenChange = { setIsOpen } >
39
41
< PopoverTrigger asChild >
40
42
< InboxButton unreadCount = { unreadCount } />
41
43
</ PopoverTrigger >
@@ -61,7 +63,10 @@ export const InboxPopover: FC<InboxPopoverProps> = ({
61
63
Mark all as read
62
64
</ Button >
63
65
< Button variant = "outline" size = "icon" asChild >
64
- < RouterLink to = "/settings/notifications" >
66
+ < RouterLink
67
+ to = "/settings/notifications"
68
+ onClick = { ( ) => setIsOpen ( false ) }
69
+ >
65
70
< SettingsIcon />
66
71
< span className = "sr-only" > Notification settings</ span >
67
72
</ RouterLink >
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import type {
6
6
} from "api/typesGenerated" ;
7
7
import { displayError } from "components/GlobalSnackbar/utils" ;
8
8
import { useEffectEvent } from "hooks/hookPolyfills" ;
9
- import { type FC , useEffect , useRef } from "react" ;
9
+ import { type FC , useEffect } from "react" ;
10
10
import { useMutation , useQuery , useQueryClient } from "react-query" ;
11
11
import { InboxPopover } from "./InboxPopover" ;
12
12
You can’t perform that action at this time.
0 commit comments