Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const AbbreviateClipboard = ({ value, link }: AbbreviateClipboardProps) => {
return (
<Stack direction="row" gap={1}>
<Typography
variant="body2"
sx={{
whiteSpace: 'nowrap',
textDecoration: 'inherit',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Box from '@mui/material/Box/Box';
import Chip from '@mui/material/Chip';
import { useTheme } from '@mui/material/styles';
import Typography from '@mui/material/Typography';

type PaletteColorKey =
| 'primary'
Expand Down Expand Up @@ -87,19 +86,14 @@ export const TransactionTableCellMethod = ({ method }: { method: string }) => {
};

return (
<Box
display="inline-flex"
px={1.5}
py={1}
borderRadius={8}
border={`1px solid ${getColorFromTheme(currentStatusColors.border)}`}
>
<Typography
textTransform="capitalize"
color={getColorFromTheme(currentStatusColors.text)}
>
{method}
</Typography>
</Box>
<Chip
label={method}
variant="outlined"
sx={{
borderColor: getColorFromTheme(currentStatusColors.border),
color: getColorFromTheme(currentStatusColors.text),
textTransform: 'capitalize',
}}
/>
);
};
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
import HelpOutlineIcon from '@mui/icons-material/HelpOutline';
import Typography from '@mui/material/Typography';

import CustomTooltip from '@/components/CustomTooltip';
import { formatHMTDecimals } from '@/helpers/formatHMTDecimals';
import { useHMTPrice } from '@/services/api/use-hmt-price';

export const TransactionTableCellValue = ({ value }: { value: string }) => {
const InfoTooltip = ({ title }: { title: string }) => (
<CustomTooltip title={title} arrow>
<HelpOutlineIcon
fontSize="small"
sx={{
color: 'text.secondary',
}}
/>
</CustomTooltip>
);

export const TransactionTableCellValue = ({
value,
method,
}: {
value: string;
method: string;
}) => {
const { isError, isPending } = useHMTPrice();

if (isError) {
Expand All @@ -15,9 +34,14 @@ export const TransactionTableCellValue = ({ value }: { value: string }) => {
}

return (
<Typography>
<Typography variant="body2" display="flex" alignItems="center" gap={0.5}>
{formatHMTDecimals(value)}
<Typography component="span"> HMT</Typography>
<Typography variant="body2" component="span">
HMT
</Typography>
{method === 'approve' && (
<InfoTooltip title="Approved amount (not a transfer)" />
)}
</Typography>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ export const TransactionsTableBody: React.FC = () => {
</TableCell>
<TableCell>{elem.block}</TableCell>
<TableCell>
<TransactionTableCellValue value={elem.value} />
<TransactionTableCellValue
value={elem.value}
method={elem.method}
/>
</TableCell>
</TableRow>
{elem.internalTransactions?.map((internalTx, internalIdx) => (
Expand Down Expand Up @@ -153,7 +156,10 @@ export const TransactionsTableBody: React.FC = () => {
</TableCell>
<TableCell></TableCell>
<TableCell>
<TransactionTableCellValue value={internalTx.value} />
<TransactionTableCellValue
value={internalTx.value}
method={internalTx.method}
/>
</TableCell>
</TableRow>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@ import TableRow from '@mui/material/TableRow';
import CustomTooltip from '@/components/CustomTooltip';

const InfoTooltip = ({ title }: { title: string }) => (
<CustomTooltip title={title}>
<CustomTooltip
title={title}
slotProps={{
tooltip: {
sx: {
maxWidth: '320px',
},
},
}}
>
<HelpOutlineIcon
fontSize="small"
sx={{
Expand Down Expand Up @@ -50,7 +59,7 @@ export const TransactionsTableHead = () => {
<TableCell>
<Stack direction="row" alignItems="center">
Value
<InfoTooltip title="Amount of HMT transferred in the transaction" />
<InfoTooltip title="This column reflects transacted and approved amounts" />
</Stack>
</TableCell>
</TableRow>
Expand Down