feat(ernten): show only the remaining jars per batch
Docker Image bauen und veroeffentlichen / build-and-push (push) Successful in 4m6s
Docker Image bauen und veroeffentlichen / build-and-push (push) Successful in 4m6s
The batch list on a harvest page no longer states the batch's total
size ("12 von 300 Gläsern verfügbar"). It now reads "Es sind noch 12
Gläser verfügbar", with dedicated wording for a single jar and for a
sold-out batch, which reads scarcer and nudges customers to buy.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
1 parent
55ae867f68
commit
15a457f66e
4 files changed
+17
-5
No files matched your search
@@ -76,10 +76,12 @@ export default async function HarvestDetailPage(
|
|||||||
<span className="flex items-center justify-between gap-4 text-sm">
|
<span className="flex items-center justify-between gap-4 text-sm">
|
||||||
<span className="font-serif text-xl text-heading tabular-nums">{batch.code}</span>
|
<span className="font-serif text-xl text-heading tabular-nums">{batch.code}</span>
|
||||||
<span className="text-ink/65 tabular-nums">
|
<span className="text-ink/65 tabular-nums">
|
||||||
{t.erntenDetailPage.glassesAvailable(batch.remainingGlasses, batch.glassCount)}
|
{t.erntenDetailPage.glassesAvailable(batch.remainingGlasses)}
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
{/* Fuellstand der Charge — die Zahl rechts bekommt eine Form. */}
|
{/* Fuellstand der Charge. Der Text nennt bewusst nur den Rest,
|
||||||
|
nicht die Gesamtmenge: "noch 12 verfuegbar" wirkt knapper
|
||||||
|
und kaufanregender als "12 von 300". */}
|
||||||
<span aria-hidden="true" className="mt-3 block h-1.5 overflow-hidden rounded-full bg-ink/10">
|
<span aria-hidden="true" className="mt-3 block h-1.5 overflow-hidden rounded-full bg-ink/10">
|
||||||
<span
|
<span
|
||||||
className="motion-grow block h-full origin-left rounded-full bg-gradient-to-r from-honey-dark to-honey animate-[wh-grow_0.9s_var(--ease-arrive)_both]"
|
className="motion-grow block h-full origin-left rounded-full bg-gradient-to-r from-honey-dark to-honey animate-[wh-grow_0.9s_var(--ease-arrive)_both]"
|
||||||
|
|||||||
@@ -785,7 +785,12 @@ export const de: Dictionary = {
|
|||||||
backLabel: "Zurück zu allen Ernten",
|
backLabel: "Zurück zu allen Ernten",
|
||||||
batchesHeading: "Chargen dieser Ernte",
|
batchesHeading: "Chargen dieser Ernte",
|
||||||
productsHeading: "Produkte aus dieser Ernte",
|
productsHeading: "Produkte aus dieser Ernte",
|
||||||
glassesAvailable: (remaining, total) => `${remaining} von ${total} Gläsern verfügbar`,
|
glassesAvailable: (remaining) =>
|
||||||
|
remaining <= 0
|
||||||
|
? "Leider schon vergriffen"
|
||||||
|
: remaining === 1
|
||||||
|
? "Es ist nur noch 1 Glas verfügbar"
|
||||||
|
: `Es sind noch ${remaining} Gläser verfügbar`,
|
||||||
},
|
},
|
||||||
chargePage: {
|
chargePage: {
|
||||||
verifiedBatch: "Verifizierte Charge",
|
verifiedBatch: "Verifizierte Charge",
|
||||||
|
|||||||
@@ -761,7 +761,12 @@ export const en: Dictionary = {
|
|||||||
backLabel: "Back to all harvests",
|
backLabel: "Back to all harvests",
|
||||||
batchesHeading: "Batches from this harvest",
|
batchesHeading: "Batches from this harvest",
|
||||||
productsHeading: "Products from this harvest",
|
productsHeading: "Products from this harvest",
|
||||||
glassesAvailable: (remaining, total) => `${remaining} of ${total} jars available`,
|
glassesAvailable: (remaining) =>
|
||||||
|
remaining <= 0
|
||||||
|
? "Already sold out"
|
||||||
|
: remaining === 1
|
||||||
|
? "Only 1 jar left"
|
||||||
|
: `Only ${remaining} jars left`,
|
||||||
},
|
},
|
||||||
chargePage: {
|
chargePage: {
|
||||||
verifiedBatch: "Verified batch",
|
verifiedBatch: "Verified batch",
|
||||||
|
|||||||
@@ -358,7 +358,7 @@ export interface Dictionary {
|
|||||||
backLabel: string;
|
backLabel: string;
|
||||||
batchesHeading: string;
|
batchesHeading: string;
|
||||||
productsHeading: string;
|
productsHeading: string;
|
||||||
glassesAvailable: (remaining: number, total: number) => string;
|
glassesAvailable: (remaining: number) => string;
|
||||||
};
|
};
|
||||||
chargePage: {
|
chargePage: {
|
||||||
verifiedBatch: string;
|
verifiedBatch: string;
|
||||||
|
|||||||
Reference in new issue
Block a user