diff --git a/pages/contracts/badgeHub/execute.tsx b/pages/contracts/badgeHub/execute.tsx index 79f0792..efce7e3 100644 --- a/pages/contracts/badgeHub/execute.tsx +++ b/pages/contracts/badgeHub/execute.tsx @@ -24,7 +24,7 @@ import { QRCodeCanvas } from 'qrcode.react' import type { FormEvent } from 'react' import { useEffect, useMemo, useRef, useState } from 'react' import { toast } from 'react-hot-toast' -import { FaArrowRight } from 'react-icons/fa' +import { FaArrowRight, FaCopy, FaSave } from 'react-icons/fa' import { useMutation } from 'react-query' import * as secp256k1 from 'secp256k1' import { NETWORK } from 'utils/constants' @@ -308,6 +308,14 @@ const BadgeHubExecutePage: NextPage = () => { }) } + // copy claim url to clipboard + const copyClaimURL = async () => { + const baseURL = NETWORK === 'testnet' ? 'https://badges.publicawesome.dev' : 'https://badges.stargaze.zone' + const claimURL = `${baseURL}/?id=${createdBadgeId as string}&key=${createdBadgeKey as string}` + await navigator.clipboard.writeText(claimURL) + toast.success('Copied claim URL to clipboard') + } + const router = useRouter() useEffect(() => { @@ -347,9 +355,25 @@ const BadgeHubExecutePage: NextPage = () => { }/?id=${createdBadgeId}&key=${createdBadgeKey}`} /> - + {/*
*/} +
+ + +
)}
@@ -361,6 +385,7 @@ const BadgeHubExecutePage: NextPage = () => { {showBadgeField && } {showMetadataField && (
+ Metadata @@ -380,28 +405,8 @@ const BadgeHubExecutePage: NextPage = () => {
)} - - - - setTimestamp(date)} value={timestamp} /> - - - {showBadgeField && } - {showBadgeField && ( -
- -
- )} - {/* TODO: Fix address execute message */} +