Skip to content

Commit 9e90c84

Browse files
committed
feat(fork-stats): approximate dispute bond display
Show rounded REP bond prefixed with ~ and expose the exact value via title tooltip so users aren't confused by the trailing decimals. Widen the stats grid columns to accommodate the tilde and longer values.
1 parent b0790cb commit 9e90c84

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

src/components/ForkStats.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ import { useForkData } from '../providers/ForkDataProvider'
44
export const ForkStats = (): React.JSX.Element => {
55
const { rawData } = useForkData()
66

7-
const formatNumber = (num: number): string => {
8-
return num.toLocaleString()
9-
}
10-
117
// Check if there are no active disputes (stable state)
128
const isStable = rawData.metrics.largestDisputeBond === 0
139

@@ -25,7 +21,7 @@ export const ForkStats = (): React.JSX.Element => {
2521
System steady - No market disputes
2622
</div>
2723
) : (
28-
<div className="grid md:grid-cols-[8rem_8rem_8rem] md:place-content-center md:gap-y-4">
24+
<div className="grid md:grid-cols-[10rem_12rem_10rem] md:place-content-center md:gap-y-4">
2925
{/* Panel 1 - Fork Risk */}
3026
<div className="text-center">
3127
<div className="text-sm uppercase font-display tracking-widest font-light text-muted-foreground">
@@ -41,8 +37,11 @@ export const ForkStats = (): React.JSX.Element => {
4137
<div className="text-sm uppercase font-display tracking-widest font-light text-muted-foreground">
4238
DISPUTE BOND
4339
</div>
44-
<div className="uppercase text-primary fx-glow-sm">
45-
{formatNumber(rawData.metrics.largestDisputeBond)} REP
40+
<div
41+
className="uppercase text-primary fx-glow-sm"
42+
title={`${rawData.metrics.largestDisputeBond.toLocaleString(undefined, { maximumFractionDigits: 3 })} REP`}
43+
>
44+
~{Math.round(rawData.metrics.largestDisputeBond).toLocaleString()} REP
4645
</div>
4746
</div>
4847

0 commit comments

Comments
 (0)