Merged in feat/SW-2241-country-map (pull request #2808)
Feat/SW-2241 country map Approved-by: Erik Tiekstra Approved-by: Chuma Mcphoy (We Ahead)
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
"use client"
|
||||
import { useEffect, useState } from "react"
|
||||
|
||||
export function setMapUrlFromCountryPage(url: string | null) {
|
||||
const [mapUrl, setMapUrl] = useState<URL | null>(null)
|
||||
|
||||
useEffect(() => {
|
||||
if (!url || typeof window === "undefined") return
|
||||
const cityMapUrl = new URL(url, window.location.origin)
|
||||
if (cityMapUrl) {
|
||||
cityMapUrl.searchParams.set("view", "map")
|
||||
cityMapUrl.searchParams.set("fromCountry", "")
|
||||
}
|
||||
setMapUrl(cityMapUrl)
|
||||
}, [])
|
||||
return mapUrl
|
||||
}
|
||||
Reference in New Issue
Block a user