feat(SW-343): rename button and useSearchParams
This commit is contained in:
@@ -9,7 +9,7 @@ import {
|
|||||||
} from "@/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/utils"
|
} from "@/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/utils"
|
||||||
import HotelCardListing from "@/components/HotelReservation/HotelCardListing"
|
import HotelCardListing from "@/components/HotelReservation/HotelCardListing"
|
||||||
import HotelFilter from "@/components/HotelReservation/SelectHotel/HotelFilter"
|
import HotelFilter from "@/components/HotelReservation/SelectHotel/HotelFilter"
|
||||||
import MobileButtonContainer from "@/components/HotelReservation/SelectHotel/MobileButtonContainer"
|
import MobileMapButtonContainer from "@/components/HotelReservation/SelectHotel/MobileMapButtonContainer"
|
||||||
import {
|
import {
|
||||||
generateChildrenString,
|
generateChildrenString,
|
||||||
getHotelReservationQueryParams,
|
getHotelReservationQueryParams,
|
||||||
@@ -84,7 +84,7 @@ export default async function SelectHotelPage({
|
|||||||
<ChevronRightIcon color="burgundy" />
|
<ChevronRightIcon color="burgundy" />
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<MobileButtonContainer city={searchParams.city} />
|
<MobileMapButtonContainer city={searchParams.city} />
|
||||||
<HotelFilter filters={filterList} />
|
<HotelFilter filters={filterList} />
|
||||||
</section>
|
</section>
|
||||||
<HotelCardListing hotelData={hotels} />
|
<HotelCardListing hotelData={hotels} />
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ import Button from "@/components/TempDesignSystem/Button"
|
|||||||
import Link from "@/components/TempDesignSystem/Link"
|
import Link from "@/components/TempDesignSystem/Link"
|
||||||
import useLang from "@/hooks/useLang"
|
import useLang from "@/hooks/useLang"
|
||||||
|
|
||||||
import styles from "./mobileButtonContainer.module.css"
|
import styles from "./mobileMapButtonContainer.module.css"
|
||||||
|
|
||||||
export default function MobileButtonContainer({ city }: { city: string }) {
|
export default function MobileMapButtonContainer({ city }: { city: string }) {
|
||||||
const intl = useIntl()
|
const intl = useIntl()
|
||||||
const lang = useLang()
|
const lang = useLang()
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
"use client"
|
"use client"
|
||||||
import { APIProvider } from "@vis.gl/react-google-maps"
|
import { APIProvider } from "@vis.gl/react-google-maps"
|
||||||
import { useRouter } from "next/navigation"
|
import { useRouter, useSearchParams } from "next/navigation"
|
||||||
import { useState } from "react"
|
import { useState } from "react"
|
||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
@@ -24,6 +24,7 @@ export default function SelectHotelMap({
|
|||||||
mapId,
|
mapId,
|
||||||
isModal,
|
isModal,
|
||||||
}: SelectHotelMapProps) {
|
}: SelectHotelMapProps) {
|
||||||
|
const searchParams = useSearchParams()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const lang = useLang()
|
const lang = useLang()
|
||||||
const intl = useIntl()
|
const intl = useIntl()
|
||||||
@@ -34,9 +35,7 @@ export default function SelectHotelMap({
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handlePageRedirect() {
|
function handlePageRedirect() {
|
||||||
router.push(
|
router.push(`${selectHotel[lang]}?${searchParams.toString()}`)
|
||||||
`${selectHotel[lang]}?${new URLSearchParams(window.location.search)}`
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const closeButton = (
|
const closeButton = (
|
||||||
|
|||||||
Reference in New Issue
Block a user