Skip to content

Commit

Permalink
fix: feedback message
Browse files Browse the repository at this point in the history
  • Loading branch information
wellitongervickas committed Dec 9, 2023
1 parent 9383d43 commit 2948a18
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down Expand Up @@ -80,6 +80,11 @@ export const Form = ({
sourceChain={sourceChain}
destinationChain={destinationChain}
/>
{!isLoading && status === 'success' && (
<p className='text-green-500'>
Your ERC721 has been bridged successfully to {destinationChain.name}!
</p>
)}
</form>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -33,6 +33,7 @@ export const useBridge = ({

return {
bridge: writeAsync,
isLoading: isLoading || isTransactionLoading
isLoading: isLoading || isTransactionLoading,
status
}
}

0 comments on commit 2948a18

Please sign in to comment.