feat: format eth in value (#21)
This commit is contained in:
@@ -26,6 +26,7 @@ import {
|
||||
import CopyToClipboard from "./CopyToClipboard";
|
||||
import { TxnDataType } from "../../types";
|
||||
import { useEffect } from "react";
|
||||
import { ethers } from "ethers";
|
||||
|
||||
export const slicedText = (txt: string) => {
|
||||
return txt.length > 6
|
||||
@@ -43,6 +44,16 @@ const TD = ({ txt }: { txt: string }) => (
|
||||
</HStack>
|
||||
</Td>
|
||||
);
|
||||
const ValueTD = ({ txt }: { txt: string }) => (
|
||||
<Td>
|
||||
<HStack>
|
||||
<Tooltip label={`${txt} Wei`} hasArrow placement="top">
|
||||
<Text>{ethers.utils.formatEther(txt)} ETH</Text>
|
||||
</Tooltip>
|
||||
<CopyToClipboard txt={txt} />
|
||||
</HStack>
|
||||
</Td>
|
||||
);
|
||||
|
||||
const TData = ({
|
||||
calldata,
|
||||
@@ -151,7 +162,7 @@ function TransactionRequests({
|
||||
<TD txt={d.from} />
|
||||
<TD txt={d.to} />
|
||||
<TData calldata={d.data} address={d.to} networkId={networkId} />
|
||||
<TD txt={d.value} />
|
||||
<ValueTD txt={d.value} />
|
||||
</Tr>
|
||||
))}
|
||||
</Tbody>
|
||||
|
||||
Reference in New Issue
Block a user