From c23f5a3f4b12176c6d5b71f36afb21a5ad592bba Mon Sep 17 00:00:00 2001 From: AI Assistant Date: Sat, 18 Jul 2026 12:25:58 +0200 Subject: [PATCH] feat(calculator, city-page): add width warning option and optimize stats layout on mobile --- app/klimatyzacja/[miasto]/page.tsx | 3 +- components/kalkulator/KalkulatorClient.tsx | 79 +++++++++++++++++++--- 2 files changed, 72 insertions(+), 10 deletions(-) diff --git a/app/klimatyzacja/[miasto]/page.tsx b/app/klimatyzacja/[miasto]/page.tsx index 475a72c..5c78761 100644 --- a/app/klimatyzacja/[miasto]/page.tsx +++ b/app/klimatyzacja/[miasto]/page.tsx @@ -165,9 +165,8 @@ export default async function MiastoPage({ params }: Props) { -
+
{[ - { label: 'Dofinansowanie', value: 'do 135 000 zł', sub: 'z programu Czyste Powietrze' }, { label: 'Oszczędność', value: 'do 60%', sub: 'niższe koszty ogrzewania' }, { label: 'Sprawność', value: 'COP 4–5', sub: 'na każdy 1 kW energii' }, { label: 'Gwarancja', value: '5 lat', sub: 'na urządzenie i montaż' }, diff --git a/components/kalkulator/KalkulatorClient.tsx b/components/kalkulator/KalkulatorClient.tsx index d6f45d5..cb5c051 100644 --- a/components/kalkulator/KalkulatorClient.tsx +++ b/components/kalkulator/KalkulatorClient.tsx @@ -77,6 +77,8 @@ function estimateInstall(pipes: string, rooms: number, installMethod: string, ou const STEPS = ['Typ', 'Pomieszczenie', 'Instalacja', 'Budżet', 'Dobór'] as const; export function KalkulatorClient({ products }: Props) { + const [showWidthWarning, setShowWidthWarning] = useState(false); + const [maxWidth, setMaxWidth] = useState(80); const [deviceType, setDeviceType] = useSessionState<'klimatyzacja' | 'pompa'>('calc_deviceType', 'klimatyzacja'); const [pumpFormSent, setPumpFormSent] = useState(false); const [pumpForm, setPumpForm] = useState({ name: '', phone: '', city: '', message: '' }); @@ -254,16 +256,20 @@ export function KalkulatorClient({ products }: Props) {
{/* Pasek postępu */} -
+
{STEPS.map((s, i) => ( -
-
- {i < step ? : i + 1} +
+
+
+ {i < step ? : i + 1} +
+
- - {i < STEPS.length - 1 &&
} + {i < STEPS.length - 1 && ( +
+ )}
))}
@@ -436,6 +442,63 @@ export function KalkulatorClient({ products }: Props) { )} + {/* Ograniczenie szerokości */} +
+
+
+

Ograniczenie szerokości jednostki?

+

Np. wąska ściana, wnęka, szafa

+
+ +
+ {showWidthWarning && ( +
+
+ Maksymalna szerokość jednostki + {maxWidth} cm +
+
+
+
+ setMaxWidth(Number(e.target.value))} + className="absolute w-full h-1.5 opacity-0 cursor-pointer z-10" + /> +
+
+
+ 40 cm + 120 cm +
+
+ ⚠️ +

+ Standardowe jednostki split mają 70–110 cm szerokości. + {maxWidth < 70 && ' Przy tak małej przestrzeni wybór jest bardzo ograniczony — '} + {maxWidth >= 70 && maxWidth < 85 && ' Przy tej szerokości dostępne są kompaktowe modele — '} + {maxWidth >= 85 && ' Większość modeli powinna się zmieścić — '} + skonsultuj wymiary konkretnego modelu przed zakupem. + Zapytaj nas → +

+
+
+ )} +
+

Łączna wymagana moc: ok. {requiredPowerRounded} kW