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