From d30698fc7892f4b452f0ad0e130e5fb6caf7791a Mon Sep 17 00:00:00 2001 From: Sandra Hoang Date: Sun, 15 Dec 2024 18:36:53 -0500 Subject: [PATCH 1/3] pass nav callback to catalogview --- app/(datasets)/data-catalog/catalog.tsx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/app/(datasets)/data-catalog/catalog.tsx b/app/(datasets)/data-catalog/catalog.tsx index 8e0c50f..bd7a544 100644 --- a/app/(datasets)/data-catalog/catalog.tsx +++ b/app/(datasets)/data-catalog/catalog.tsx @@ -1,22 +1,21 @@ 'use client'; -import React from 'react'; +import React, { useCallback } from 'react'; import { CatalogView, useFiltersWithQS } from '@lib'; -import { usePathname } from 'next/navigation'; -import Link from 'next/link'; +import { useRouter } from 'next/navigation'; export default function Catalog({ datasets }: { datasets: any }) { - const pathname = usePathname(); const controlVars = useFiltersWithQS(); + const router = useRouter(); + + const handleCardNavigation = useCallback((path: string) => { + router.push(path); + }, [router]); return ( controlVars} - pathname={pathname} - linkProperties={{ - LinkElement: Link, - pathAttributeKeyName: 'href', - }} + onCardNavigate={handleCardNavigation} /> ); } From 42e2d163fb01e5fdcff1e3f07d3d487ce2502ebf Mon Sep 17 00:00:00 2001 From: Sandra Hoang Date: Sun, 15 Dec 2024 23:52:53 -0500 Subject: [PATCH 2/3] bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3c9e1c9..32ab384 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "fix": "yarn run format && yarn run lint:fix" }, "dependencies": { - "@developmentseed/veda-ui": "v5.11.3-ph-a", + "@developmentseed/veda-ui": "v5.11.3-alpha.0", "@devseed-ui/theme-provider": "^4.1.0", "@tailwindcss/postcss": "4.0.0-alpha.13", "@types/node": "20.11.17", From 1c98cf55533e26be5d59d885c2af4734c8891b00 Mon Sep 17 00:00:00 2001 From: Sandra Hoang Date: Mon, 16 Dec 2024 01:26:12 -0500 Subject: [PATCH 3/3] remove unneeded memoization --- app/(datasets)/data-catalog/catalog.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/(datasets)/data-catalog/catalog.tsx b/app/(datasets)/data-catalog/catalog.tsx index bd7a544..6399cae 100644 --- a/app/(datasets)/data-catalog/catalog.tsx +++ b/app/(datasets)/data-catalog/catalog.tsx @@ -1,5 +1,5 @@ 'use client'; -import React, { useCallback } from 'react'; +import React from 'react'; import { CatalogView, useFiltersWithQS } from '@lib'; import { useRouter } from 'next/navigation'; @@ -7,9 +7,9 @@ export default function Catalog({ datasets }: { datasets: any }) { const controlVars = useFiltersWithQS(); const router = useRouter(); - const handleCardNavigation = useCallback((path: string) => { + const handleCardNavigation = (path: string) => { router.push(path); - }, [router]); + }; return (