Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/ui/app/providers/ProviderCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import Link from 'next/link';
import type { Route } from 'next';
import { useMemo } from 'react';

import { AnimatedNumber } from '@/components/AnimatedNumber';
import { StatusIndicator } from '@/components/StatusIndicator';
import { AnimatedNumber } from '@/components/ui/animated-number';
import { StatusIndicator } from '@/components/ui/status-indicator';
import { formatPercent, formatUSD } from '@/lib/format';
import { useMarketStream } from '@/lib/hooks/use-market-stream';
import type { ProviderSummary } from '@/lib/server/providers';
Expand Down
4 changes: 2 additions & 2 deletions apps/ui/app/providers/ProviderStatsStrip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import { useMemo, type ReactNode } from 'react';

import { AnimatedNumber } from '@/components/AnimatedNumber';
import { StatusIndicator } from '@/components/StatusIndicator';
import { AnimatedNumber } from '@/components/ui/animated-number';
import { StatusIndicator } from '@/components/ui/status-indicator';
import { formatPercent, formatUSD } from '@/lib/format';
import { useMarketStream } from '@/lib/hooks/use-market-stream';
import { cn } from '@/lib/utils';
Expand Down
16 changes: 10 additions & 6 deletions apps/ui/app/providers/[provider]/depthBook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { useEffect, useMemo, useRef, useState } from 'react';

import { AnimatedNumber } from '@/components/AnimatedNumber';
import { AnimatedNumber } from '@/components/ui/animated-number';
import { cardStyles } from '@/styles/design-tokens';
import { Card, CardContent } from '@/components/ui/card';
import { formatAdaptiveNumber, formatNumber, formatTimestamp, formatUSD } from '@/lib/format';
Expand Down Expand Up @@ -143,6 +143,12 @@ export const DepthBook = ({ asset, orderbook, metadata, summary, loading, error

const displayedDepth = hydrated ? animatedDepth : staticDepth;
const isEmpty = depthTarget.bids.length === 0 && depthTarget.asks.length === 0;
const aggregateTotals = useMemo(
() => computeTotals(depthTarget.bids, depthTarget.asks),
[depthTarget]
);
const footerTotals =
depthTarget.bids.length > 0 || depthTarget.asks.length > 0 ? aggregateTotals : displayedDepth.totals;

return (
<Card className={cn(cardStyles.base, 'h-full')}>
Expand Down Expand Up @@ -199,7 +205,7 @@ export const DepthBook = ({ asset, orderbook, metadata, summary, loading, error
Bid Depth (Qty)
</p>
<AnimatedNumber
value={sanitizeAggregateValue(displayedDepth.totals.bidCumulative)}
value={sanitizeAggregateValue(footerTotals.bidCumulative)}
format={(value) => formatAdaptiveNumber(value)}
className="font-mono text-lg font-normal text-[#00FFA3] tabular-nums tracking-[-0.01em]"
/>
Expand All @@ -209,7 +215,7 @@ export const DepthBook = ({ asset, orderbook, metadata, summary, loading, error
Ask Depth (Qty)
</p>
<AnimatedNumber
value={sanitizeAggregateValue(displayedDepth.totals.askCumulative)}
value={sanitizeAggregateValue(footerTotals.askCumulative)}
format={(value) => formatAdaptiveNumber(value)}
className="font-mono text-lg font-normal text-[#FF3B69] tabular-nums tracking-[-0.01em]"
/>
Expand All @@ -219,9 +225,7 @@ export const DepthBook = ({ asset, orderbook, metadata, summary, loading, error
Total Book (USD)
</p>
<AnimatedNumber
value={sanitizeAggregateValue(
(displayedDepth.totals.bidNotional ?? 0) + (displayedDepth.totals.askNotional ?? 0)
)}
value={sanitizeAggregateValue((footerTotals.bidNotional ?? 0) + (footerTotals.askNotional ?? 0))}
format={(value) => formatUSD(value, { fractionDigits: 0 })}
className="font-mono text-lg font-normal text-slate-200 tabular-nums tracking-[-0.01em]"
/>
Expand Down
2 changes: 1 addition & 1 deletion apps/ui/app/providers/[provider]/providerDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
sortMarketsByOpenInterest,
type HeroOverview
} from '@/components/provider-dashboard/utils/overview';
import { StatusIndicator } from '@/components/StatusIndicator';
import { StatusIndicator } from '@/components/ui/status-indicator';
import { useMarketStream } from '@/lib/hooks/use-market-stream';
import { cn } from '@/lib/utils';
import { dashboardTypography, typography } from '@/styles/typography';
Expand Down
144 changes: 0 additions & 144 deletions apps/ui/components/AnimatedNumber.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AnimatedNumber } from '@/components/AnimatedNumber';
import { AnimatedNumber } from '@/components/ui/animated-number';
import { formatAdaptiveNumber } from '@/lib/format';
import { cn } from '@/lib/utils';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { AnimatedNumber } from '@/components/AnimatedNumber';
import { AnimatedNumber } from '@/components/ui/animated-number';
import { cn, clamp } from '@/lib/utils';

type RadialGaugeProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AnimatedNumber } from '@/components/AnimatedNumber';
import { AnimatedNumber } from '@/components/ui/animated-number';
import { LiveStatusBadge } from '@/components/ui/live-status-badge';
import { Surface } from '@/components/ui/surface';
import { formatNumber, formatPercent, formatUSDFull } from '@/lib/format';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Link from 'next/link';
import type { Route } from 'next';
import { useMemo } from 'react';

import AssetAvatar from '@/components/AssetAvatar';
import { AssetAvatar } from '@/components/ui/asset-avatar';
import { DepthIndicator, TrendIndicator } from '@/components/ui/data-indicators';
import { LiveStatusBadge } from '@/components/ui/live-status-badge';
import { Surface } from '@/components/ui/surface';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import MarketCandlestickChart from '@/components/MarketCandlestickChart';
import { AnimatedNumber } from '@/components/AnimatedNumber';
import { AnimatedNumber } from '@/components/ui/animated-number';
import { LiveStatusBadge } from '@/components/ui/live-status-badge';
import { Surface } from '@/components/ui/surface';
import { formatNumber, formatTimestamp } from '@/lib/format';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AnimatedNumber } from '@/components/AnimatedNumber';
import { AnimatedNumber } from '@/components/ui/animated-number';
import { Surface } from '@/components/ui/surface';
import { cn, clamp } from '@/lib/utils';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AnimatedNumber } from '@/components/AnimatedNumber';
import { AnimatedNumber } from '@/components/ui/animated-number';
import { LiveStatusBadge } from '@/components/ui/live-status-badge';
import { Surface } from '@/components/ui/surface';
import { formatNumber, formatPercent, formatTimestamp, formatUSDFull } from '@/lib/format';
Expand Down
Loading