feat: improve public listing detail states
Quality / test (push) Canceled after 0s

This commit is contained in:
2026-09-10 06:09:13 -04:00
parent ae1605c82d
commit 7d20aedd14
6 changed files with 22 additions and 1 deletions
@@ -262,6 +262,7 @@ export function createListingRepository(db) {
conditionCode: result.condition.code,
marketValueMinor: override?.valueMinor ?? valuation?.valueMinor ?? null,
marketValueCurrency: override?.currency ?? valuation?.currency ?? null,
marketValueUpdatedAt: override?.createdAt ?? valuation?.calculatedAt ?? null,
};
},
@@ -11,6 +11,7 @@ export const ListingDetail = {
status: "AVAILABLE",
priceMinor: 11500,
marketValueMinor: 12000,
marketValueUpdatedAt: "2026-09-10T00:00:00.000Z",
condition: "Near Mint",
description: "A clean collector copy with a clear front and back.",
facts: [
@@ -34,3 +35,14 @@ export const ProductWithoutImages = {
facts: [{ label: "Category", value: "Collectible merchandise" }],
},
};
export const SoldListing = {
args: {
title: "Pikachu ex",
status: "SOLD",
priceMinor: 11500,
marketValueMinor: 12000,
marketValueUpdatedAt: "2026-09-10T00:00:00.000Z",
condition: "Near Mint",
},
};
@@ -10,6 +10,7 @@ defineProps({
priceMinor: { type: Number, default: null },
marketValueMinor: { type: Number, default: null },
marketValueCurrency: { type: String, default: "USD" },
marketValueUpdatedAt: { type: [String, Date], default: null },
condition: { type: String, default: "" },
description: { type: String, default: "" },
facts: { type: Array, default: () => [] },
@@ -28,7 +29,7 @@ defineProps({
<h1>{{ title }}</h1>
<p v-if="description" class="detail-notes">{{ description }}</p>
<div class="collectible-detail__summary">
<PriceDisplay v-if="priceMinor !== null" :amount-minor="priceMinor" />
<PriceDisplay v-if="priceMinor !== null && status !== 'SOLD'" :amount-minor="priceMinor" />
<PriceDisplay
v-if="marketValueMinor !== null"
label="Market value"
@@ -36,6 +37,10 @@ defineProps({
/>
<ConditionBadge v-if="condition" :label="condition" />
</div>
<p v-if="marketValueUpdatedAt" class="collectible-detail__market-updated">
Market value updated
<time :datetime="String(marketValueUpdatedAt)">{{ new Date(marketValueUpdatedAt).toLocaleDateString() }}</time>
</p>
<dl v-if="facts.length" class="product-facts">
<div v-for="fact in facts" :key="fact.label">
<dt>{{ fact.label }}</dt>
+1
View File
@@ -37,6 +37,7 @@ onMounted(async () => {
:price-minor="listing.askingPriceMinor"
:market-value-minor="listing.marketValueMinor"
:market-value-currency="listing.marketValueCurrency"
:market-value-updated-at="listing.marketValueUpdatedAt"
:condition="
listing.conditionName
? `${listing.conditionName} (${listing.conditionCode})`