Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4a54802

Browse files
fix: close popover when notification settings are clicked (#17001)
When a user clicks in the notification settings does not make sense tokeep the popover open, instead, we want to close it.
1 parent86d9071 commit4a54802

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

‎site/src/modules/notifications/NotificationsInbox/InboxPopover.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
import{ScrollArea}from"components/ScrollArea/ScrollArea";
99
import{Spinner}from"components/Spinner/Spinner";
1010
import{RefreshCwIcon,SettingsIcon}from"lucide-react";
11-
importtype{FC}from"react";
11+
import{typeFC,useState}from"react";
1212
import{LinkasRouterLink}from"react-router-dom";
1313
import{cn}from"utils/cn";
1414
import{InboxButton}from"./InboxButton";
@@ -34,8 +34,10 @@ export const InboxPopover: FC<InboxPopoverProps> = ({
3434
onMarkAllAsRead,
3535
onMarkNotificationAsRead,
3636
})=>{
37+
const[isOpen,setIsOpen]=useState(defaultOpen);
38+
3739
return(
38-
<PopoverdefaultOpen={defaultOpen}>
40+
<Popoveropen={isOpen}onOpenChange={setIsOpen}>
3941
<PopoverTriggerasChild>
4042
<InboxButtonunreadCount={unreadCount}/>
4143
</PopoverTrigger>
@@ -61,7 +63,10 @@ export const InboxPopover: FC<InboxPopoverProps> = ({
6163
Mark all as read
6264
</Button>
6365
<Buttonvariant="outline"size="icon"asChild>
64-
<RouterLinkto="/settings/notifications">
66+
<RouterLink
67+
to="/settings/notifications"
68+
onClick={()=>setIsOpen(false)}
69+
>
6570
<SettingsIcon/>
6671
<spanclassName="sr-only">Notification settings</span>
6772
</RouterLink>

‎site/src/modules/notifications/NotificationsInbox/NotificationsInbox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type {
66
}from"api/typesGenerated";
77
import{displayError}from"components/GlobalSnackbar/utils";
88
import{useEffectEvent}from"hooks/hookPolyfills";
9-
import{typeFC,useEffect,useRef}from"react";
9+
import{typeFC,useEffect}from"react";
1010
import{useMutation,useQuery,useQueryClient}from"react-query";
1111
import{InboxPopover}from"./InboxPopover";
1212

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp