diff --git a/packages/vechain-kit/src/components/AccountModal/Components/AccountSelector.tsx b/packages/vechain-kit/src/components/AccountModal/Components/AccountSelector.tsx index 7227b08a..0775975a 100644 --- a/packages/vechain-kit/src/components/AccountModal/Components/AccountSelector.tsx +++ b/packages/vechain-kit/src/components/AccountModal/Components/AccountSelector.tsx @@ -21,7 +21,7 @@ import { AccountAvatar } from '@/components/common'; import { useState } from 'react'; import { AccountModalContentTypes } from '../Types/Types'; import { useTranslation } from 'react-i18next'; -import { useWallet, useSwitchWallet, useDAppKitWallet } from '@/hooks'; +import { useSwitchWallet } from '@/hooks'; type Props = { wallet: Wallet; @@ -45,9 +45,8 @@ export const AccountSelector = ({ style, }: Props) => { const { t } = useTranslation(); - const { connection } = useWallet(); - const { switchWallet, isSwitching, isInAppBrowser } = useSwitchWallet(); - const { isSwitchWalletEnabled } = useDAppKitWallet(); + const { switchWallet, isSwitching, isInAppBrowser, canSwitchWallet } = + useSwitchWallet(); const [copied, setCopied] = useState(false); @@ -125,9 +124,7 @@ export const AccountSelector = ({ - {(connection.isInAppBrowser && isSwitchWalletEnabled) || - (!connection.isInAppBrowser && - connection.isConnectedWithDappKit) ? ( + {canSwitchWallet ? ( } diff --git a/packages/vechain-kit/src/components/AccountModal/Contents/Profile/Components/ProfileCard/ProfileCard.tsx b/packages/vechain-kit/src/components/AccountModal/Contents/Profile/Components/ProfileCard/ProfileCard.tsx index a26215e2..b091251e 100644 --- a/packages/vechain-kit/src/components/AccountModal/Contents/Profile/Components/ProfileCard/ProfileCard.tsx +++ b/packages/vechain-kit/src/components/AccountModal/Contents/Profile/Components/ProfileCard/ProfileCard.tsx @@ -18,7 +18,6 @@ import { AccountModalContentTypes } from '@/components/AccountModal/Types'; export type ProfileCardProps = { address: string; onEditClick?: () => void; - onLogout?: () => void; showHeader?: boolean; showLinks?: boolean; showDescription?: boolean; @@ -39,7 +38,6 @@ export const ProfileCard = ({ showDisplayName = true, reserveNameDescriptionSpace = false, setCurrentContent, - onLogout, }: ProfileCardProps) => { const { network } = useVeChainKitConfig(); @@ -209,7 +207,6 @@ export const ProfileCard = ({ )} { const { t } = useTranslation(); - const { account, disconnect, connection } = useWallet(); - const { switchWallet, isSwitching, isInAppBrowser } = useSwitchWallet(); - const { isSwitchWalletEnabled } = useDAppKitWallet(); + const { account, disconnect } = useWallet(); + const { switchWallet, isSwitching, isInAppBrowser, canSwitchWallet } = + useSwitchWallet(); const { hasAnyBalance, formattedBalance } = useTotalBalance({ address: account?.address, }); @@ -110,18 +109,14 @@ export const ProfileContent = ({ address={account?.address ?? ''} showHeader={false} setCurrentContent={setCurrentContent} - onLogout={() => { - disconnect(); - onLogoutSuccess?.(); - }} /> - +