From 7a5215419de9ba63b59621ac8a98c1b250b16c96 Mon Sep 17 00:00:00 2001 From: Hancheng Zhou Date: Wed, 22 Mar 2023 15:27:05 +0800 Subject: [PATCH] fix: open solana nft detail (#9134) * feat: solana nft detail * fix: solana nft detail * fix: nft detail activity font size * fix: font size --- .../Collectible/src/SNSAdaptor/CardDialog/CardDialog.tsx | 2 +- .../Collectible/src/SNSAdaptor/DialogInspector.tsx | 5 +++-- .../Collectible/src/SNSAdaptor/Shared/ActivityCard.tsx | 1 + .../SNSAdaptor/components/FeedCard/ProfileLinkCard.tsx | 8 +++++--- packages/web3-hooks/base/src/useNonFungibleAsset.ts | 4 ++-- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/packages/plugins/Collectible/src/SNSAdaptor/CardDialog/CardDialog.tsx b/packages/plugins/Collectible/src/SNSAdaptor/CardDialog/CardDialog.tsx index f8aa327019f..ad211fdd9c9 100644 --- a/packages/plugins/Collectible/src/SNSAdaptor/CardDialog/CardDialog.tsx +++ b/packages/plugins/Collectible/src/SNSAdaptor/CardDialog/CardDialog.tsx @@ -44,7 +44,7 @@ export function CardDialog(props: CardDialogProps) { } if (pluginID === NetworkPluginID.PLUGIN_SOLANA) { - if (!tokenId) return null + if (!tokenAddress) return null } return ( diff --git a/packages/plugins/Collectible/src/SNSAdaptor/DialogInspector.tsx b/packages/plugins/Collectible/src/SNSAdaptor/DialogInspector.tsx index e853fe86cc6..e20ed00a751 100644 --- a/packages/plugins/Collectible/src/SNSAdaptor/DialogInspector.tsx +++ b/packages/plugins/Collectible/src/SNSAdaptor/DialogInspector.tsx @@ -43,8 +43,9 @@ export function DialogInspector(props: DialogInspectorProps) { if (!tokenAddress || !tokenId) return null } + // Solana NFT has no token id. if (pluginID === NetworkPluginID.PLUGIN_SOLANA) { - if (!tokenId) return null + if (!tokenAddress) return null } if (pluginID === NetworkPluginID.PLUGIN_FLOW) { @@ -58,7 +59,7 @@ export function DialogInspector(props: DialogInspectorProps) { parentPluginID, pluginID, chainId, - tokenId: tokenId!, + tokenId: tokenId ?? '0', tokenAddress: tokenAddress!, ownerAddress, origin: originType, diff --git a/packages/plugins/Collectible/src/SNSAdaptor/Shared/ActivityCard.tsx b/packages/plugins/Collectible/src/SNSAdaptor/Shared/ActivityCard.tsx index 2898b7ce0e0..ac92d09d4ec 100644 --- a/packages/plugins/Collectible/src/SNSAdaptor/Shared/ActivityCard.tsx +++ b/packages/plugins/Collectible/src/SNSAdaptor/Shared/ActivityCard.tsx @@ -57,6 +57,7 @@ const useStyles = makeStyles()((theme) => ({ }, textBase: { display: 'flex', + fontSize: 14, alignItems: 'center', whiteSpace: 'nowrap', lineHeight: '18px', diff --git a/packages/plugins/RSS3/src/SNSAdaptor/components/FeedCard/ProfileLinkCard.tsx b/packages/plugins/RSS3/src/SNSAdaptor/components/FeedCard/ProfileLinkCard.tsx index 317c7ead757..4053a2e0d73 100644 --- a/packages/plugins/RSS3/src/SNSAdaptor/components/FeedCard/ProfileLinkCard.tsx +++ b/packages/plugins/RSS3/src/SNSAdaptor/components/FeedCard/ProfileLinkCard.tsx @@ -14,6 +14,7 @@ import { Label } from './common.js' const useStyles = makeStyles()((theme, _, refs) => ({ summary: { color: theme.palette.maskColor.third, + fontSize: 14, display: 'flex', alignItems: 'center', }, @@ -39,6 +40,7 @@ const useStyles = makeStyles()((theme, _, refs) => ({ name: { color: theme.palette.maskColor.main, fontWeight: 700, + fontSize: 14, marginLeft: theme.spacing(1), }, image: { @@ -108,9 +110,9 @@ export const ProfileLinkCard: FC = ({ feed, className, ... context: feed.type, }} components={{ - user: