11import type { IconName } from '@fortawesome/fontawesome-svg-core' ;
22import React , { Suspense } from 'react' ;
3- import { Breadcrumbs , Button , GridList , Item , Link , Menu , MenuTrigger , Popover } from 'react-aria-components' ;
3+ import { Breadcrumb , Breadcrumbs , Button , GridList , GridListItem , Link , Menu , MenuTrigger , Popover } from 'react-aria-components' ;
44import { LoaderFunction , NavLink , Route , Routes , useFetcher , useLoaderData , useNavigate , useParams } from 'react-router-dom' ;
55
66import * as models from '../../models' ;
@@ -112,8 +112,8 @@ const MockServerRoute = () => {
112112 renderPageSidebar = {
113113 < div className = "flex flex-1 flex-col overflow-hidden divide-solid divide-y divide-[--hl-md]" >
114114 < div className = "flex flex-col items-start gap-2 justify-between p-[--padding-sm]" >
115- < Breadcrumbs className = 'react-aria-Breadcrumbs pb-[--padding-sm] border-b border-solid border-[--hl-sm] font-bold w-full' >
116- < Item className = "react-aria-Item h-full outline-none data-[focused]:outline-none" >
115+ < Breadcrumbs className = 'flex flex-wrap list-none items-center m-0 p-0 gap-2 pb-[--padding-sm] border-b border-solid border-[--hl-sm] font-bold w-full' >
116+ < Breadcrumb className = "flex select-none items-center gap-2 text-[--color-font] h-full outline-none data-[focused]:outline-none" >
117117 < Link data-testid = "project" className = "px-1 py-1 aspect-square h-7 flex flex-shrink-0 outline-none data-[focused]:outline-none items-center justify-center gap-2 aria-pressed:bg-[--hl-sm] rounded-sm text-[--color-font] hover:bg-[--hl-xs] focus:ring-inset ring-1 ring-transparent focus:ring-[--hl-md] transition-all text-sm" >
118118 < NavLink
119119 to = { `/organization/${ organizationId } /project/${ projectId } ` }
@@ -122,10 +122,10 @@ const MockServerRoute = () => {
122122 </ NavLink >
123123 </ Link >
124124 < span aria-hidden role = "separator" className = 'text-[--hl-lg] h-4 outline outline-1' />
125- </ Item >
126- < Item className = "react-aria-Item h-full outline-none data-[focused]:outline-none" >
125+ </ Breadcrumb >
126+ < Breadcrumb className = "flex select-none items-center gap-2 text-[--color-font] h-full outline-none data-[focused]:outline-none" >
127127 < WorkspaceDropdown />
128- </ Item >
128+ </ Breadcrumb >
129129 </ Breadcrumbs >
130130 </ div >
131131 < div className = "p-[--padding-sm]" >
@@ -171,7 +171,7 @@ const MockServerRoute = () => {
171171 >
172172 { item => {
173173 return (
174- < Item
174+ < GridListItem
175175 key = { item . _id }
176176 id = { item . _id }
177177 textValue = { item . name }
@@ -199,7 +199,12 @@ const MockServerRoute = () => {
199199 value = { item . name }
200200 name = "name"
201201 ariaLabel = "Mock route name"
202- onChange = { name => {
202+ onSingleClick = { ( ) => {
203+ navigate ( {
204+ pathname : `/organization/${ organizationId } /project/${ projectId } /workspace/${ workspaceId } /mock-server/mock-route/${ item . _id } ` ,
205+ } ) ;
206+ } }
207+ onSubmit = { name => {
203208 name && fetcher . submit (
204209 { name } ,
205210 {
@@ -231,21 +236,21 @@ const MockServerRoute = () => {
231236 className = "border select-none text-sm min-w-max border-solid border-[--hl-sm] shadow-lg bg-[--color-bg] py-2 rounded-md overflow-y-auto max-h-[85vh] focus:outline-none"
232237 >
233238 { item => (
234- < Item
239+ < Breadcrumb
235240 key = { item . id }
236241 id = { item . id }
237242 className = "flex gap-2 px-[--padding-md] aria-selected:font-bold items-center text-[--color-font] h-[--line-height-xs] w-full text-md whitespace-nowrap bg-transparent hover:bg-[--hl-sm] disabled:cursor-not-allowed focus:bg-[--hl-xs] focus:outline-none transition-colors"
238243 aria-label = { item . name }
239244 >
240245 < Icon icon = { item . icon } />
241246 < span > { item . name } </ span >
242- </ Item >
247+ </ Breadcrumb >
243248 ) }
244249 </ Menu >
245250 </ Popover >
246251 </ MenuTrigger >
247252 </ div >
248- </ Item >
253+ </ GridListItem >
249254 ) ;
250255 } }
251256 </ GridList >
0 commit comments