forked from thirdweb-example/nft-staking-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mint.tsx
39 lines (34 loc) · 1.09 KB
/
mint.tsx
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
import { Web3Button } from "@thirdweb-dev/react";
import type { NextPage } from "next";
import { useRouter } from "next/router";
import styles from "../styles/Home.module.css";
const Mint: NextPage = () => {
const router = useRouter();
return (
<div className={styles.container}>
<h1 className={styles.h1}>Mint An NFT!</h1>
<p className={styles.explain}>
Here is where we use our <b>NFT Drop</b> contract to allow users to mint
one of the NFTs that we lazy minted.
</p>
<hr className={`${styles.smallDivider} ${styles.detailPageHr}`} />
<Web3Button
colorMode="dark"
accentColor="#5204BF"
contractAddress="0x322067594DBCE69A9a9711BC393440aA5e3Aaca1"
action={(contract) => contract.erc721.claim(1)}
onSuccess={() => {
alert("NFT Claimed!");
router.push(`/stake`);
}}
onError={(error) => {
console.error(error);
alert(error);
}}
>
Claim An NFT
</Web3Button>
</div>
);
};
export default Mint;