Merged in feat/env-cleanup (pull request #3076)

feat(SW-3594): webviews - remove unused "Back to overview" link

* feat(SW-3594): remove unused component


Approved-by: Bianca Widstam
This commit is contained in:
Linus Flood
2025-11-12 07:53:44 +00:00
parent a96497f7c9
commit c8cc4138b5
5 changed files with 0 additions and 55 deletions

View File

@@ -1,13 +1,10 @@
import { TrackingSDK } from "@scandic-hotels/tracking/TrackingSDK"
import { overview } from "@/constants/routes/webviews"
import { serverClient } from "@/lib/trpc/server"
import MaxWidth from "@/components/MaxWidth"
import Surprises from "@/components/MyPages/Surprises"
import Blocks from "@/components/Webviews/AccountPage/Blocks"
import LinkToOverview from "@/components/Webviews/LinkToOverview"
import { getLang } from "@/i18n/serverContext"
import styles from "./accountPage.module.css"
@@ -21,13 +18,9 @@ export default async function AccountPage() {
const { tracking, accountPage } = accountPageRes
const lang = await getLang()
const linkToOverview = `/${lang}/webview${accountPage.url}` !== overview[lang]
return (
<>
<MaxWidth className={styles.blocks} tag="main">
{linkToOverview ? <LinkToOverview /> : null}
<Blocks content={accountPage.content} />
</MaxWidth>

View File

@@ -1,33 +0,0 @@
import { ArrowLeft } from "react-feather"
import Link from "@scandic-hotels/design-system/OldDSLink"
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({
id: "webviews.goBackToOverview",
defaultMessage: "Go back to overview",
})}
</Link>
)
}

View File

@@ -1,7 +0,0 @@
.overviewLink {
align-items: center;
color: var(--Scandic-Brand-Burgundy);
display: flex;
font-size: var(--Spacing-x2);
gap: var(--Spacing-x1);
}

View File

@@ -4,7 +4,6 @@ import { TrackingSDK } from "@scandic-hotels/tracking/TrackingSDK"
import { serverClient } from "@/lib/trpc/server"
import MaxWidth from "@/components/MaxWidth"
import LinkToOverview from "@/components/Webviews/LinkToOverview"
import Blocks from "./Blocks"
@@ -22,7 +21,6 @@ export default async function AboutScandicFriends() {
return (
<>
<section className={styles.content}>
<LinkToOverview />
<MaxWidth tag="main" className={styles.blocks}>
<Title>{loyaltyPage.heading}</Title>
<Blocks blocks={loyaltyPage.blocks} />