Skip to content

Commit

Permalink
chore: actioned gome code review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
woodenfurniture committed May 7, 2024
1 parent 941d562 commit c42909b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const TableRowAccount = forwardRef<TableRowAccountProps, 'div'>(({ asset, accoun

const { data: account, isLoading } = useQuery(accountManagement.getAccount(accountId))

const assetBalancePrecision = useMemo(() => {
const assetBalanceCryptoPrecision = useMemo(() => {
if (!account) return '0'
return fromBaseUnit(account.balance, asset.precision)
}, [account, asset.precision])
Expand All @@ -84,7 +84,7 @@ const TableRowAccount = forwardRef<TableRowAccountProps, 'div'>(({ asset, accoun
{isLoading ? (
<Skeleton height='24px' width='100%' />
) : (
<Amount.Crypto value={assetBalancePrecision} symbol={asset.symbol} />
<Amount.Crypto value={assetBalanceCryptoPrecision} symbol={asset.symbol} />
)}
</Td>
</>
Expand Down
10 changes: 5 additions & 5 deletions src/components/ManageAccountsDrawer/components/SelectChain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,20 @@ export const SelectChain = ({ onSelectChainId, onClose }: SelectChainProps) => {

const walletSupportedChainIds = useAppSelector(selectWalletSupportedChainIds)

const searching = useMemo(() => searchQuery.length > 0, [searchQuery])
const isSearching = useMemo(() => searchQuery.length > 0, [searchQuery])

useEffect(() => {
if (!searching) return
if (!isSearching) return

setSearchTermChainIds(filterChainIdsBySearchTerm(searchQuery, walletSupportedChainIds))
}, [searchQuery, searching, walletSupportedChainIds])
}, [searchQuery, isSearching, walletSupportedChainIds])

const chainButtons = useMemo(() => {
const listChainIds = searching ? searchTermChainIds : walletSupportedChainIds
const listChainIds = isSearching ? searchTermChainIds : walletSupportedChainIds
return listChainIds.map(chainId => {
return <ChainButton key={chainId} chainId={chainId} onClick={onSelectChainId} />
})
}, [onSelectChainId, searchTermChainIds, searching, walletSupportedChainIds])
}, [onSelectChainId, searchTermChainIds, isSearching, walletSupportedChainIds])

const footer = useMemo(() => {
return (
Expand Down

0 comments on commit c42909b

Please sign in to comment.