Merged in feat/webviews (pull request #198)
Feat/webviews Approved-by: Michael Zetterberg
This commit is contained in:
26
components/ContentType/Webviews/AccountPage.tsx
Normal file
26
components/ContentType/Webviews/AccountPage.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
29
components/ContentType/Webviews/LoyaltyPage.tsx
Normal file
29
components/ContentType/Webviews/LoyaltyPage.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
5
components/ContentType/Webviews/accountPage.module.css
Normal file
5
components/ContentType/Webviews/accountPage.module.css
Normal file
@@ -0,0 +1,5 @@
|
||||
.blocks {
|
||||
display: grid;
|
||||
gap: var(--Spacing-x5);
|
||||
padding: var(--Spacing-x2);
|
||||
}
|
||||
10
components/ContentType/Webviews/loyaltyPage.module.css
Normal file
10
components/ContentType/Webviews/loyaltyPage.module.css
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user