diff --git a/packages/vechain-kit/package.json b/packages/vechain-kit/package.json index 9d39aadd..a8741437 100644 --- a/packages/vechain-kit/package.json +++ b/packages/vechain-kit/package.json @@ -64,7 +64,7 @@ "@tanstack/react-query": "^5.64.2", "@tanstack/react-query-devtools": "^5.64.1", "@vechain/contract-getters": "1.3.0", - "@vechain/dapp-kit-react": "2.1.0-rc.5", + "@vechain/dapp-kit-react": "2.2.0", "@vechain/picasso": "^2.1.1", "@vechain/vechain-contract-types": "1.6.0-rc", "@wagmi/core": "^2.17.2", @@ -103,7 +103,7 @@ "@emotion/react": "^11.0.0", "@emotion/styled": "^11.0.0", "@tanstack/react-query": "^5.64.2", - "@vechain/dapp-kit-react": "2.1.0-rc.5", + "@vechain/dapp-kit-react": "2.2.0", "framer-motion": "^11.0.0", "react": "^18.0.0", "react-dom": "^18.0.0" 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?.(); - }} /> - +