Merged in fix/LOY-365-promo-campaign-layout (pull request #2879)
fix(LOY-365): cleanup promo campaign page layout * fix(LOY-365): cleanup promo camppaign page layout * fix(LOY-365): proper gap * fix(LOY-365): expired campaign gap Approved-by: Matilda Landström
This commit is contained in:
@@ -8,14 +8,22 @@
|
|||||||
background: var(--Surface-Secondary-Default);
|
background: var(--Surface-Secondary-Default);
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.mainContent,
|
||||||
|
.info {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: var(--Space-x4);
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mainContent {
|
||||||
|
gap: var(--Space-x3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
gap: var(--Space-x1);
|
||||||
|
}
|
||||||
|
|
||||||
.title,
|
.title,
|
||||||
.description {
|
.description {
|
||||||
color: var(--Text-Heading);
|
color: var(--Text-Heading);
|
||||||
|
|||||||
@@ -16,33 +16,35 @@ export default async function ExpiredPromoCampaign() {
|
|||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<MagicWandIcon width={250} height={203} />
|
<MagicWandIcon width={250} height={203} />
|
||||||
|
|
||||||
<div className={styles.content}>
|
<div className={styles.mainContent}>
|
||||||
<Typography variant="Title/Subtitle/md" className={styles.title}>
|
<div className={styles.info}>
|
||||||
<h3>
|
<Typography variant="Title/Subtitle/md" className={styles.title}>
|
||||||
{intl.formatMessage({
|
<h3>
|
||||||
defaultMessage: "This promotion has expired",
|
{intl.formatMessage({
|
||||||
})}
|
defaultMessage: "This promotion has expired",
|
||||||
</h3>
|
})}
|
||||||
</Typography>
|
</h3>
|
||||||
|
</Typography>
|
||||||
|
|
||||||
<Typography
|
<Typography
|
||||||
variant="Body/Paragraph/mdRegular"
|
variant="Body/Paragraph/mdRegular"
|
||||||
className={styles.description}
|
className={styles.description}
|
||||||
>
|
>
|
||||||
<p>
|
<p>
|
||||||
{intl.formatMessage({
|
{intl.formatMessage({
|
||||||
defaultMessage:
|
defaultMessage:
|
||||||
"Don't worry, we will conjure up new exciting offers and campaigns in the future. Stay tuned!",
|
"Don't worry, we will conjure up new exciting offers and campaigns in the future. Stay tuned!",
|
||||||
})}
|
})}
|
||||||
</p>
|
</p>
|
||||||
</Typography>
|
</Typography>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ButtonLink href={offers[lang]} variant="Tertiary" size="Large">
|
||||||
|
{intl.formatMessage({
|
||||||
|
defaultMessage: "See all offers",
|
||||||
|
})}
|
||||||
|
</ButtonLink>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ButtonLink href={offers[lang]} variant="Tertiary" size="Large">
|
|
||||||
{intl.formatMessage({
|
|
||||||
defaultMessage: "See all offers",
|
|
||||||
})}
|
|
||||||
</ButtonLink>
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { cx } from "class-variance-authority"
|
||||||
import { notFound } from "next/navigation"
|
import { notFound } from "next/navigation"
|
||||||
import { Suspense } from "react"
|
import { Suspense } from "react"
|
||||||
|
|
||||||
@@ -13,6 +14,11 @@ import PromoCampaignPageSkeleton from "./PromoCampaignPageSkeleton"
|
|||||||
|
|
||||||
import styles from "./promoCampaignPage.module.css"
|
import styles from "./promoCampaignPage.module.css"
|
||||||
|
|
||||||
|
import type {
|
||||||
|
PromoCampaignPageData,
|
||||||
|
PromoHero,
|
||||||
|
} from "@scandic-hotels/trpc/types/promoCampaignPage"
|
||||||
|
|
||||||
export default async function PromoCampaignPage() {
|
export default async function PromoCampaignPage() {
|
||||||
const pageData = await getPromoCampaignPage()
|
const pageData = await getPromoCampaignPage()
|
||||||
if (!pageData) {
|
if (!pageData) {
|
||||||
@@ -30,30 +36,70 @@ export default async function PromoCampaignPage() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Suspense fallback={<PromoCampaignPageSkeleton />}>
|
<Suspense fallback={<PromoCampaignPageSkeleton />}>
|
||||||
<div className={styles.pageContainer}>
|
{isCampaignExpired ? (
|
||||||
{isCampaignExpired ? (
|
<ExpiredCampaignLayout heading={heading} />
|
||||||
<ExpiredPromoCampaign />
|
) : (
|
||||||
) : (
|
<ActiveCampaignLayout
|
||||||
<PromoCampaignHero
|
heading={heading}
|
||||||
promoHero={promo_hero}
|
subheading={subheading}
|
||||||
eligibleLevels={eligibleLevels}
|
promoHero={promo_hero}
|
||||||
/>
|
eligibleLevels={eligibleLevels}
|
||||||
)}
|
/>
|
||||||
<div className={styles.intro}>
|
)}
|
||||||
<div className={styles.headingWrapper}>
|
|
||||||
<Typography variant="Title/lg">
|
|
||||||
<h1 className={styles.heading}>{heading}</h1>
|
|
||||||
</Typography>
|
|
||||||
{subheading && !isCampaignExpired ? (
|
|
||||||
<Typography variant="Title/Subtitle/lg">
|
|
||||||
<p>{subheading}</p>
|
|
||||||
</Typography>
|
|
||||||
) : null}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</Suspense>
|
</Suspense>
|
||||||
<TrackingSDK pageData={tracking} />
|
<TrackingSDK pageData={tracking} />
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ActiveCampaignLayout({
|
||||||
|
heading,
|
||||||
|
subheading,
|
||||||
|
promoHero,
|
||||||
|
eligibleLevels,
|
||||||
|
}: {
|
||||||
|
heading: PromoCampaignPageData["heading"]
|
||||||
|
subheading: PromoCampaignPageData["subheading"]
|
||||||
|
promoHero: PromoHero
|
||||||
|
eligibleLevels: PromoCampaignPageData["eligibleLevels"]
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<div className={cx(styles.pageContainer, styles.active)}>
|
||||||
|
<PromoCampaignHero
|
||||||
|
promoHero={promoHero}
|
||||||
|
eligibleLevels={eligibleLevels}
|
||||||
|
/>
|
||||||
|
<div className={styles.intro}>
|
||||||
|
<div className={styles.headingWrapper}>
|
||||||
|
<Typography variant="Title/lg">
|
||||||
|
<h1 className={styles.heading}>{heading}</h1>
|
||||||
|
</Typography>
|
||||||
|
{subheading ? (
|
||||||
|
<Typography variant="Title/Subtitle/lg">
|
||||||
|
<p>{subheading}</p>
|
||||||
|
</Typography>
|
||||||
|
) : null}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function ExpiredCampaignLayout({
|
||||||
|
heading,
|
||||||
|
}: {
|
||||||
|
heading: PromoCampaignPageData["heading"]
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<div className={cx(styles.pageContainer, styles.expired)}>
|
||||||
|
<div className={styles.intro}>
|
||||||
|
<div className={styles.headingWrapper}>
|
||||||
|
<Typography variant="Title/lg">
|
||||||
|
<h1 className={styles.heading}>{heading}</h1>
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<ExpiredPromoCampaign />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,11 +1,18 @@
|
|||||||
.pageContainer {
|
.pageContainer {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: var(--Space-x6);
|
|
||||||
padding-bottom: var(--Space-x7);
|
padding-bottom: var(--Space-x7);
|
||||||
width: var(--max-width-content);
|
width: var(--max-width-content);
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pageContainer.active {
|
||||||
|
gap: var(--Space-x7);
|
||||||
|
}
|
||||||
|
|
||||||
|
.pageContainer.expired {
|
||||||
|
gap: var(--Space-x3);
|
||||||
|
}
|
||||||
|
|
||||||
.intro {
|
.intro {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: var(--Space-x5);
|
gap: var(--Space-x5);
|
||||||
@@ -23,7 +30,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (min-width: 1367px) {
|
@media screen and (min-width: 1367px) {
|
||||||
.pageContainer {
|
.pageContainer.active {
|
||||||
gap: var(--Space-x9);
|
gap: var(--Space-x9);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user