feat(BOOK-743): Replaced deprecated Button component
Approved-by: Bianca Widstam
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
"use client"
|
||||
|
||||
import { useSearchParams } from "next/navigation"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import {
|
||||
alternativeHotelsMap,
|
||||
selectHotelMap,
|
||||
} from "@scandic-hotels/common/constants/routes/hotelReservation"
|
||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||
import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton"
|
||||
import Link from "@scandic-hotels/design-system/OldDSLink"
|
||||
import ButtonLink from "@scandic-hotels/design-system/ButtonLink"
|
||||
|
||||
import useLang from "../../../hooks/useLang"
|
||||
import FilterAndSortModal from "../Filters/FilterAndSortModal"
|
||||
@@ -26,30 +25,25 @@ export default function MobileMapButtonContainer({
|
||||
}) {
|
||||
const intl = useIntl()
|
||||
const lang = useLang()
|
||||
const searchParams = useSearchParams()
|
||||
|
||||
const url = isAlternative ? alternativeHotelsMap(lang) : selectHotelMap(lang)
|
||||
const search = searchParams.toString()
|
||||
const href = search ? `${url}?${search}` : url
|
||||
|
||||
return (
|
||||
<div className={styles.buttonContainer}>
|
||||
<Button
|
||||
asChild
|
||||
theme="base"
|
||||
variant="icon"
|
||||
intent="secondary"
|
||||
size="small"
|
||||
<ButtonLink
|
||||
variant="Secondary"
|
||||
href={href}
|
||||
size="sm"
|
||||
leadingIconName="map"
|
||||
>
|
||||
<Link
|
||||
href={
|
||||
isAlternative ? alternativeHotelsMap(lang) : selectHotelMap(lang)
|
||||
}
|
||||
keepSearchParams
|
||||
weight="bold"
|
||||
>
|
||||
<MaterialIcon icon="map" color="CurrentColor" />
|
||||
{intl.formatMessage({
|
||||
id: "destination.seeOnMap",
|
||||
defaultMessage: "See on map",
|
||||
})}
|
||||
</Link>
|
||||
</Button>
|
||||
{intl.formatMessage({
|
||||
id: "destination.seeOnMap",
|
||||
defaultMessage: "See on map",
|
||||
})}
|
||||
</ButtonLink>
|
||||
<FilterAndSortModal filters={filters} />
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user