diff --git a/src/Block.tsx b/src/Block.tsx index afa68f4..83ab187 100644 --- a/src/Block.tsx +++ b/src/Block.tsx @@ -8,6 +8,7 @@ import ContentFrame from "./ContentFrame"; import InfoRow from "./components/InfoRow"; import Timestamp from "./components/Timestamp"; import GasValue from "./components/GasValue"; +import PercentageBar from "./components/PercentageBar"; import BlockLink from "./components/BlockLink"; import DecoratedAddressLink from "./components/DecoratedAddressLink"; import TransactionValue from "./components/TransactionValue"; @@ -133,17 +134,7 @@ const Block: React.FC = () => { /{" "} -
-
-
-
- {gasUsedPerc}% -
-
-
+ diff --git a/src/components/PercentageBar.tsx b/src/components/PercentageBar.tsx new file mode 100644 index 0000000..a868784 --- /dev/null +++ b/src/components/PercentageBar.tsx @@ -0,0 +1,21 @@ +import React from "react"; + +type PercentageBarProps = { + perc: number; +}; + +const PercentageBar: React.FC = ({ perc }) => ( +
+
+
+
+ {perc}% +
+
+
+); + +export default React.memo(PercentageBar); diff --git a/src/transaction/Details.tsx b/src/transaction/Details.tsx index 71cef91..2619204 100644 --- a/src/transaction/Details.tsx +++ b/src/transaction/Details.tsx @@ -20,6 +20,7 @@ import GasValue from "../components/GasValue"; import FormattedBalance from "../components/FormattedBalance"; import TokenTransferItem from "../TokenTransferItem"; import { TransactionData, InternalOperation } from "../types"; +import PercentageBar from "../components/PercentageBar"; type DetailsProps = { txData: TransactionData; @@ -171,8 +172,13 @@ const Details: React.FC = ({
- / {" "} - ({(txData.gasUsedPerc * 100).toFixed(2)}%) +
+
+ /{" "} + +
+ +
N/A {txData.nonce}