From 96aaa7d3c1daa5a251b0a44f1711df247bb7fd6b Mon Sep 17 00:00:00 2001 From: Josh Leonard Date: Thu, 22 Sep 2022 12:24:10 -0600 Subject: [PATCH] fix: revert portfolio page virtualized tokens list --- .../components/token-lists/token-list.tsx | 49 ++++++------------- 1 file changed, 15 insertions(+), 34 deletions(-) diff --git a/components/brave_wallet_ui/components/desktop/views/portfolio/components/token-lists/token-list.tsx b/components/brave_wallet_ui/components/desktop/views/portfolio/components/token-lists/token-list.tsx index bf79193e81d3..4b957775bba9 100644 --- a/components/brave_wallet_ui/components/desktop/views/portfolio/components/token-lists/token-list.tsx +++ b/components/brave_wallet_ui/components/desktop/views/portfolio/components/token-lists/token-list.tsx @@ -5,9 +5,7 @@ import * as React from 'react' import { useHistory } from 'react-router' -import { - useSelector -} from 'react-redux' +import { useSelector } from 'react-redux' // Types import { @@ -16,6 +14,7 @@ import { WalletRoutes, WalletState } from '../../../../../../constants/types' +import { RenderTokenFunc } from './virtualized-tokens-list' // Utils import { getLocale } from '../../../../../../../common/locale' @@ -39,8 +38,6 @@ import { Spacer, FilterTokenRow } from '../../style' -import { RenderTokenFunc, VirtualizedTokensList } from './virtualized-tokens-list' -import { HorizontallyPaddedDiv } from './token-list.style' interface Props { userAssetList: UserAssetInfoType[] @@ -150,39 +147,23 @@ export const TokenLists = ({ const listUi = React.useMemo(() => { return selectedAssetFilter.id !== 'nfts' ? ( - index === firstNftIndex ? 94 : estimatedItemSize - } - renderToken={(args) => { - if (args.index === firstNftIndex) { - return + <> + {sortedFungibleTokensList.map((token, index) => renderToken({ index, item: token, viewMode: 'list' }))} + {nonFungibleTokens.length !== 0 && + <> {getLocale('braveWalletTopNavNFTS')} - {renderToken(args)} - + {nonFungibleTokens.map((token, index) => renderToken({ index, item: token, viewMode: 'list' }))} + } - return - {renderToken(args)} - - }} - userAssetList={sortedFungibleTokensAndNftsList} - estimatedItemSize={estimatedItemSize} - /> - ) : ( - renderToken({ - index, - item: token, - viewMode: 'grid' - })} - /> - ) + + ) : ( + renderToken({ index, item: token, viewMode: 'list' })} + /> + ) }, [ firstNftIndex, selectedAssetFilter.id,