From 24cea87abd806f37e4a365389179d33597a84ea7 Mon Sep 17 00:00:00 2001 From: zzggo Date: Wed, 27 Nov 2024 17:16:10 +1100 Subject: [PATCH] fixed: transaction history text --- src/ui/views/Wallet/TransferList.tsx | 49 ++++++++++++++++++---------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/src/ui/views/Wallet/TransferList.tsx b/src/ui/views/Wallet/TransferList.tsx index 9cc2c8f..4e1d79f 100644 --- a/src/ui/views/Wallet/TransferList.tsx +++ b/src/ui/views/Wallet/TransferList.tsx @@ -1,8 +1,6 @@ -import React, { useEffect, useState } from 'react'; -import { Box, ThemeProvider } from '@mui/system'; -import { useWallet } from 'ui/utils'; -import { formatString } from 'ui/utils/address'; -import theme from '../../style/LLTheme'; +import CallMadeRoundedIcon from '@mui/icons-material/CallMadeRounded'; +import CallReceivedRoundedIcon from '@mui/icons-material/CallReceivedRounded'; +import ChevronRightRoundedIcon from '@mui/icons-material/ChevronRightRounded'; import { Typography, ListItem, @@ -14,14 +12,17 @@ import { CardMedia, Button, } from '@mui/material'; -import activity from 'ui/FRWAssets/svg/activity.svg'; +import { Box, ThemeProvider } from '@mui/system'; import dayjs from 'dayjs'; import relativeTime from 'dayjs/plugin/relativeTime'; -// import IconExec from '../../../components/iconfont/IconExec'; -import ChevronRightRoundedIcon from '@mui/icons-material/ChevronRightRounded'; -// import ExpandLessRoundedIcon from '@mui/icons-material/ExpandLessRounded'; -import CallMadeRoundedIcon from '@mui/icons-material/CallMadeRounded'; -import CallReceivedRoundedIcon from '@mui/icons-material/CallReceivedRounded'; +import React, { useEffect, useState } from 'react'; + +import activity from 'ui/FRWAssets/svg/activity.svg'; +import { useWallet } from 'ui/utils'; +import { formatString } from 'ui/utils/address'; + +import theme from '../../style/LLTheme'; + dayjs.extend(relativeTime); const TransferList = ({ setCount }) => { @@ -96,9 +97,13 @@ const TransferList = ({ setCount }) => { fontWeight: '500', textAlign: 'end', color: isReceive && isFT ? 'success.main' : 'text.primary', + maxWidth: '100px', + whiteSpace: 'nowrap', + overflow: 'hidden', + textOverflow: 'ellipsis', }} > - {props.type == 1 + {props.type === 1 ? (isReceive ? '+' : '-') + `${props.amount}`.replace(/^-/, '') : `${props.token}`} @@ -133,7 +138,7 @@ const TransferList = ({ setCount }) => { disableTypography={true} primary={ !isLoading ? ( - + {props.txType === 1 ? ( ) : ( @@ -141,7 +146,13 @@ const TransferList = ({ setCount }) => { )} {props.title} @@ -209,9 +220,12 @@ const TransferList = ({ setCount }) => { dense={true} onClick={() => { { - monitor === 'flowscan' - ? window.open(`${flowscanURL}/tx/${tx.hash}`) - : window.open(`${viewSource}/${tx.hash}`); + const url = + monitor === 'flowscan' + ? `${flowscanURL}/tx/${tx.hash}` + : `${viewSource}/${tx.hash}`; + // eslint-disable-next-line no-restricted-globals + window.open(url); } }} > @@ -247,6 +261,7 @@ const TransferList = ({ setCount }) => { variant="text" endIcon={} onClick={() => { + // eslint-disable-next-line no-restricted-globals window.open(`${flowscanURL}/account/${address}`, '_blank'); }} >