Skip to content

Commit 2d73331

Browse files
committed
pages for others
1 parent 2d1da41 commit 2d73331

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/app/evm/contracts/page.tsx

+6-3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { FileCheck2, FileBadge } from "lucide-react";
1717
import { get_evm_contracts } from "@/graphql/queries";
1818
import { Contract } from "@/graphql/types";
1919
import PaginationControls from "@/components/PaginationControls";
20+
import { useSearchParams } from "next/navigation";
2021

2122
function EvmContracts() {
2223
const accounts = [
@@ -57,7 +58,6 @@ function EvmContracts() {
5758
// img: <FileCheck2 size={30} color="#00A4E5" />,
5859
// },
5960
];
60-
6161
const result = get_evm_contracts();
6262
let [page, setPage] = useState(1);
6363
let data: Contract[];
@@ -71,11 +71,15 @@ function EvmContracts() {
7171
case "ok":
7272
data = result.data;
7373
}
74+
let filter = useSearchParams().get("filter");
75+
if (filter) {
76+
data = data.filter((x) => x.type == filter);
77+
}
7478
accounts[0].value = data.length;
7579
return (
7680
<div className="px-4 sm:px-20 md:px-40 lg:px-40 mt-6">
7781
<div className="flex items-center justify-between mb-6">
78-
<p className="text-xl w-80">EVM Contracts</p>
82+
<p className="text-xl w-80">{filter ?? "EVM"} Contracts</p>
7983
<></>
8084
</div>
8185
<section className="flex flex-wrap justify-between">
@@ -119,7 +123,6 @@ function EvmContracts() {
119123
<Card>
120124
<CardFooter>
121125
<PaginationControls
122-
persistent
123126
max={data.length / 20}
124127
currentPage={page}
125128
onPageChange={setPage}

src/components/ExplorerNav.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ const explorer_nav_items = [
5050
dropdown: [
5151
// { item: "Transactions", link: "/evm/transactions" },
5252
{ item: "Contracts", link: "/evm/contracts" },
53-
// { item: "ERC-20 Tokens", link: "/evm/erc20" },
54-
// { item: "ERC-721 Tokens", link: "/evm/erc721" },
53+
{ item: "ERC-20 Tokens", link: "/evm/contracts?filter=ERC20" },
54+
{ item: "ERC-721 Tokens", link: "/evm/contracts?filter=ERC721" },
5555
],
5656
},
5757
{

0 commit comments

Comments
 (0)