diff --git a/src/navigation/wallet/screens/WalletDetails.tsx b/src/navigation/wallet/screens/WalletDetails.tsx index 7dea515d6..36b86cdf0 100644 --- a/src/navigation/wallet/screens/WalletDetails.tsx +++ b/src/navigation/wallet/screens/WalletDetails.tsx @@ -15,7 +15,6 @@ import React, { import {useTranslation} from 'react-i18next'; import { DeviceEventEmitter, - FlatList, Linking, RefreshControl, Share, @@ -31,6 +30,7 @@ import { H2, H5, HeaderTitle, + Link, Paragraph, ProposalBadge, Small, @@ -264,6 +264,12 @@ const TypeText = styled(BaseText)` color: ${({theme: {dark}}) => (dark ? LuckySevens : SlateDark)}; `; +const LinkText = styled(Link)` + font-weight: 500; + font-size: 18px; + text-align: center; +`; + const getWalletType = ( key: Key, wallet: Wallet, @@ -994,33 +1000,43 @@ const WalletDetails: React.FC = ({route}) => { ); }, []); - const renderTxp = useCallback(({item}) => { - return ( - onPressTxp(item)} - recipientCount={item.recipientCount} - toAddress={item.toAddress} - tokenAddress={item.tokenAddress} - chain={item.chain} - contactList={contactList} - /> - ); - }, []); + const renderTxp = useCallback( + (items: any[]) => { + return ( + + {items.slice(0, 5).map((item, index) => ( + onPressTxp(item)} + recipientCount={item.recipientCount} + toAddress={item.toAddress} + tokenAddress={item.tokenAddress} + chain={item.chain} + contactList={contactList} + /> + ))} + {items.length > 5 && ( + + {t('Show more')} + + )} + + ); + }, + [needActionPendingTxps, needActionUnsentTxps], + ); const keyExtractor = useCallback( (item, index: number) => index.toString(), [], ); - const pendingTxpsKeyExtractor = useCallback( - (item, index: number) => index.toString(), - [], - ); const protocolName = getProtocolName(chain, network); @@ -1245,27 +1261,12 @@ const WalletDetails: React.FC = ({route}) => { {pendingTxps.length} - {fullWalletObj.credentials.n > 1 ? ( - - ) : ( - - )} + {fullWalletObj.credentials.n > 1 && + needActionPendingTxps.length > 0 + ? renderTxp(needActionPendingTxps) + : needActionUnsentTxps.length > 0 + ? renderTxp(needActionUnsentTxps) + : null} ) : null}