Skip to content

Commit

Permalink
fix: mf-5369 solana icon (#10839)
Browse files Browse the repository at this point in the history
* fix: mf-5369 solana icon

* fix: improve checking assets empty status
  • Loading branch information
UncleBill committed Sep 24, 2023
1 parent 77c920f commit 7dc39bc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ export const AssetsProvider = memo<Props>(function AssetsProvider({ children, bl
const { collections } = CollectionsContext.useContainer()
const isEmpty = useMemo(() => {
// Collections assets are lazy loading, can't judge if not all collections been load
if (Object.keys(assetsMap).length < collections.length) return false
if (Object.keys(assetsMap).length < collections.length || Object.values(assetsMap).some((x) => x.loading))
return false
// Spam score of some collections might be OK, but NFTs of them might be treated as spam #MF-5091
return getAssetsTotal(assetsMap) === 0
}, [assetsMap, collections.length])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const useStyles = makeStyles<CollectibleGridProps>()((theme, { columns = 4, gap
emptyMain: {
display: 'flex',
flexDirection: 'column',
alignSelf: 'center',
},
grid: {
width: '100%',
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/UI/components/NetworkIcon/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const NetworkIcon = memo(function NetworkIcon(props: NetworkIconProps) {
if (iconUrl && !network?.isCustomized) return <ImageIcon size={20} {...rest} icon={iconUrl} />
return (
<ChainIcon
size={rest?.size || 20}
size={rest.size || 20}
name={network?.name}
color={rest.color || network?.color}
className={rest.className}
Expand Down
3 changes: 3 additions & 0 deletions packages/web3-shared/solana/src/constants/descriptors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const CHAIN_DESCRIPTORS: Array<ChainDescriptor<ChainId, SchemaType, Netwo
url: 'https://explorer.solana.com/',
},
rpcUrl: '',
iconUrl: new URL('../assets/solana.png', import.meta.url).href,
isCustomized: false,
},
{
Expand Down Expand Up @@ -66,6 +67,7 @@ export const CHAIN_DESCRIPTORS: Array<ChainDescriptor<ChainId, SchemaType, Netwo
},
},
rpcUrl: '',
iconUrl: new URL('../assets/solana.png', import.meta.url).href,
isCustomized: false,
},
{
Expand Down Expand Up @@ -96,6 +98,7 @@ export const CHAIN_DESCRIPTORS: Array<ChainDescriptor<ChainId, SchemaType, Netwo
},
},
rpcUrl: '',
iconUrl: new URL('../assets/solana.png', import.meta.url).href,
isCustomized: false,
},
]
Expand Down

0 comments on commit 7dc39bc

Please sign in to comment.