diff --git a/app/[locale]/apps/[id]/crosschain-nft-bridge/components/Form.tsx b/app/[locale]/apps/[id]/crosschain-nft-bridge/components/Form.tsx index 82efd9e..90daaa6 100644 --- a/app/[locale]/apps/[id]/crosschain-nft-bridge/components/Form.tsx +++ b/app/[locale]/apps/[id]/crosschain-nft-bridge/components/Form.tsx @@ -32,7 +32,7 @@ export const Form = ({ const { watch, handleSubmit } = useFormContext() - const { bridge, isLoading } = useBridge({ + const { bridge, isLoading, status } = useBridge({ destinationChain, ERC721Address: watch('erc721Address'), ERC721TokenId: watch('erc721TokenId'), @@ -80,6 +80,11 @@ export const Form = ({ sourceChain={sourceChain} destinationChain={destinationChain} /> + {!isLoading && status === 'success' && ( +

+ Your ERC721 has been bridged successfully to {destinationChain.name}! +

+ )} ) } diff --git a/app/[locale]/apps/[id]/crosschain-nft-bridge/lib/hooks/useBridge.ts b/app/[locale]/apps/[id]/crosschain-nft-bridge/lib/hooks/useBridge.ts index d196c9a..669ac61 100644 --- a/app/[locale]/apps/[id]/crosschain-nft-bridge/lib/hooks/useBridge.ts +++ b/app/[locale]/apps/[id]/crosschain-nft-bridge/lib/hooks/useBridge.ts @@ -18,7 +18,7 @@ export const useBridge = ({ }: UseBridgeProps) => { const { config } = useNetwork() - const { writeAsync, isLoading, data } = useContractWrite({ + const { writeAsync, isLoading, data, status } = useContractWrite({ address: config.contracts.crosschainNFTBridgeContract .address as `0x${string}`, abi: BRIDGE_ABI, @@ -33,6 +33,7 @@ export const useBridge = ({ return { bridge: writeAsync, - isLoading: isLoading || isTransactionLoading + isLoading: isLoading || isTransactionLoading, + status } }