fix(SW-190): styling fixes
This commit is contained in:
@@ -19,7 +19,7 @@ export default async function ContentTypePage({
|
|||||||
|
|
||||||
switch (params.contentType) {
|
switch (params.contentType) {
|
||||||
case "content-page":
|
case "content-page":
|
||||||
return <ContentPage lang={params.lang} />
|
return <ContentPage />
|
||||||
case "loyalty-page":
|
case "loyalty-page":
|
||||||
return <LoyaltyPage />
|
return <LoyaltyPage />
|
||||||
case "hotel-page":
|
case "hotel-page":
|
||||||
|
|||||||
@@ -9,9 +9,7 @@ import Intro from "./Intro"
|
|||||||
|
|
||||||
import styles from "./contentPage.module.css"
|
import styles from "./contentPage.module.css"
|
||||||
|
|
||||||
import type { LangParams } from "@/types/params"
|
export default async function ContentPage() {
|
||||||
|
|
||||||
export default async function ContentPage({ lang }: LangParams) {
|
|
||||||
const contentPageRes = await serverClient().contentstack.contentPage.get()
|
const contentPageRes = await serverClient().contentstack.contentPage.get()
|
||||||
|
|
||||||
if (!contentPageRes) {
|
if (!contentPageRes) {
|
||||||
@@ -23,7 +21,7 @@ export default async function ContentPage({ lang }: LangParams) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<section>
|
<section className={styles.content}>
|
||||||
<header className={styles.header}>
|
<header className={styles.header}>
|
||||||
<Intro>
|
<Intro>
|
||||||
<Title as="h2">{contentPage.header.heading}</Title>
|
<Title as="h2">{contentPage.header.heading}</Title>
|
||||||
|
|||||||
@@ -6,17 +6,15 @@ import styles from "./intro.module.css"
|
|||||||
|
|
||||||
export default async function Intro({ children }: PropsWithChildren) {
|
export default async function Intro({ children }: PropsWithChildren) {
|
||||||
return (
|
return (
|
||||||
<div className={styles.intro}>
|
<MaxWidth variant="content" tag="div">
|
||||||
<MaxWidth variant="content" tag="div">
|
<MaxWidth
|
||||||
<MaxWidth
|
className={styles.content}
|
||||||
className={styles.content}
|
variant="text"
|
||||||
variant="text"
|
align="left"
|
||||||
align="left"
|
tag="div"
|
||||||
tag="div"
|
>
|
||||||
>
|
{children}
|
||||||
{children}
|
|
||||||
</MaxWidth>
|
|
||||||
</MaxWidth>
|
</MaxWidth>
|
||||||
</div>
|
</MaxWidth>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
.intro {
|
|
||||||
padding: var(--Spacing-x4) var(--Spacing-x2);
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: var(--Spacing-x3);
|
gap: var(--Spacing-x2);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
.content {
|
||||||
|
gap: var(--Spacing-x3);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
.content {
|
.content {
|
||||||
|
position: relative;
|
||||||
display: grid;
|
display: grid;
|
||||||
padding-bottom: var(--Spacing-x9);
|
padding-bottom: var(--Spacing-x9);
|
||||||
position: relative;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: flex-start;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
background-color: var(--Base-Surface-Subtle-Normal);
|
background-color: var(--Base-Surface-Subtle-Normal);
|
||||||
|
padding: var(--Spacing-x4) var(--Spacing-x2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.hero {
|
.hero {
|
||||||
|
|||||||
20
components/ContentType/LoyaltyPage/Intro/index.tsx
Normal file
20
components/ContentType/LoyaltyPage/Intro/index.tsx
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
import { PropsWithChildren } from "react"
|
||||||
|
|
||||||
|
import MaxWidth from "@/components/MaxWidth"
|
||||||
|
|
||||||
|
import styles from "./intro.module.css"
|
||||||
|
|
||||||
|
export default async function Intro({ children }: PropsWithChildren) {
|
||||||
|
return (
|
||||||
|
<MaxWidth variant="content" tag="div">
|
||||||
|
<MaxWidth
|
||||||
|
className={styles.content}
|
||||||
|
variant="text"
|
||||||
|
align="left"
|
||||||
|
tag="div"
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</MaxWidth>
|
||||||
|
</MaxWidth>
|
||||||
|
)
|
||||||
|
}
|
||||||
10
components/ContentType/LoyaltyPage/Intro/intro.module.css
Normal file
10
components/ContentType/LoyaltyPage/Intro/intro.module.css
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
.content {
|
||||||
|
display: grid;
|
||||||
|
gap: var(--Spacing-x2);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
.content {
|
||||||
|
gap: var(--Spacing-x3);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,14 +4,15 @@ import { Blocks } from "@/components/Loyalty/Blocks"
|
|||||||
import Sidebar from "@/components/Loyalty/Sidebar"
|
import Sidebar from "@/components/Loyalty/Sidebar"
|
||||||
import MaxWidth from "@/components/MaxWidth"
|
import MaxWidth from "@/components/MaxWidth"
|
||||||
import Hero from "@/components/TempDesignSystem/Hero"
|
import Hero from "@/components/TempDesignSystem/Hero"
|
||||||
|
import Preamble from "@/components/TempDesignSystem/Text/Preamble"
|
||||||
import Title from "@/components/TempDesignSystem/Text/Title"
|
import Title from "@/components/TempDesignSystem/Text/Title"
|
||||||
import TrackingSDK from "@/components/TrackingSDK"
|
import TrackingSDK from "@/components/TrackingSDK"
|
||||||
|
|
||||||
|
import Intro from "./Intro"
|
||||||
|
|
||||||
import styles from "./loyaltyPage.module.css"
|
import styles from "./loyaltyPage.module.css"
|
||||||
|
|
||||||
import type { LangParams } from "@/types/params"
|
export default async function LoyaltyPage() {
|
||||||
|
|
||||||
export default async function LoyaltyPage({ lang }: LangParams) {
|
|
||||||
const loyaltyPageRes = await serverClient().contentstack.loyaltyPage.get()
|
const loyaltyPageRes = await serverClient().contentstack.loyaltyPage.get()
|
||||||
|
|
||||||
if (!loyaltyPageRes) {
|
if (!loyaltyPageRes) {
|
||||||
@@ -27,9 +28,15 @@ export default async function LoyaltyPage({ lang }: LangParams) {
|
|||||||
<Sidebar blocks={loyaltyPage.sidebar} />
|
<Sidebar blocks={loyaltyPage.sidebar} />
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
<MaxWidth className={styles.blocks} tag="main">
|
<MaxWidth className={styles.blocks} variant="content" tag="main">
|
||||||
<header className={styles.header}>
|
<header className={styles.header}>
|
||||||
<Title>{loyaltyPage.heading}</Title>
|
<Intro>
|
||||||
|
<Title as="h2">{loyaltyPage.heading}</Title>
|
||||||
|
{loyaltyPage.preamble ? (
|
||||||
|
<Preamble>{loyaltyPage.preamble}</Preamble>
|
||||||
|
) : null}
|
||||||
|
</Intro>
|
||||||
|
|
||||||
{heroImage ? (
|
{heroImage ? (
|
||||||
<Hero
|
<Hero
|
||||||
alt={heroImage.meta.alt || heroImage.meta.caption || ""}
|
alt={heroImage.meta.alt || heroImage.meta.caption || ""}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
.container {
|
.container {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
max-width: 100%;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.container.default {
|
.container.default {
|
||||||
@@ -16,5 +18,4 @@
|
|||||||
|
|
||||||
.container.center {
|
.container.center {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
width: 100vh;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,14 @@
|
|||||||
.hero {
|
.hero {
|
||||||
height: 480px;
|
height: 400px;
|
||||||
margin-bottom: var(--Spacing-x2);
|
margin-bottom: var(--Spacing-x2);
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
border-radius: var(--Corner-radius-Medium);
|
border-radius: var(--Corner-radius-xLarge);
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
.hero {
|
||||||
|
height: 480px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -17,6 +17,18 @@ fragment ContentPageBreadcrumbs on ContentPage {
|
|||||||
}
|
}
|
||||||
url
|
url
|
||||||
}
|
}
|
||||||
|
... on LoyaltyPage {
|
||||||
|
web {
|
||||||
|
breadcrumbs {
|
||||||
|
title
|
||||||
|
}
|
||||||
|
}
|
||||||
|
system {
|
||||||
|
locale
|
||||||
|
uid
|
||||||
|
}
|
||||||
|
url
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user