diff --git a/app/src/components/ListingDetail.tsx b/app/src/components/ListingDetail.tsx index f4e9b90..1d07fa2 100644 --- a/app/src/components/ListingDetail.tsx +++ b/app/src/components/ListingDetail.tsx @@ -7,7 +7,7 @@ import { useOrdersForListing } from '@/hooks/useOrdersForListing' import { Badge, STATUS_COLORS } from '@/components/ui/Badge' import { FieldRow, MonoChip } from '@/components/ui/FieldRow' import { Button } from '@/components/ui/Button' -import { abbrev, fmtSol, fmtTok } from '@/lib/format' +import { abbrev, fmtSol, fmtTok, priceStr } from '@/lib/format' import type { Address } from '@solisting/sdk' interface Props { @@ -36,7 +36,7 @@ export function ListingDetail({ pk, walletAddress, onUpdate, onClose, onPlaceOrd const canPlace = !isSeller && d.isActive && avail > 0 && walletAddress const canonicalOracleAddr = isSome(d.canonicalOracle) ? d.canonicalOracle.value : null - function priceStr() { + function fmtListingPrice() { const cur = d.canonicalCurrency if (cur.__kind === 'Sol') return fmtSol(d.price) return fmtTok(d.price, cur.decimals, 'SPL') @@ -66,7 +66,7 @@ export function ListingDetail({ pk, walletAddress, onUpdate, onClose, onPlaceOrd
ACCOUNT FIELDS
#{String(d.listingId)} navigator.clipboard.writeText(d.seller)} onClick={() => router.push(`/search?q=${d.seller}`)} /> - {priceStr()} + {fmtListingPrice()} {d.canonicalCurrency.__kind === 'Sol' ? 'SOL (native)' : `SPL ยท ${abbrev((d.canonicalCurrency as { mint: string }).mint)}`} @@ -159,7 +159,7 @@ export function ListingDetail({ pk, walletAddress, onUpdate, onClose, onPlaceOrd >
{abbrev(o.address)}
{abbrev(o.data.buyer)}
-
{fmtSol(o.data.amount)}
+
{priceStr(o.data.paymentCurrency, o.data.amount)}
#{String(o.data.orderId)}
#{String(o.data.escrowId)}