11import { SUPPORTED_CHAINS } from '@/config' ;
2- import { createFileRoute , useLocation } from '@tanstack/react-router' ;
2+ import { createFileRoute , useSearch } from '@tanstack/react-router' ;
33import { AppsPreviewTable } from '@/modules/apps/AppsPreviewTable' ;
44import { DatasetsPreviewTable } from '@/modules/datasets/DatasetsPreviewTable' ;
55import { DealsPreviewTable } from '@/modules/deals/DealsPreviewTable' ;
@@ -14,9 +14,9 @@ export const Route = createFileRoute('/$chainSlug/_layout/')({
1414
1515function Index ( ) {
1616 const { chainId } = useUserStore ( ) ;
17- const location = useLocation ( ) ;
17+ const search = useSearch ( { from : '/$chainSlug/_layout/' } ) ;
1818
19- const forwardedSearch = location . state ?. forwardedSearch ;
19+ const initialSearch = search ?. search ;
2020
2121 const currentChain = SUPPORTED_CHAINS . find ( ( chain ) => chain . id === chainId ) ;
2222
@@ -26,7 +26,7 @@ function Index() {
2626 < h1 className = "mb-2 text-lg font-extrabold md:text-2xl" >
2727 The iExec Protocol Explorer
2828 </ h1 >
29- < SearcherBar initialSearch = { forwardedSearch } />
29+ < SearcherBar initialSearch = { initialSearch } />
3030 < div className = "absolute inset-0 -z-10 hidden blur-2xl sm:block sm:blur-[100px] lg:blur-[150px]" >
3131 < div
3232 className = "absolute top-1/2 -right-1/4 aspect-[23/30] w-1/2 rounded-full xl:-right-1/5"
@@ -43,7 +43,7 @@ function Index() {
4343 < TasksPreviewTable className = "lg:col-span-5" />
4444 < AppsPreviewTable className = "lg:col-span-4" />
4545 < DatasetsPreviewTable className = "lg:col-span-4" />
46- < WorkerpoolsPreviewTable className = "lg:col-span-4" /> { ' ' }
46+ < WorkerpoolsPreviewTable className = "lg:col-span-4" />
4747 </ div >
4848 </ div >
4949 ) ;
0 commit comments