/
Collection.js
41 lines (35 loc) · 1.16 KB
/
Collection.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { useHistory, useParams } from "react-router-dom";
import "@covalenthq/goldrush-kit/styles.css";
import {
GoldRushProvider,
NFTCollectionTokenListView
} from "@covalenthq/goldrush-kit";
export default function Collection() {
const params = useParams();
const { network, address } = params;
const history = useHistory();
console.log(network, address)
const handleClick = (e) => {
history.push(`/analytics/${network}/${address}/${e.nft_data.token_id}`);
}
const handleGoBack = () => {
history.goBack();
}
return (
<div>
<div className="container mt-5">
<button className="btn btn-outline-light" onClick={handleGoBack}>Go Back</button>
<br /><br />
<GoldRushProvider apikey={process.env.REACT_APP_COVALENT_API_KEY} mode="dark" color="emerald">
<NFTCollectionTokenListView
chain_name={network}
collection_address={address}
on_nft_click={(e) => {
handleClick(e)
}}
/>
</GoldRushProvider>
</div>
</div>
)
}