feat(SW-66, SW-348): search functionality and ui
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { serverClient } from "@/lib/trpc/server"
|
||||
|
||||
import { Blocks } from "@/components/Content/Blocks"
|
||||
import Sidebar from "@/components/Content/Sidebar"
|
||||
import Blocks from "@/components/Blocks"
|
||||
import Hero from "@/components/Hero"
|
||||
import Intro from "@/components/Intro"
|
||||
import Sidebar from "@/components/Sidebar"
|
||||
import Preamble from "@/components/TempDesignSystem/Text/Preamble"
|
||||
import Title from "@/components/TempDesignSystem/Text/Title"
|
||||
import TrackingSDK from "@/components/TrackingSDK"
|
||||
@@ -18,7 +18,7 @@ export default async function ContentPage() {
|
||||
}
|
||||
|
||||
const { tracking, contentPage } = contentPageRes
|
||||
const heroImage = contentPage.heroImage
|
||||
const heroImage = contentPage.hero_image
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -1,17 +1,8 @@
|
||||
import type { Facility } from "@/types/components/hotelPage/facilities"
|
||||
import type { ImageVaultAsset } from "@/types/components/imageVault"
|
||||
|
||||
type ActivityCard = {
|
||||
background_image?: ImageVaultAsset
|
||||
scripted_title?: string
|
||||
heading: string
|
||||
body_text: string
|
||||
cta_text: string
|
||||
contentPage: Array<{ href: string }>
|
||||
}
|
||||
import type { ActivityCard } from "@/types/trpc/routers/contentstack/hotelPage"
|
||||
|
||||
export function setActivityCard(activitiesCard: ActivityCard): Facility {
|
||||
const hasImage = activitiesCard.background_image
|
||||
const hasImage = !!activitiesCard.background_image
|
||||
return [
|
||||
{
|
||||
id: "activities",
|
||||
@@ -22,7 +13,7 @@ export function setActivityCard(activitiesCard: ActivityCard): Facility {
|
||||
backgroundImage: hasImage ? activitiesCard.background_image : undefined,
|
||||
primaryButton: hasImage
|
||||
? {
|
||||
href: activitiesCard.contentPage[0].href,
|
||||
href: activitiesCard.contentPage.href,
|
||||
title: activitiesCard.cta_text,
|
||||
isExternal: false,
|
||||
}
|
||||
@@ -30,7 +21,7 @@ export function setActivityCard(activitiesCard: ActivityCard): Facility {
|
||||
secondaryButton: hasImage
|
||||
? undefined
|
||||
: {
|
||||
href: activitiesCard.contentPage[0].href,
|
||||
href: activitiesCard.contentPage.href,
|
||||
title: activitiesCard.cta_text,
|
||||
isExternal: false,
|
||||
},
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { serverClient } from "@/lib/trpc/server"
|
||||
|
||||
import Blocks from "@/components/Blocks"
|
||||
import Hero from "@/components/Hero"
|
||||
import Intro from "@/components/Intro"
|
||||
import { Blocks } from "@/components/Loyalty/Blocks"
|
||||
import Sidebar from "@/components/Loyalty/Sidebar"
|
||||
import MaxWidth from "@/components/MaxWidth"
|
||||
import Sidebar from "@/components/Sidebar"
|
||||
import Preamble from "@/components/TempDesignSystem/Text/Preamble"
|
||||
import Title from "@/components/TempDesignSystem/Text/Title"
|
||||
import TrackingSDK from "@/components/TrackingSDK"
|
||||
@@ -41,7 +40,9 @@ export default async function LoyaltyPage() {
|
||||
/>
|
||||
) : null}
|
||||
</header>
|
||||
{loyaltyPage.blocks ? <Blocks blocks={loyaltyPage.blocks} /> : null}
|
||||
{loyaltyPage.blocks.length ? (
|
||||
<Blocks blocks={loyaltyPage.blocks} />
|
||||
) : null}
|
||||
</MaxWidth>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
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 TrackingSDK from "@/components/TrackingSDK"
|
||||
import LinkToOverview from "@/components/Webviews/LinkToOverview"
|
||||
import { getLang } from "@/i18n/serverContext"
|
||||
|
||||
import styles from "./accountPage.module.css"
|
||||
|
||||
export default async function MyPages() {
|
||||
const accountPageRes = await serverClient().contentstack.accountPage.get()
|
||||
|
||||
if (!accountPageRes) {
|
||||
return null
|
||||
}
|
||||
|
||||
const { tracking, accountPage } = accountPageRes
|
||||
|
||||
const linkToOverview =
|
||||
`/${getLang()}/webview${accountPage.url}` !== overview[getLang()]
|
||||
|
||||
return (
|
||||
<>
|
||||
<MaxWidth className={styles.blocks} tag="main">
|
||||
{linkToOverview ? <LinkToOverview /> : null}
|
||||
<Content content={accountPage.content} />
|
||||
</MaxWidth>
|
||||
|
||||
<TrackingSDK pageData={tracking} />
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
import { serverClient } from "@/lib/trpc/server"
|
||||
|
||||
import { Blocks } from "@/components/Loyalty/Blocks/WebView"
|
||||
import MaxWidth from "@/components/MaxWidth"
|
||||
import Title from "@/components/TempDesignSystem/Text/Title"
|
||||
import TrackingSDK from "@/components/TrackingSDK"
|
||||
import LinkToOverview from "@/components/Webviews/LinkToOverview"
|
||||
|
||||
import styles from "./loyaltyPage.module.css"
|
||||
|
||||
export default async function AboutScandicFriends() {
|
||||
const loyaltyPageRes = await serverClient().contentstack.loyaltyPage.get()
|
||||
|
||||
if (!loyaltyPageRes) {
|
||||
return null
|
||||
}
|
||||
|
||||
const { tracking, loyaltyPage } = loyaltyPageRes
|
||||
return (
|
||||
<>
|
||||
<section className={styles.content}>
|
||||
<LinkToOverview />
|
||||
<MaxWidth tag="main" className={styles.blocks}>
|
||||
<Title>{loyaltyPage.heading}</Title>
|
||||
<Blocks blocks={loyaltyPage.blocks} />
|
||||
</MaxWidth>
|
||||
</section>
|
||||
|
||||
<TrackingSDK pageData={tracking} />
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
.blocks {
|
||||
display: grid;
|
||||
gap: var(--Spacing-x5);
|
||||
padding: var(--Spacing-x2);
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
.content {
|
||||
display: grid;
|
||||
padding: var(--Spacing-x2);
|
||||
gap: var(--Spacing-x5);
|
||||
}
|
||||
|
||||
.blocks {
|
||||
display: grid;
|
||||
gap: var(--Spacing-x5);
|
||||
}
|
||||
Reference in New Issue
Block a user