File tree 2 files changed +8
-5
lines changed
2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import { FileCheck2, FileBadge } from "lucide-react";
17
17
import { get_evm_contracts } from "@/graphql/queries" ;
18
18
import { Contract } from "@/graphql/types" ;
19
19
import PaginationControls from "@/components/PaginationControls" ;
20
+ import { useSearchParams } from "next/navigation" ;
20
21
21
22
function EvmContracts ( ) {
22
23
const accounts = [
@@ -57,7 +58,6 @@ function EvmContracts() {
57
58
// img: <FileCheck2 size={30} color="#00A4E5" />,
58
59
// },
59
60
] ;
60
-
61
61
const result = get_evm_contracts ( ) ;
62
62
let [ page , setPage ] = useState ( 1 ) ;
63
63
let data : Contract [ ] ;
@@ -71,11 +71,15 @@ function EvmContracts() {
71
71
case "ok" :
72
72
data = result . data ;
73
73
}
74
+ let filter = useSearchParams ( ) . get ( "filter" ) ;
75
+ if ( filter ) {
76
+ data = data . filter ( ( x ) => x . type == filter ) ;
77
+ }
74
78
accounts [ 0 ] . value = data . length ;
75
79
return (
76
80
< div className = "px-4 sm:px-20 md:px-40 lg:px-40 mt-6" >
77
81
< 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 >
79
83
< > </ >
80
84
</ div >
81
85
< section className = "flex flex-wrap justify-between" >
@@ -119,7 +123,6 @@ function EvmContracts() {
119
123
< Card >
120
124
< CardFooter >
121
125
< PaginationControls
122
- persistent
123
126
max = { data . length / 20 }
124
127
currentPage = { page }
125
128
onPageChange = { setPage }
Original file line number Diff line number Diff line change @@ -50,8 +50,8 @@ const explorer_nav_items = [
50
50
dropdown : [
51
51
// { item: "Transactions", link: "/evm/transactions" },
52
52
{ 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 " } ,
55
55
] ,
56
56
} ,
57
57
{
You can’t perform that action at this time.
0 commit comments