Merged in feat/webviews (pull request #198)

Feat/webviews

Approved-by: Michael Zetterberg
This commit is contained in:
Christel Westerberg
2024-05-30 13:51:35 +00:00
committed by Michael Zetterberg
32 changed files with 561 additions and 127 deletions

View File

@@ -0,0 +1,26 @@
import "@/app/globals.css"
import "@scandic-hotels/design-system/style.css"
import { overview } from "@/constants/routes/webviews"
import { serverClient } from "@/lib/trpc/server"
import MaxWidth from "@/components/MaxWidth"
import Content from "@/components/MyPages/AccountPage/Webview/Content"
import LinkToOverview from "@/components/Webviews/LinkToOverview"
import styles from "./accountPage.module.css"
import { LangParams } from "@/types/params"
export default async function MyPages({ lang }: LangParams) {
const accountPage = await serverClient().contentstack.accountPage.get()
const linkToOverview = `/${lang}/webview${accountPage.url}` !== overview[lang]
return (
<MaxWidth className={styles.blocks} tag="main">
{linkToOverview ? <LinkToOverview lang={lang} /> : null}
<Content lang={lang} content={accountPage.content} />
</MaxWidth>
)
}

View File

@@ -0,0 +1,29 @@
import { serverClient } from "@/lib/trpc/server"
import { Blocks } from "@/components/Loyalty/Blocks/WebView"
import Sidebar from "@/components/Loyalty/Sidebar"
import MaxWidth from "@/components/MaxWidth"
import LinkToOverview from "@/components/Webviews/LinkToOverview"
import styles from "./loyaltyPage.module.css"
import { LangParams } from "@/types/params"
export default async function AboutScandicFriends({ lang }: LangParams) {
const loyaltyPage = await serverClient().contentstack.loyaltyPage.get()
return (
<section className={styles.content}>
<LinkToOverview lang={lang} />
{loyaltyPage.sidebar ? (
<section className={styles.sidebar}>
<Sidebar blocks={loyaltyPage.sidebar} />
</section>
) : null}
<MaxWidth tag="main">
<Blocks blocks={loyaltyPage.blocks} lang={lang} />
</MaxWidth>
</section>
)
}

View File

@@ -0,0 +1,5 @@
.blocks {
display: grid;
gap: var(--Spacing-x5);
padding: var(--Spacing-x2);
}

View File

@@ -0,0 +1,10 @@
.content {
display: grid;
padding: var(--Spacing-x2);
gap: var(--Spacing-x5);
}
.sidebar {
margin-left: calc(var(--Spacing-x2) * -1);
margin-right: calc(var(--Spacing-x2) * -1);
}