diff --git a/.changeset/great-melons-tease.md b/.changeset/great-melons-tease.md new file mode 100644 index 000000000..b407b7b62 --- /dev/null +++ b/.changeset/great-melons-tease.md @@ -0,0 +1,5 @@ +--- +'@ant-design/web3': patch +--- + +fix: Use useToken from antd diff --git a/packages/web3/src/nft-card/NFTCard.tsx b/packages/web3/src/nft-card/NFTCard.tsx index 007929731..5d248a2f4 100644 --- a/packages/web3/src/nft-card/NFTCard.tsx +++ b/packages/web3/src/nft-card/NFTCard.tsx @@ -8,8 +8,7 @@ import { type Web3ConfigProviderProps, } from '@ant-design/web3-common'; import type { ImageProps } from 'antd'; -import { Button, ConfigProvider, Divider, Image, Skeleton, Space } from 'antd'; -import useToken from 'antd/es/theme/useToken'; +import { Button, ConfigProvider, Divider, Image, Skeleton, Space, theme } from 'antd'; import classNames from 'classnames'; import { CryptoPrice, type CryptoPriceProps } from '../crypto-price'; @@ -22,6 +21,8 @@ import { useStyle } from './style'; const customizePrefixCls = 'ant-nft-card'; +const { useToken } = theme; + interface NFTCardProps { address?: string; tokenId?: number | bigint; @@ -83,7 +84,7 @@ const NFTCard: React.FC = ({ ...metadataProps }) => { const { liked, totalLikes = 0, onLikeChange } = likeConfig || {}; - const [, token] = useToken(); + const { token } = useToken(); const { metadata, loading } = useNFT(address, parseNumberToBigint(tokenId), getNFTMetadata); const { name = metadata.name,