Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inventory view improvements #195

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions examples/react/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,34 +23,34 @@ export const kitConfig: KitConfig = {
projectName: 'Kit Demo',
useMock: isDebugMode
},
isDev: isDebugMode,
displayedAssets: [
// Native token
{
contractAddress: zeroAddress,
chainId: ChainId.ARBITRUM_NOVA
},
// Native token
{
contractAddress: zeroAddress,
chainId: ChainId.ARBITRUM_SEPOLIA
},
// Waas demo NFT
{
contractAddress: '0x0d402c63cae0200f0723b3e6fa0914627a48462e',
chainId: ChainId.ARBITRUM_NOVA
},
// Waas demo NFT
{
contractAddress: '0x0d402c63cae0200f0723b3e6fa0914627a48462e',
chainId: ChainId.ARBITRUM_SEPOLIA
},
// Skyweaver assets
{
contractAddress: '0x631998e91476da5b870d741192fc5cbc55f5a52e',
chainId: ChainId.POLYGON
}
]
isDev: isDebugMode
// displayedAssets: [
// // Native token
// {
// contractAddress: zeroAddress,
// chainId: ChainId.ARBITRUM_NOVA
// },
// // Native token
// {
// contractAddress: zeroAddress,
// chainId: ChainId.ARBITRUM_SEPOLIA
// },
// // Waas demo NFT
// {
// contractAddress: '0x0d402c63cae0200f0723b3e6fa0914627a48462e',
// chainId: ChainId.ARBITRUM_NOVA
// },
// // Waas demo NFT
// {
// contractAddress: '0x0d402c63cae0200f0723b3e6fa0914627a48462e',
// chainId: ChainId.ARBITRUM_SEPOLIA
// },
// // Skyweaver assets
// {
// contractAddress: '0x631998e91476da5b870d741192fc5cbc55f5a52e',
// chainId: ChainId.POLYGON
// }
// ]
}

export const config =
Expand Down
8 changes: 4 additions & 4 deletions packages/wallet/src/hooks/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export const getBalancesAssetsSummary = async (
return getTokenBalances(indexerClient, {
accountAddress,
contractAddress: asset.contractAddress,
includeMetadata: false,
includeMetadata: true,
hideCollectibles,
verifiedOnly
})
Expand All @@ -115,7 +115,7 @@ export const getBalancesAssetsSummary = async (
getTokenBalances(indexerClient, {
accountAddress,
hideCollectibles,
includeMetadata: false,
includeMetadata: true,
verifiedOnly
})
)
Expand Down Expand Up @@ -233,8 +233,8 @@ export const getBalancesAssetsSummary = async (
}

const summaryBalances: TokenBalance[] = [
...(nativeTokens.length > 0 ? [nativeTokens[0]] : []),
...(erc20HighestValue.length > 0 ? [erc20HighestValue[0]] : []),
...(nativeTokens.length > 0 ? [...nativeTokens] : []),
...(erc20HighestValue.length > 0 ? [...erc20HighestValue] : []),
...(collectibles.length > 0 ? [...collectibles] : [])
]

Expand Down
4 changes: 3 additions & 1 deletion packages/wallet/src/shared/KitWalletProvider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ export const KitWalletContent = ({ children }: KitWalletProviderProps) => {
style: {
maxWidth: '400px',
height: 'fit-content',
...getModalPositionCss(position)
...getModalPositionCss(position),
scrollbarColor: 'gray black',
scrollbarWidth: 'thin'
}
}}
scroll={false}
Expand Down
24 changes: 12 additions & 12 deletions packages/wallet/src/views/Search/SearchWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,20 +135,20 @@ export const SearchWallet = () => {
toLocation={{
location: 'search-view-all',
params: {
defaultTab: 'collections'
defaultTab: 'coins'
}
}}
label={`Collections (${collectionBalancesAmount})`}
label={`Coins (${coinBalancesAmount})`}
/>
{isPending ? (
Array(5)
.fill(null)
.map((_, i) => <Skeleton key={i} width="full" height="8" />)
) : foundCollectionBalances.length === 0 ? (
<Text color="text100">No collections found</Text>
) : foundCoinBalances.length === 0 ? (
<Text color="text100">No coins found</Text>
) : (
foundCollectionBalances.map((indexedItem, index) => {
const balance = collectionBalances[indexedItem.index]
foundCoinBalances.map((indexItem, index) => {
const balance = coinBalances[indexItem.index]
return <BalanceItem key={index} balance={balance} />
})
)}
Expand All @@ -158,20 +158,20 @@ export const SearchWallet = () => {
toLocation={{
location: 'search-view-all',
params: {
defaultTab: 'coins'
defaultTab: 'collections'
}
}}
label={`Coins (${coinBalancesAmount})`}
label={`Collections (${collectionBalancesAmount})`}
/>
{isPending ? (
Array(5)
.fill(null)
.map((_, i) => <Skeleton key={i} width="full" height="8" />)
) : foundCoinBalances.length === 0 ? (
<Text color="text100">No coins found</Text>
) : foundCollectionBalances.length === 0 ? (
<Text color="text100">No collections found</Text>
) : (
foundCoinBalances.map((indexItem, index) => {
const balance = coinBalances[indexItem.index]
foundCollectionBalances.map((indexedItem, index) => {
const balance = collectionBalances[indexedItem.index]
return <BalanceItem key={index} balance={balance} />
})
)}
Expand Down