Skip to content
This repository was archived by the owner on Aug 30, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/react.useclaimnft.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const Component = () => {
return (
<button
disabled={isLoading}
onClick={() => claimNft({to: "0x...", quantity: 1})}
onClick={() => claimNft({ to: "0x...", quantity: 1 })}
>
Claim NFT!
</button>
Expand Down
6 changes: 3 additions & 3 deletions docs/react.usemintnft.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const Component = () => {
return (
<button
disabled={isLoading}
onClick={() => mintNft({ name: "My awesome NFT!" })}
onClick={() => mintNft({ name: "My awesome NFT!", to: "0x..." })}
>
Mint!
</button>
Expand All @@ -59,7 +59,7 @@ const Component = () => {

```jsx
const Component = () => {
const { contract } = useContract(<ContractAddress>);
const { contract } = useContract(<ContractAddress>);
const {
mutate: mintNft,
isLoading,
Expand All @@ -73,7 +73,7 @@ const Component = () => {
return (
<button
disabled={isLoading}
onClick={() => mintNft({ name: "My awesome NFT!" })}
onClick={() => mintNft({ name: "My awesome NFT!", to: "0x..." })}
>
Mint!
</button>
Expand Down
14 changes: 7 additions & 7 deletions docs/snippets.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
"subhooks": [
{
"name": "useMintNFT",
"example": "const Component = () => {\n const { contract } = useContract(<ContractAddress>);\n const {\n mutate: mintNft,\n isLoading,\n error,\n } = useMintNFT(contract?.nft);\n\n if (error) {\n console.error(\"failed to mint nft\", error);\n }\n\n return (\n <button\n disabled={isLoading}\n onClick={() => mintNft({ name: \"My awesome NFT!\" })}\n >\n Mint!\n </button>\n );\n};",
"example": "const Component = () => {\n const { contract } = useContract(<ContractAddress>);\n const {\n mutate: mintNft,\n isLoading,\n error,\n } = useMintNFT(contract?.nft);\n\n if (error) {\n console.error(\"failed to mint nft\", error);\n }\n\n return (\n <button\n disabled={isLoading}\n onClick={() => mintNft({ name: \"My awesome NFT!\", to: \"0x...\" })}\n >\n Mint!\n </button>\n );\n};",
"reference": "https://portal.thirdweb.com/react/react.usemintnft"
},
{
Expand Down Expand Up @@ -233,7 +233,7 @@
},
{
"name": "useClaimNFT",
"example": "const Component = () => {\n const {\n mutate: claimNft,\n isLoading,\n error,\n } = useClaimNFT(DropContract);\n\n if (error) {\n console.error(\"failed to claim nft\", error);\n }\n\n return (\n <button\n disabled={isLoading}\n onClick={() => claimNft({to: \"0x...\", quantity: 1})}\n >\n Claim NFT!\n </button>\n );\n};",
"example": "const Component = () => {\n const {\n mutate: claimNft,\n isLoading,\n error,\n } = useClaimNFT(DropContract);\n\n if (error) {\n console.error(\"failed to claim nft\", error);\n }\n\n return (\n <button\n disabled={isLoading}\n onClick={() => claimNft({ to: \"0x...\", quantity: 1 })}\n >\n Claim NFT!\n </button>\n );\n};",
"reference": "https://portal.thirdweb.com/react/react.useclaimnft"
},
{
Expand All @@ -243,7 +243,7 @@
},
{
"name": "useMintNFT",
"example": "const Component = () => {\n const { contract } = useContract(<ContractAddress>);\n const {\n mutate: mintNft,\n isLoading,\n error,\n } = useMintNFT(contract?.nft);\n\n if (error) {\n console.error(\"failed to mint nft\", error);\n }\n\n return (\n <button\n disabled={isLoading}\n onClick={() => mintNft({ name: \"My awesome NFT!\" })}\n >\n Mint!\n </button>\n );\n};",
"example": "const Component = () => {\n const { contract } = useContract(<ContractAddress>);\n const {\n mutate: mintNft,\n isLoading,\n error,\n } = useMintNFT(contract?.nft);\n\n if (error) {\n console.error(\"failed to mint nft\", error);\n }\n\n return (\n <button\n disabled={isLoading}\n onClick={() => mintNft({ name: \"My awesome NFT!\", to: \"0x...\" })}\n >\n Mint!\n </button>\n );\n};",
"reference": "https://portal.thirdweb.com/react/react.usemintnft"
},
{
Expand Down Expand Up @@ -353,7 +353,7 @@
"subhooks": [
{
"name": "useMintNFT",
"example": "const Component = () => {\n const { contract } = useContract(<ContractAddress>);\n const {\n mutate: mintNft,\n isLoading,\n error,\n } = useMintNFT(contract?.nft);\n\n if (error) {\n console.error(\"failed to mint nft\", error);\n }\n\n return (\n <button\n disabled={isLoading}\n onClick={() => mintNft({ name: \"My awesome NFT!\" })}\n >\n Mint!\n </button>\n );\n};",
"example": "const Component = () => {\n const { contract } = useContract(<ContractAddress>);\n const {\n mutate: mintNft,\n isLoading,\n error,\n } = useMintNFT(contract?.nft);\n\n if (error) {\n console.error(\"failed to mint nft\", error);\n }\n\n return (\n <button\n disabled={isLoading}\n onClick={() => mintNft({ name: \"My awesome NFT!\", to: \"0x...\" })}\n >\n Mint!\n </button>\n );\n};",
"reference": "https://portal.thirdweb.com/react/react.usemintnft"
},
{
Expand Down Expand Up @@ -418,7 +418,7 @@
},
{
"name": "useClaimNFT",
"example": "const Component = () => {\n const {\n mutate: claimNft,\n isLoading,\n error,\n } = useClaimNFT(DropContract);\n\n if (error) {\n console.error(\"failed to claim nft\", error);\n }\n\n return (\n <button\n disabled={isLoading}\n onClick={() => claimNft({to: \"0x...\", quantity: 1})}\n >\n Claim NFT!\n </button>\n );\n};",
"example": "const Component = () => {\n const {\n mutate: claimNft,\n isLoading,\n error,\n } = useClaimNFT(DropContract);\n\n if (error) {\n console.error(\"failed to claim nft\", error);\n }\n\n return (\n <button\n disabled={isLoading}\n onClick={() => claimNft({ to: \"0x...\", quantity: 1 })}\n >\n Claim NFT!\n </button>\n );\n};",
"reference": "https://portal.thirdweb.com/react/react.useclaimnft"
},
{
Expand All @@ -428,7 +428,7 @@
},
{
"name": "useMintNFT",
"example": "const Component = () => {\n const { contract } = useContract(<ContractAddress>);\n const {\n mutate: mintNft,\n isLoading,\n error,\n } = useMintNFT(contract?.nft);\n\n if (error) {\n console.error(\"failed to mint nft\", error);\n }\n\n return (\n <button\n disabled={isLoading}\n onClick={() => mintNft({ name: \"My awesome NFT!\" })}\n >\n Mint!\n </button>\n );\n};",
"example": "const Component = () => {\n const { contract } = useContract(<ContractAddress>);\n const {\n mutate: mintNft,\n isLoading,\n error,\n } = useMintNFT(contract?.nft);\n\n if (error) {\n console.error(\"failed to mint nft\", error);\n }\n\n return (\n <button\n disabled={isLoading}\n onClick={() => mintNft({ name: \"My awesome NFT!\", to: \"0x...\" })}\n >\n Mint!\n </button>\n );\n};",
"reference": "https://portal.thirdweb.com/react/react.usemintnft"
},
{
Expand Down Expand Up @@ -478,7 +478,7 @@
"subhooks": [
{
"name": "useMintNFT",
"example": "const Component = () => {\n const { contract } = useContract(<ContractAddress>);\n const {\n mutate: mintNft,\n isLoading,\n error,\n } = useMintNFT(contract?.nft);\n\n if (error) {\n console.error(\"failed to mint nft\", error);\n }\n\n return (\n <button\n disabled={isLoading}\n onClick={() => mintNft({ name: \"My awesome NFT!\" })}\n >\n Mint!\n </button>\n );\n};",
"example": "const Component = () => {\n const { contract } = useContract(<ContractAddress>);\n const {\n mutate: mintNft,\n isLoading,\n error,\n } = useMintNFT(contract?.nft);\n\n if (error) {\n console.error(\"failed to mint nft\", error);\n }\n\n return (\n <button\n disabled={isLoading}\n onClick={() => mintNft({ name: \"My awesome NFT!\", to: \"0x...\" })}\n >\n Mint!\n </button>\n );\n};",
"reference": "https://portal.thirdweb.com/react/react.usemintnft"
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/async/drop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export function useClaimedNFTSupply(contract: RequiredParam<DropContract>) {
* return (
* <button
* disabled={isLoading}
* onClick={() => claimNft({to: "0x...", quantity: 1})}
* onClick={() => claimNft({ to: "0x...", quantity: 1 })}
* >
* Claim NFT!
* </button>
Expand Down
6 changes: 3 additions & 3 deletions src/hooks/async/nft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ export function useNFTBalance<TContract extends NFTContract>(
* return (
* <button
* disabled={isLoading}
* onClick={() => mintNft({ name: "My awesome NFT!" })}
* onClick={() => mintNft({ name: "My awesome NFT!", to: "0x..." })}
* >
* Mint!
* </button>
Expand All @@ -371,7 +371,7 @@ export function useNFTBalance<TContract extends NFTContract>(
* @example
* ```jsx
* const Component = () => {
* const { contract } = useContract(<ContractAddress>);
* const { contract } = useContract(<ContractAddress>);
* const {
* mutate: mintNft,
* isLoading,
Expand All @@ -385,7 +385,7 @@ export function useNFTBalance<TContract extends NFTContract>(
* return (
* <button
* disabled={isLoading}
* onClick={() => mintNft({ name: "My awesome NFT!" })}
* onClick={() => mintNft({ name: "My awesome NFT!", to: "0x..." })}
* >
* Mint!
* </button>
Expand Down