Merged in feat/SW-3050-webviews (pull request #2429)
Feat/SW-3050 webviews Approved-by: Anton Gunnarsson
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
"use client"
|
||||
|
||||
import { usePathname } from "next/navigation"
|
||||
|
||||
import { isWebview } from "@/constants/routes/webviews"
|
||||
import { useMyStayStore } from "@/stores/my-stay"
|
||||
|
||||
import AddToCalendar from "@/components/HotelReservation/AddToCalendar"
|
||||
@@ -11,6 +14,8 @@ import AddToCalendarButton from "./AddToCalendarButton"
|
||||
import type { EventAttributes } from "ics"
|
||||
|
||||
export default function AddToCalendarAction() {
|
||||
const pathName = usePathname()
|
||||
|
||||
const { checkInDate, checkOutDate, createDateTime, hotel } = useMyStayStore(
|
||||
(state) => ({
|
||||
checkInDate: state.bookedRoom.checkInDate,
|
||||
@@ -44,6 +49,10 @@ export default function AddToCalendarAction() {
|
||||
hotel.hotelFacts.checkin.checkInTime
|
||||
)
|
||||
|
||||
if (isWebview(pathName)) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<AddToCalendar
|
||||
checkInDate={checkInDate}
|
||||
|
||||
Reference in New Issue
Block a user