Merged develop into fix/cta-join-contact

This commit is contained in:
Christel Westerberg
2024-07-05 13:33:57 +00:00
4 changed files with 22 additions and 9 deletions

View File

@@ -3,6 +3,9 @@ import "@scandic-hotels/design-system/style.css"
import TrpcProvider from "@/lib/trpc/Provider"
import { getIntl } from "@/i18n"
import ServerIntlProvider from "@/i18n/Provider"
import styles from "./layout.module.css"
import type { Metadata } from "next"
@@ -13,14 +16,17 @@ export const metadata: Metadata = {
title: "Webview",
}
export default function RootLayout({
export default async function RootLayout({
children,
params,
}: React.PropsWithChildren<LayoutArgs<LangParams>>) {
const { defaultLocale, locale, messages } = await getIntl()
return (
<html lang={params.lang}>
<body className={styles.layout}>
<TrpcProvider lang={params.lang}>{children}</TrpcProvider>
<ServerIntlProvider intl={{ defaultLocale, locale, messages }}>
<TrpcProvider lang={params.lang}>{children}</TrpcProvider>
</ServerIntlProvider>
</body>
</html>
)

View File

@@ -19,13 +19,11 @@ export default async function AboutScandicFriends({ lang }: LangParams) {
<section className={styles.content}>
<LinkToOverview lang={lang} />
{loyaltyPage.sidebar ? (
<section className={styles.sidebar}>
<Sidebar blocks={loyaltyPage.sidebar} lang={lang} />
</section>
{loyaltyPage.sidebar.length ? (
<Sidebar blocks={loyaltyPage.sidebar} lang={lang} />
) : null}
<MaxWidth tag="main">
<MaxWidth tag="main" className={styles.blocks}>
<Title>{loyaltyPage.heading}</Title>
<Blocks blocks={loyaltyPage.blocks} lang={lang} />
</MaxWidth>

View File

@@ -8,3 +8,8 @@
margin-left: calc(var(--Spacing-x2) * -1);
margin-right: calc(var(--Spacing-x2) * -1);
}
.blocks {
display: grid;
gap: var(--Spacing-x5);
}

View File

@@ -23,7 +23,7 @@ function DynamicComponent({ component, props }: AccountPageContentProps) {
return (
<Overview
lang={props.lang}
link={undefined}
link={props.link}
subtitle={null}
title={props.title}
/>
@@ -56,7 +56,11 @@ export default function Content({ lang, content }: ContentProps) {
href:
item.dynamic_content.link.linkConnection.edges[0].node
.original_url ||
`/${lang}/webview${item.dynamic_content.link.linkConnection.edges[0].node.url}`,
modWebviewLink(
item.dynamic_content.link.linkConnection.edges[0].node
.url,
lang
),
text: item.dynamic_content.link.link_text,
}
: null