From c93cabb8add24a3b8f4ee8662e1a3da2c7bb5a6b Mon Sep 17 00:00:00 2001 From: Tero Halla-aho Date: Tue, 16 Dec 2025 00:24:15 +0200 Subject: [PATCH] Align edit listing form with create page UI --- PROGRESS.md | 1 + app/listings/edit/[id]/page.tsx | 116 +++++++++++++++++++------------- 2 files changed, 72 insertions(+), 45 deletions(-) diff --git a/PROGRESS.md b/PROGRESS.md index d367160..7eec291 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -65,6 +65,7 @@ - Added `generate_images.py` and committed sample image assets for reseeding/rebuilds. - Price hint now stored in euros (schema field `priceHintPerNightEuros`); Prisma migration added to convert from cents, seeds and API/UI updated, and build now runs `prisma generate` automatically. - Listing creation amenities UI improved with toggle cards and EV button group. +- Edit listing form now matches the create form styling, including amenity icon grid and price helpers. - Mermaid docs fixed: all sequence diagrams declare their participants and avoid โ€œ->โ€ inside message text; the listing creation diagram message was rewritten to prevent parse errors. Use mermaid.live or browser console to debug future syntax issues (errors flag the offending line/column). - New amenities added: kitchen, dishwasher, washing machine, barbecue; API/UI/i18n updated and seeds randomized to populate missing prices/amenities. Prisma migration `20250210_more_amenities` applied to shared DB; registry pull secret added to k8s Deployment to avoid image pull errors in prod. - Added About and Pricing pages (FI/EN), moved highlights/runtime config to About, and linked footer navigation. diff --git a/app/listings/edit/[id]/page.tsx b/app/listings/edit/[id]/page.tsx index 5646703..6ade8cd 100644 --- a/app/listings/edit/[id]/page.tsx +++ b/app/listings/edit/[id]/page.tsx @@ -255,6 +255,23 @@ export default function EditListingPage({ params }: { params: { id: string } }) } } + const amenityOptions = [ + { key: 'sauna', label: t('amenitySauna'), icon: '๐Ÿง–', checked: hasSauna, toggle: setHasSauna }, + { key: 'fireplace', label: t('amenityFireplace'), icon: '๐Ÿ”ฅ', checked: hasFireplace, toggle: setHasFireplace }, + { key: 'wifi', label: t('amenityWifi'), icon: '๐Ÿ“ถ', checked: hasWifi, toggle: setHasWifi }, + { key: 'pets', label: t('amenityPets'), icon: '๐Ÿพ', checked: petsAllowed, toggle: setPetsAllowed }, + { key: 'lake', label: t('amenityLake'), icon: '๐ŸŒŠ', checked: byTheLake, toggle: setByTheLake }, + { key: 'ac', label: t('amenityAirConditioning'), icon: 'โ„๏ธ', checked: hasAirConditioning, toggle: setHasAirConditioning }, + { key: 'kitchen', label: t('amenityKitchen'), icon: '๐Ÿฝ๏ธ', checked: hasKitchen, toggle: setHasKitchen }, + { key: 'dishwasher', label: t('amenityDishwasher'), icon: '๐Ÿงผ', checked: hasDishwasher, toggle: setHasDishwasher }, + { key: 'washer', label: t('amenityWashingMachine'), icon: '๐Ÿงบ', checked: hasWashingMachine, toggle: setHasWashingMachine }, + { key: 'barbecue', label: t('amenityBarbecue'), icon: '๐Ÿ–', checked: hasBarbecue, toggle: setHasBarbecue }, + { key: 'microwave', label: t('amenityMicrowave'), icon: '๐Ÿฒ', checked: hasMicrowave, toggle: setHasMicrowave }, + { key: 'parking', label: t('amenityFreeParking'), icon: '๐Ÿ…ฟ๏ธ', checked: hasFreeParking, toggle: setHasFreeParking }, + { key: 'ski', label: t('amenitySkiPass'), icon: 'โ›ท๏ธ', checked: hasSkiPass, toggle: setHasSkiPass }, + { key: 'ev', label: t('amenityEvAvailable'), icon: 'โšก', checked: evChargingAvailable, toggle: setEvChargingAvailable }, + ]; + async function checkSlugAvailability() { const value = slug.trim().toLowerCase(); if (!value) { @@ -644,15 +661,38 @@ export default function EditListingPage({ params }: { params: { id: string } })
+
{t('priceHintHelp')}
+