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"
|
||||
import HotelCardListing from "@/components/HotelReservation/HotelCardListing"
|
||||
import HotelFilter from "@/components/HotelReservation/SelectHotel/HotelFilter"
|
||||
import MobileButtonContainer from "@/components/HotelReservation/SelectHotel/MobileButtonContainer"
|
||||
import MobileMapButtonContainer from "@/components/HotelReservation/SelectHotel/MobileMapButtonContainer"
|
||||
import {
|
||||
generateChildrenString,
|
||||
getHotelReservationQueryParams,
|
||||
@@ -84,7 +84,7 @@ export default async function SelectHotelPage({
|
||||
<ChevronRightIcon color="burgundy" />
|
||||
</Link>
|
||||
</div>
|
||||
<MobileButtonContainer city={searchParams.city} />
|
||||
<MobileMapButtonContainer city={searchParams.city} />
|
||||
<HotelFilter filters={filterList} />
|
||||
</section>
|
||||
<HotelCardListing hotelData={hotels} />
|
||||
|
||||
@@ -9,9 +9,9 @@ import Button from "@/components/TempDesignSystem/Button"
|
||||
import Link from "@/components/TempDesignSystem/Link"
|
||||
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 lang = useLang()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client"
|
||||
import { APIProvider } from "@vis.gl/react-google-maps"
|
||||
import { useRouter } from "next/navigation"
|
||||
import { useRouter, useSearchParams } from "next/navigation"
|
||||
import { useState } from "react"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
@@ -24,6 +24,7 @@ export default function SelectHotelMap({
|
||||
mapId,
|
||||
isModal,
|
||||
}: SelectHotelMapProps) {
|
||||
const searchParams = useSearchParams()
|
||||
const router = useRouter()
|
||||
const lang = useLang()
|
||||
const intl = useIntl()
|
||||
@@ -34,9 +35,7 @@ export default function SelectHotelMap({
|
||||
}
|
||||
|
||||
function handlePageRedirect() {
|
||||
router.push(
|
||||
`${selectHotel[lang]}?${new URLSearchParams(window.location.search)}`
|
||||
)
|
||||
router.push(`${selectHotel[lang]}?${searchParams.toString()}`)
|
||||
}
|
||||
|
||||
const closeButton = (
|
||||
|
||||
Reference in New Issue
Block a user