Skip to content

Commit 3c50597

Browse files
committed
[Update] Open contract links in new tab instead of router navigation (#4415)
<!-- start pr-codex --> ## PR-Codex overview This PR removes the usage of `useRouter` from `contract-table` component and updates the onClick behavior to always open links in a new tab. ### Detailed summary - Removed `useRouter` import - Updated onClick behavior to open links in a new tab > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 297876c commit 3c50597

File tree

1 file changed

+2
-10
lines changed
  • apps/dashboard/src/components/contract-components/contract-table

1 file changed

+2
-10
lines changed

apps/dashboard/src/components/contract-components/contract-table/index.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Spinner, Table, Tbody, Td, Th, Thead, Tr } from "@chakra-ui/react";
2-
import { useRouter } from "next/router";
32
import { useMemo } from "react";
43
import { type Column, type Row, useTable } from "react-table";
54
import { Text } from "tw-components";
@@ -111,8 +110,6 @@ interface TableRowProps {
111110
}
112111

113112
const TableRow: React.FC<TableRowProps> = ({ row, context }) => {
114-
const router = useRouter();
115-
116113
return (
117114
<Tr
118115
borderBottomWidth={1}
@@ -127,13 +124,8 @@ const TableRow: React.FC<TableRowProps> = ({ row, context }) => {
127124
}}
128125
pointerEvents={row?.original?.contractId ? "auto" : "none"}
129126
onClick={() => {
130-
router.push(
131-
actionUrlPath(context, row.original.contractId),
132-
undefined,
133-
{
134-
scroll: true,
135-
},
136-
);
127+
// always open in new tab
128+
window.open(actionUrlPath(context, row.original.contractId));
137129
}}
138130
{...row.getRowProps()}
139131
>

0 commit comments

Comments
 (0)