diff --git a/packages/nextjs/app/bounties/[id]/page.tsx b/packages/nextjs/app/bounties/[id]/page.tsx index 7c63ab8..b012ced 100644 --- a/packages/nextjs/app/bounties/[id]/page.tsx +++ b/packages/nextjs/app/bounties/[id]/page.tsx @@ -18,6 +18,7 @@ import { Address } from "~~/components/scaffold-eth"; import { BountyStatus, bountyABI } from "~~/contracts/BountyABI"; import deployedContracts from "~~/contracts/deployedContracts"; import { useTargetNetwork } from "~~/hooks/scaffold-eth"; +import { formatEthShort } from "~~/utils/format"; import { notification } from "~~/utils/scaffold-eth"; export default function BountyDetailsPage() { @@ -244,6 +245,14 @@ export default function BountyDetailsPage() { const isOwner = connectedAddress === owner?.result; const currentStatus = status?.result !== undefined ? BountyStatus[status.result] : "Loading..."; + // Compute display reward + const rewardWei = ( + committedAmount && committedAmount > 0n ? committedAmount : (amount?.result as bigint) || 0n + ) as bigint; + const fullEth = formatEther(rewardWei); + const shortEth = formatEthShort(rewardWei, 6); + const isTrimmed = (fullEth.split(".")[1]?.length || 0) > 6; + return (
- {formatEther( - (committedAmount && committedAmount > 0n - ? committedAmount - : (amount?.result as bigint) || 0n) as bigint, - )}{" "} - ETH +
+ + {shortEth} ETH + {isTrimmed && ( + <> + ≈ + + {fullEth} ETH + + > + )} +