feat: set is wallet connected

This commit is contained in:
RadoslavDimchev 2023-10-02 17:31:03 +03:00
parent f1458124a7
commit efae345225
1 changed files with 13 additions and 1 deletions

View File

@ -1,10 +1,22 @@
import { Avatar, Button } from '@status-im/components'
import { useConnectWallet } from '@web3-onboard/react'
import { XStack } from 'tamagui'
import { ethers } from 'ethers'
import { useDispatch } from 'react-redux'
import { setIsWalletConnected } from '../../../redux/ValidatorOnboarding/Deposit/slice'
import { useEffect } from 'react'
const ConnectWallet = () => {
const [{ wallet, connecting }, connect, disconnect] = useConnectWallet()
const dispatch = useDispatch()
useEffect(() => {
if (wallet) {
dispatch(setIsWalletConnected(true))
} else {
dispatch(setIsWalletConnected(false))
}
}, [wallet])
const onConnectWalletClick = () => {
if (wallet) {