From fbfb0db38e48cc71d0094329dc22b0313d12132d Mon Sep 17 00:00:00 2001 From: pascal Date: Sat, 5 Sep 2026 21:10:33 +0200 Subject: [PATCH] ladowanie ogloszen --- frontend/src/App.tsx | 66 ++++++++++++++++++++++- frontend/src/styles.css | 114 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 179 insertions(+), 1 deletion(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 9f7c862..513fbf4 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -14240,6 +14240,7 @@ function AddListingPage({ editListingId }: { editListingId?: number }) { // dalej, zeby nie krzyczec o brakach zanim uzytkownik cokolwiek wypelni. const [showDetailsError, setShowDetailsError] = useState(false); const [showLocationError, setShowLocationError] = useState(false); + const [showPhotosError, setShowPhotosError] = useState(false); const [listingDetails, setListingDetails] = useState(INITIAL_LISTING_DETAILS); // Ekran startowy z wyborem "Chcę sprzedać / wynająć" + kategorii. Przy edycji pomijamy go i od razu // pokazujemy formularz. Wybor kategorii ustawia transakcje i rodzaj, a potem wchodzimy w kreator. @@ -14640,8 +14641,17 @@ function AddListingPage({ editListingId }: { editListingId?: number }) { }); return; } + // Krok "Zdjęcia" (currentStep 2) - wymagamy przynajmniej jednego zdjecia, zeby przejsc dalej. + if (currentStep === 2 && step > 2 && photos.length === 0) { + setShowPhotosError(true); + window.requestAnimationFrame(() => { + document.querySelector('.add-step-error')?.scrollIntoView({ behavior: 'smooth', block: 'center' }); + }); + return; + } setShowDetailsError(false); setShowLocationError(false); + setShowPhotosError(false); setCurrentStep(step); window.requestAnimationFrame(() => { document.querySelector('.add-page')?.scrollIntoView({ behavior: 'smooth', block: 'start' }); @@ -15328,6 +15338,12 @@ function AddListingPage({ editListingId }: { editListingId?: number }) { {virtualTourError &&

{virtualTourError}

} + {showPhotosError && photos.length === 0 && ( +

+ Dodaj przynajmniej jedno zdjęcie, aby przejść dalej. +

+ )} +