Ukryj AvailabilitySearch i SlotFinder po przejsciu do kroku 3 wizarda
This commit is contained in:
@@ -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']}>
|
||||
|
||||
Reference in New Issue
Block a user