fix: overlay calendar view for Booker atom (#16642)

* overlay calendar needs to be false when in month_view

* fixup
This commit is contained in:
Rajiv Sahal
2024-09-16 14:39:18 +00:00
committed by GitHub
parent 32b2e83564
commit 071c899ea6
@@ -381,15 +381,17 @@ export const BookerPlatformWrapper = (
});
setBookingData(null);
}
if (isOverlayCalendarEnabled) {
localStorage.setItem("overlayCalendarSwitchDefault", "true");
} else {
localStorage.removeItem("overlayCalendarSwitchDefault");
}
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
useEffect(() => {
if (isOverlayCalendarEnabled && view === "MONTH_VIEW") {
localStorage.removeItem("overlayCalendarSwitchDefault");
}
setIsOverlayCalendarEnabled(Boolean(localStorage?.getItem?.("overlayCalendarSwitchDefault")));
}, [view, isOverlayCalendarEnabled]);
return (
<AtomsWrapper>
<BookerComponent