Skip to content

Commit

Permalink
fix: open solana nft detail (#9134)
Browse files Browse the repository at this point in the history
* feat: solana nft detail

* fix: solana nft detail

* fix: nft detail activity font size

* fix: font size
  • Loading branch information
zhouhanseng committed Mar 22, 2023
1 parent 1b810e2 commit 7a52154
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
Expand Up @@ -44,7 +44,7 @@ export function CardDialog(props: CardDialogProps) {
}

if (pluginID === NetworkPluginID.PLUGIN_SOLANA) {
if (!tokenId) return null
if (!tokenAddress) return null
}

return (
Expand Down
Expand Up @@ -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) {
Expand All @@ -58,7 +59,7 @@ export function DialogInspector(props: DialogInspectorProps) {
parentPluginID,
pluginID,
chainId,
tokenId: tokenId!,
tokenId: tokenId ?? '0',
tokenAddress: tokenAddress!,
ownerAddress,
origin: originType,
Expand Down
Expand Up @@ -57,6 +57,7 @@ const useStyles = makeStyles()((theme) => ({
},
textBase: {
display: 'flex',
fontSize: 14,
alignItems: 'center',
whiteSpace: 'nowrap',
lineHeight: '18px',
Expand Down
Expand Up @@ -14,6 +14,7 @@ import { Label } from './common.js'
const useStyles = makeStyles<void, 'body'>()((theme, _, refs) => ({
summary: {
color: theme.palette.maskColor.third,
fontSize: 14,
display: 'flex',
alignItems: 'center',
},
Expand All @@ -39,6 +40,7 @@ const useStyles = makeStyles<void, 'body'>()((theme, _, refs) => ({
name: {
color: theme.palette.maskColor.main,
fontWeight: 700,
fontSize: 14,
marginLeft: theme.spacing(1),
},
image: {
Expand Down Expand Up @@ -108,9 +110,9 @@ export const ProfileLinkCard: FC<ProfileLinkCardProps> = ({ feed, className, ...
context: feed.type,
}}
components={{
user: <Label title={user} />,
other: <Label title={other} />,
platform: <Label />,
user: <Label title={user} fontSize={14} />,
other: <Label title={other} fontSize={14} />,
platform: <Label fontSize={14} />,
}}
/>
</Typography>
Expand Down
4 changes: 2 additions & 2 deletions packages/web3-hooks/base/src/useNonFungibleAsset.ts
@@ -1,5 +1,5 @@
import { useAsyncRetry } from 'react-use'
import type { NetworkPluginID } from '@masknet/shared-base'
import { NetworkPluginID } from '@masknet/shared-base'
import type { Web3Helper } from '@masknet/web3-helpers'
import { useChainContext } from './useContext.js'
import { useWeb3Hub } from './useWeb3Hub.js'
Expand All @@ -17,7 +17,7 @@ export function useNonFungibleAsset<S extends 'all' | void = void, T extends Net
})

return useAsyncRetry<Web3Helper.NonFungibleAssetScope<S, T> | undefined>(async () => {
if (!hub || !address || !id) return
if (!hub || !address || (!id && pluginID !== NetworkPluginID.PLUGIN_SOLANA)) return
return hub.getNonFungibleAsset?.(address ?? '', id ?? '', options)
}, [address, id, hub, JSON.stringify(options)])
}

0 comments on commit 7a52154

Please sign in to comment.