Skip to content

Commit

Permalink
feat: chain navigation from dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
0xtiti committed Jul 19, 2024
1 parent a7d4007 commit 7e85a23
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/Table.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useTranslation } from 'next-i18next';
import { useRouter } from 'next/router';

import { EcosystemChainData } from '~/types';

Expand All @@ -8,6 +9,11 @@ interface TableProps {

export const Table = ({ chains }: TableProps) => {
const { t } = useTranslation();
const router = useRouter();

const handleChainNavigation = (id: number) => {
router.push(`/${id}`);
};

return (
<table>
Expand All @@ -21,7 +27,7 @@ export const Table = ({ chains }: TableProps) => {

{chains?.map((data, index) => {
return (
<tr key={index}>
<tr key={index} onClick={() => handleChainNavigation(data.id)}>
<td>{data.name}</td>
<td>{data.id}</td>
<td>{data.nativeToken}</td>
Expand Down

0 comments on commit 7e85a23

Please sign in to comment.