diff --git a/src/Deed.tsx b/src/Deed.tsx index 1f674d3..106af05 100644 --- a/src/Deed.tsx +++ b/src/Deed.tsx @@ -1,6 +1,12 @@ import { Button, Card, Typography } from "@ensdomains/thorin"; import { type Address, type Hex, encodeFunctionData, formatEther, getAddress } from "viem"; -import { useAccount, useEnsName, usePrepareTransactionRequest, useSendTransaction, useWaitForTransactionReceipt } from "wagmi"; +import { + useAccount, + useEnsName, + usePrepareTransactionRequest, + useSendTransaction, + useWaitForTransactionReceipt, +} from "wagmi"; import { registrarAbi } from "./abis/registrar"; import { REGISTRAR_ADDRESS } from "./constants"; @@ -33,7 +39,7 @@ export const DeedComponent = ({ id, name, value, owner, isExact }: Props) => { const { sendTransaction, isPending, data: hash } = useSendTransaction(); - const { data: transactionReceipt } = useWaitForTransactionReceipt({ hash }) + const { data: transactionReceipt } = useWaitForTransactionReceipt({ hash }); const claim = () => preparedRequest && sendTransaction({ ...preparedRequest, to: REGISTRAR_ADDRESS }); @@ -45,17 +51,19 @@ export const DeedComponent = ({ id, name, value, owner, isExact }: Props) => { if (!isMatchingOwner) return { disabled: true, children: "Cannot claim" } as const; if (isPrepareLoading) return { disabled: true, children: "Preparing", loading: true } as const; - if (!preparedRequest) return { disabled: false, children: "Prepare", onClick: () => refetch(), colorStyle: "accentSecondary" } as const; + if (!preparedRequest) + return { disabled: false, children: "Prepare", onClick: () => refetch(), colorStyle: "accentSecondary" } as const; if (isPending) return { disabled: true, children: "Waiting for wallet", loading: true } as const; if (transactionReceipt) { - if (transactionReceipt.status === 'reverted') return { disabled: false, children: "Try again", onClick: () => claim(), colorStyle: "redPrimary" } as const; + if (transactionReceipt.status === "reverted") + return { disabled: false, children: "Try again", onClick: () => claim(), colorStyle: "redPrimary" } as const; return { disabled: true, children: "Claimed" } as const; } if (hash) return { disabled: true, children: "Claiming", loading: true } as const; return { disabled: false, children: "Claim", onClick: () => claim(), colorStyle: "accentPrimary" } as const; - })() + })(); return (