diff --git a/src/components/ui/menus/AccountDisplay/MenuItems.tsx b/src/components/ui/menus/AccountDisplay/MenuItems.tsx index cb6aaf826a..a34558f92c 100644 --- a/src/components/ui/menus/AccountDisplay/MenuItems.tsx +++ b/src/components/ui/menus/AccountDisplay/MenuItems.tsx @@ -2,17 +2,14 @@ import { MenuList } from '@chakra-ui/react'; import { Connect, Disconnect } from '@decent-org/fractal-ui'; import { useConnectModal } from '@rainbow-me/rainbowkit'; import { useTranslation } from 'react-i18next'; -import { useDisconnect } from 'wagmi'; -import { useFractal } from '../../../../providers/App/AppProvider'; +import { useDisconnect, useWalletClient } from 'wagmi'; import { MenuItemButton } from './MenuItemButton'; import { MenuItemNetwork } from './MenuItemNetwork'; import { MenuItemWallet } from './MenuItemWallet'; export function MenuItems() { - const { - readOnly: { user }, - } = useFractal(); const { disconnect } = useDisconnect(); + const { data: isConnected } = useWalletClient(); const { openConnectModal } = useConnectModal(); const { t } = useTranslation('menu'); return ( @@ -33,9 +30,9 @@ export function MenuItems() { }, }} > - {user.address && } + {isConnected && } - {!user.address && ( + {!isConnected && ( )} - {user.address && ( + {isConnected && (