Skip to content

Commit

Permalink
Merge pull request #25 from developmentseed/remove-linkprop-from-catalog
Browse files Browse the repository at this point in the history
Pass callback to handle routing for DataCatalog
  • Loading branch information
sandrahoang686 authored Dec 17, 2024
2 parents 88f3f75 + 1c98cf5 commit f3a04b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions app/(datasets)/data-catalog/catalog.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
'use client';
import React 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 = (path: string) => {
router.push(path);
};

return (
<CatalogView
datasets={datasets}
onFilterChanges={() => controlVars}
pathname={pathname}
linkProperties={{
LinkElement: Link,
pathAttributeKeyName: 'href',
}}
onCardNavigate={handleCardNavigation}
/>
);
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit f3a04b5

Please sign in to comment.