@@ -21,6 +21,7 @@ import type { Permissions } from "contexts/auth/permissions";
21
21
import { ChevronDown , Plus } from "lucide-react" ;
22
22
import { useDashboard } from "modules/dashboard/useDashboard" ;
23
23
import { type FC , useState } from "react" ;
24
+ import { useNavigate } from "react-router-dom" ;
24
25
import { Link } from "react-router-dom" ;
25
26
26
27
export interface OrganizationWithPermissions extends Organization {
@@ -87,6 +88,7 @@ const OrganizationsSettingsNavigation: FC<
87
88
}
88
89
89
90
const [ isPopoverOpen , setIsPopoverOpen ] = useState ( false ) ;
91
+ const navigate = useNavigate ( ) ;
90
92
91
93
return (
92
94
< >
@@ -114,33 +116,30 @@ const OrganizationsSettingsNavigation: FC<
114
116
</ PopoverTrigger >
115
117
< PopoverContent align = "start" className = "w-60" >
116
118
< Command >
119
+ { /* <button type="button" className="sr-only" /> */ }
117
120
< CommandList >
118
121
< CommandGroup className = "pb-2" >
119
122
{ organizations . length > 1 && (
120
123
< div className = "flex flex-col max-h-[260px] overflow-y-auto" >
121
124
{ organizations . map ( ( organization ) => (
122
- < Link
125
+ < CommandItem
123
126
key = { organization . id }
124
- to = { urlForSubpage ( organization . name ) }
125
- // Setting width to 215px so that outline is visible
126
- className = "w-[215px] ml-1 no-underline visited:text-content-secondary text-content-secondary"
127
+ value = { organization . name }
128
+ onSelect = { ( ) => {
129
+ setIsPopoverOpen ( false ) ;
130
+ navigate ( urlForSubpage ( organization . name ) ) ;
131
+ } }
132
+ tabIndex = { 0 }
127
133
>
128
- < CommandItem
129
- value = { organization . name }
130
- onSelect = { ( ) => {
131
- setIsPopoverOpen ( false ) ;
132
- } }
133
- >
134
- < Avatar
135
- size = "sm"
136
- src = { organization . icon }
137
- fallback = { organization . display_name }
138
- />
139
- < span className = "truncate" >
140
- { organization ?. display_name || organization ?. name }
141
- </ span >
142
- </ CommandItem >
143
- </ Link >
134
+ < Avatar
135
+ size = "sm"
136
+ src = { organization . icon }
137
+ fallback = { organization . display_name }
138
+ />
139
+ < span className = "truncate" >
140
+ { organization ?. display_name || organization ?. name }
141
+ </ span >
142
+ </ CommandItem >
144
143
) ) }
145
144
</ div >
146
145
) }
@@ -149,7 +148,7 @@ const OrganizationsSettingsNavigation: FC<
149
148
{ organizations . length > 1 && (
150
149
< hr className = "h-px my-2 border-none bg-border -mx-2" />
151
150
) }
152
- < Button variant = "subtle" className = "w-full h-8" >
151
+ < Button asChild variant = "subtle" className = "w-full h-8" >
153
152
< a
154
153
href = "/organizations/new"
155
154
className = "flex items-center gap-1 no-underline text-content-secondary hover:text-content-primary visited:text-content-secondary"
0 commit comments