Files
web/app/[lang]/(partner)/(sas)/(protected)/sas-x-scandic/layout.tsx
Joakim Jäderberg 46ebbbba8f Merged in feature/sas-login (pull request #1256)
First steps towards the SAS partnership

* otp flow now pretends to do the linking

* Update LinkAccountForm header

* Update redirect times

* Clean up comments

* Set maxAge on sas cookies

* make all SAS routes protected

* Merge remote-tracking branch 'refs/remotes/origin/feature/sas-login' into feature/sas-login

* Require auth for sas link flow

* Fix resend otp

* Add error support to OneTimePasswordForm

* Add Sentry to SAS error boundary

* Move SAS_REQUEST_OTP_STATE_STORAGE_COOKIE_NAME

* Add missing translations

* Merge branch 'master' of bitbucket.org:scandic-swap/web into feature/sas-login

* Merge branch 'feature/sas-login' of bitbucket.org:scandic-swap/web into feature/sas-login

* Add TooManyCodesError component

* Refactor GenericError to support new errors

* Add FailedAttemptsError

* remove removed component <VWOScript/>

* Merge branch 'feature/sas-login' of bitbucket.org:scandic-swap/web into feature/sas-login

* remove local cookie-bot reference

* Fix sas campaign logo scaling

* feature toggle the SAS stuff

* Merge branch 'feature/sas-login' of bitbucket.org:scandic-swap/web into feature/sas-login

* fix: use env vars for SAS endpoints


Approved-by: Linus Flood
2025-02-05 14:43:14 +00:00

64 lines
1.8 KiB
TypeScript

import { ArrowLeft } from "react-feather"
import { overview as profileOverview } from "@/constants/routes/myPages"
import Image from "@/components/Image"
import { ProtectedLayout } from "@/components/ProtectedLayout"
import Link from "@/components/TempDesignSystem/Link"
import { getIntl } from "@/i18n"
import background from "@/public/_static/img/partner/sas/sas_x_scandic_airplane_window_background.jpg"
import styles from "./layout.module.css"
import type { PropsWithChildren } from "react"
import type { LangParams, LayoutArgs } from "@/types/params"
export default async function SasXScandicLayout({
children,
params,
}: PropsWithChildren<LayoutArgs<LangParams>>) {
const intl = await getIntl()
return (
<div
className={styles.layout}
style={{ backgroundImage: `url(${background.src})` }}
>
<header className={styles.header}>
{/* TODO should this link to my-pages sas page? */}
<Link className={styles.backLink} href={profileOverview[params.lang]}>
<ArrowLeft height={20} width={20} />
<span className={styles.long}>
{intl.formatMessage({ id: "Back to Scandichotels.com" })}
</span>
<span className={styles.short}>
{intl.formatMessage({ id: "Back" })}
</span>
</Link>
<MainMenuLogo />
</header>
<section className={styles.content}>{children}</section>
</div>
)
}
async function MainMenuLogo() {
const intl = await getIntl()
return <Logo alt={intl.formatMessage({ id: "Back to scandichotels.com" })} />
}
function Logo({ alt }: { alt: string }) {
return (
<Image
alt={alt}
className={styles.logo}
height={22}
src="/_static/img/scandic-logotype.svg"
priority
width={103}
/>
)
}