fix(BOOK-138): Added underline to explore city link
fix(BOOK-138): removed duplicate back to cities button on mobile Approved-by: Matilda Landström
This commit is contained in:
@@ -1,10 +0,0 @@
|
|||||||
.backToCities {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (min-width: 950px) {
|
|
||||||
.backToCities {
|
|
||||||
display: flex;
|
|
||||||
margin-bottom: var(--Space-x2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
"use client"
|
|
||||||
import { useRouter } from "next/navigation"
|
|
||||||
import { useIntl } from "react-intl"
|
|
||||||
|
|
||||||
import { Button } from "@scandic-hotels/design-system/Button"
|
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
|
||||||
|
|
||||||
import styles from "./backToCitiesLink.module.css"
|
|
||||||
|
|
||||||
export function BackToCities() {
|
|
||||||
const intl = useIntl()
|
|
||||||
const router = useRouter()
|
|
||||||
|
|
||||||
function handleGoBack() {
|
|
||||||
router.back()
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Button
|
|
||||||
typography="Body/Paragraph/mdBold"
|
|
||||||
variant="Text"
|
|
||||||
color="Primary"
|
|
||||||
className={styles.backToCities}
|
|
||||||
onClick={handleGoBack}
|
|
||||||
>
|
|
||||||
<MaterialIcon icon="arrow_back" color="CurrentColor" size={24} />
|
|
||||||
<span>{intl.formatMessage({ defaultMessage: "Back to cities" })}</span>
|
|
||||||
</Button>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -2,8 +2,14 @@
|
|||||||
color: var(--Text-Heading);
|
color: var(--Text-Heading);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.topSection {
|
||||||
|
display: grid;
|
||||||
|
gap: var(--Space-x2);
|
||||||
|
justify-items: start;
|
||||||
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 949px) {
|
@media screen and (max-width: 949px) {
|
||||||
.title {
|
.topSection {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
"use client"
|
"use client"
|
||||||
import { useParams } from "next/navigation"
|
import { useParams, useRouter } from "next/navigation"
|
||||||
import { useEffect, useState } from "react"
|
import { useEffect, useState } from "react"
|
||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
|
import { Button } from "@scandic-hotels/design-system/Button"
|
||||||
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
|
||||||
import { useDestinationDataStore } from "@/stores/destination-data"
|
import { useDestinationDataStore } from "@/stores/destination-data"
|
||||||
|
|
||||||
import CityMapContainer from "../../Map/CityMapContainer"
|
import CityMapContainer from "../../Map/CityMapContainer"
|
||||||
import { getHeadingText } from "../../utils"
|
import { getHeadingText } from "../../utils"
|
||||||
import { BackToCities } from "./BackToCitiesLink"
|
|
||||||
import HotelList from "./HotelList"
|
import HotelList from "./HotelList"
|
||||||
|
|
||||||
import styles from "./cityMap.module.css"
|
import styles from "./cityMap.module.css"
|
||||||
@@ -32,6 +33,7 @@ export default function CityMap({
|
|||||||
defaultLocation,
|
defaultLocation,
|
||||||
}: CityMapProps) {
|
}: CityMapProps) {
|
||||||
const intl = useIntl()
|
const intl = useIntl()
|
||||||
|
const router = useRouter()
|
||||||
const { activeHotels, activeSeoFilter } = useDestinationDataStore(
|
const { activeHotels, activeSeoFilter } = useDestinationDataStore(
|
||||||
(state) => ({
|
(state) => ({
|
||||||
activeHotels: state.activeHotels,
|
activeHotels: state.activeHotels,
|
||||||
@@ -46,6 +48,10 @@ export default function CityMap({
|
|||||||
setIsFromCountryPage(url.searchParams.has("fromCountry"))
|
setIsFromCountryPage(url.searchParams.has("fromCountry"))
|
||||||
}, [params])
|
}, [params])
|
||||||
|
|
||||||
|
function handleGoBack() {
|
||||||
|
router.back()
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CityMapContainer
|
<CityMapContainer
|
||||||
hotels={activeHotels}
|
hotels={activeHotels}
|
||||||
@@ -53,14 +59,26 @@ export default function CityMap({
|
|||||||
apiKey={apiKey}
|
apiKey={apiKey}
|
||||||
defaultLocation={defaultLocation}
|
defaultLocation={defaultLocation}
|
||||||
>
|
>
|
||||||
<span className="topSection">
|
<div className={styles.topSection}>
|
||||||
{fromCountryPage ? <BackToCities /> : null}
|
{fromCountryPage ? (
|
||||||
|
<Button
|
||||||
|
typography="Body/Paragraph/mdBold"
|
||||||
|
variant="Text"
|
||||||
|
color="Primary"
|
||||||
|
onClick={handleGoBack}
|
||||||
|
>
|
||||||
|
<MaterialIcon icon="arrow_back" color="CurrentColor" size={24} />
|
||||||
|
<span>
|
||||||
|
{intl.formatMessage({ defaultMessage: "Back to cities" })}
|
||||||
|
</span>
|
||||||
|
</Button>
|
||||||
|
) : null}
|
||||||
<Typography variant="Title/sm">
|
<Typography variant="Title/sm">
|
||||||
<h1 className={styles.title}>
|
<h1 className={styles.title}>
|
||||||
{getHeadingText(intl, city.name, "city", activeSeoFilter)}
|
{getHeadingText(intl, city.name, "city", activeSeoFilter)}
|
||||||
</h1>
|
</h1>
|
||||||
</Typography>
|
</Typography>
|
||||||
</span>
|
</div>
|
||||||
<HotelList />
|
<HotelList />
|
||||||
</CityMapContainer>
|
</CityMapContainer>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -96,7 +96,12 @@ export default function CityMapCard({
|
|||||||
</Typography>
|
</Typography>
|
||||||
</ButtonLink>
|
</ButtonLink>
|
||||||
|
|
||||||
<Link href={url} className={styles.exploreLink} size="small">
|
<Link
|
||||||
|
href={url}
|
||||||
|
className={styles.exploreLink}
|
||||||
|
size="small"
|
||||||
|
textDecoration="underline"
|
||||||
|
>
|
||||||
{intl.formatMessage({
|
{intl.formatMessage({
|
||||||
defaultMessage: "Explore city",
|
defaultMessage: "Explore city",
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -104,7 +104,12 @@ export function CityListItem({
|
|||||||
<h3>{cityName}</h3>
|
<h3>{cityName}</h3>
|
||||||
</Typography>
|
</Typography>
|
||||||
<div>
|
<div>
|
||||||
<Link href={url} className={styles.exploreLink} size="small">
|
<Link
|
||||||
|
href={url}
|
||||||
|
className={styles.exploreLink}
|
||||||
|
size="small"
|
||||||
|
textDecoration="underline"
|
||||||
|
>
|
||||||
{intl.formatMessage({
|
{intl.formatMessage({
|
||||||
defaultMessage: "Explore city",
|
defaultMessage: "Explore city",
|
||||||
})}
|
})}
|
||||||
|
|||||||
Reference in New Issue
Block a user