Skip to content

Commit

Permalink
Merge pull request #226 from Outblock/Transaction-history-text-displa…
Browse files Browse the repository at this point in the history
…y-issues

fixed: transaction history text
  • Loading branch information
zzggo authored Nov 28, 2024
2 parents 19ce3dc + 24cea87 commit b3eb507
Showing 1 changed file with 32 additions and 17 deletions.
49 changes: 32 additions & 17 deletions src/ui/views/Wallet/TransferList.tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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 }) => {
Expand Down Expand Up @@ -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}`}
</Typography>
Expand Down Expand Up @@ -133,15 +138,21 @@ const TransferList = ({ setCount }) => {
disableTypography={true}
primary={
!isLoading ? (
<Box sx={{ display: 'flex', gap: '3px' }}>
<Box sx={{ display: 'flex', gap: '3px', alignItems: 'center' }}>
{props.txType === 1 ? (
<CallMadeRoundedIcon sx={{ color: 'info.main', width: '18px' }} />
) : (
<CallReceivedRoundedIcon sx={{ color: 'info.main', width: '18px' }} />
)}
<Typography
variant="body1"
sx={{ fontSize: 14, fontWeight: '500', textAlign: 'start' }}
sx={{
fontSize: 14,
fontWeight: '500',
maxWidth: '150px',
wordWrap: 'break-word',
textAlign: 'start',
}}
>
{props.title}
</Typography>
Expand Down Expand Up @@ -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);
}
}}
>
Expand Down Expand Up @@ -247,6 +261,7 @@ const TransferList = ({ setCount }) => {
variant="text"
endIcon={<ChevronRightRoundedIcon />}
onClick={() => {
// eslint-disable-next-line no-restricted-globals
window.open(`${flowscanURL}/account/${address}`, '_blank');
}}
>
Expand Down

0 comments on commit b3eb507

Please sign in to comment.