1
0
mirror of https://github.com/kremalicious/blog.git synced 2025-02-14 21:10:25 +01:00

network switching

This commit is contained in:
Matthias Kretschmann 2023-11-01 15:37:49 +00:00
parent 2f98598ab9
commit e74c1d7cb5
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -1,4 +1,4 @@
import { type ReactElement, useState } from 'react'
import { type ReactElement, useState, useEffect } from 'react'
import { useDebounce } from 'use-debounce'
import { useAccount } from 'wagmi'
import { ConnectButton } from '@rainbow-me/rainbowkit'
@ -24,6 +24,11 @@ export default function Web3Form(): ReactElement {
const isDisabled = !account
useEffect(() => {
if (!selectedToken) return
setAmount('')
}, [selectedToken])
return (
<form
className={styles.web3}