SW-3270 move interactive map to design system or booking flow * wip * wip * merge * wip * add support for locales in design-system * add story for HotelCard * setup alias * . * remove tracking from design-system for hotelcard * pass isUserLoggedIn * export design-system-new-deprecated.css from design-system * Add HotelMarkerByType to Storybook * Add interactive map to Storybook * fix reactintl in vitest * rename env variables * . * fix background colors * add storybook stories for <Link /> * merge * fix tracking for when clicking 'See rooms' in InteractiveMap * Merge branch 'master' of bitbucket.org:scandic-swap/web into SW-3270-move-interactive-map-to-design-system-or-booking-flow * remove deprecated comment Approved-by: Anton Gunnarsson
33 lines
885 B
TypeScript
33 lines
885 B
TypeScript
import { ArrowLeft } from "react-feather"
|
|
|
|
import Link from "@scandic-hotels/design-system/Link"
|
|
|
|
import { overview } from "@/constants/routes/webviews"
|
|
import { env } from "@/env/server"
|
|
|
|
import { getIntl } from "@/i18n"
|
|
import { getLang } from "@/i18n/serverContext"
|
|
import { webviewSearchParams } from "@/utils/webviews"
|
|
|
|
import styles from "./linkToOverview.module.css"
|
|
|
|
export default async function LinkToOverview() {
|
|
if (!env.WEBVIEW_SHOW_OVERVIEW) {
|
|
return null
|
|
}
|
|
|
|
const intl = await getIntl()
|
|
const searchParams = await webviewSearchParams()
|
|
|
|
const lang = await getLang()
|
|
const overviewHref = `${overview[lang]}?${searchParams.toString()}`
|
|
return (
|
|
<Link className={styles.overviewLink} href={overviewHref}>
|
|
<ArrowLeft height={20} width={20} />
|
|
{intl.formatMessage({
|
|
defaultMessage: "Go back to overview",
|
|
})}
|
|
</Link>
|
|
)
|
|
}
|