Ukryj AvailabilitySearch i SlotFinder po przejsciu do kroku 3 wizarda

This commit is contained in:
Krzysztof Cieślik
2026-06-21 06:33:55 +02:00
parent fa6e892b16
commit 355dffc3c0
2 changed files with 12 additions and 6 deletions

View File

@@ -18,6 +18,7 @@ const DashboardPage = () => {
const { user, logout } = useAuth();
// useState do przechowywania stanu prefillSlot, który jest używany do wstępnego wypełnienia formularza rezerwacji wybranym slotem
const [prefillSlot, setPrefillSlot] = useState(null);
const [wizardStep, setWizardStep] = useState(1);
// useState do przechowywania stanu profileOpen, który jest używany do otwierania i zamykania modala edycji profilu
const [profileOpen, setProfileOpen] = useState(false);
// custom hook useUserReservations pobiera rezerwacje zalogowanego użytkownika z API i zwraca je w data
@@ -57,15 +58,19 @@ const DashboardPage = () => {
</header>
<main className={styles['dashboard__main']}>
<AvailabilitySearch onSelectSlot={setPrefillSlot} />
<SlotFinder onSelectSlot={setPrefillSlot} />
{wizardStep < 3 && (
<>
<AvailabilitySearch onSelectSlot={setPrefillSlot} />
<SlotFinder onSelectSlot={setPrefillSlot} />
</>
)}
<div className={styles['dashboard__grid']}>
<section className={styles['dashboard__booking']}>
<BookingWizard
prefillSlot={prefillSlot}
onPrefillUsed={() => setPrefillSlot(null)}
onStepChange={setWizardStep}
/>
</section>
<aside className={styles['dashboard__aside']}>