feat: remove account center with custom hook
This commit is contained in:
parent
5ef38cbc25
commit
650624adb0
|
@ -1,5 +1,5 @@
|
||||||
import { Avatar, Button } from '@status-im/components'
|
import { Avatar, Button } from '@status-im/components'
|
||||||
import { useConnectWallet } from '@web3-onboard/react'
|
import { useAccountCenter, useConnectWallet } from '@web3-onboard/react'
|
||||||
import { XStack } from 'tamagui'
|
import { XStack } from 'tamagui'
|
||||||
import { useDispatch } from 'react-redux'
|
import { useDispatch } from 'react-redux'
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ import { useEffect } from 'react'
|
||||||
|
|
||||||
const ConnectWallet = () => {
|
const ConnectWallet = () => {
|
||||||
const [{ wallet, connecting }, connect, disconnect] = useConnectWallet()
|
const [{ wallet, connecting }, connect, disconnect] = useConnectWallet()
|
||||||
|
const updateAccountCenter = useAccountCenter()
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -23,6 +24,7 @@ const ConnectWallet = () => {
|
||||||
disconnect(wallet)
|
disconnect(wallet)
|
||||||
} else {
|
} else {
|
||||||
connect()
|
connect()
|
||||||
|
updateAccountCenter({ enabled: false })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue