feat(SW-343): rename button and useSearchParams

This commit is contained in:
Pontus Dreij
2024-11-06 08:55:46 +01:00
parent 399c23ea02
commit 32a5b8f3aa
4 changed files with 7 additions and 8 deletions

View File

@@ -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 = (