fix(SW-1386): sorted out width on blocks and fixed some padding stuff
This commit is contained in:
@@ -1,8 +1,10 @@
|
|||||||
|
import { assertNullableType } from "graphql"
|
||||||
import { Suspense } from "react"
|
import { Suspense } from "react"
|
||||||
|
|
||||||
import { getStartPage } from "@/lib/trpc/memoizedRequests"
|
import { getStartPage } from "@/lib/trpc/memoizedRequests"
|
||||||
|
|
||||||
import Blocks from "@/components/Blocks"
|
import Blocks from "@/components/Blocks"
|
||||||
|
import FullWidthCampaign from "@/components/Blocks/FullWidthCampaign"
|
||||||
import Image from "@/components/Image"
|
import Image from "@/components/Image"
|
||||||
import PageContainer from "@/components/PageContainer"
|
import PageContainer from "@/components/PageContainer"
|
||||||
import Title from "@/components/TempDesignSystem/Text/Title"
|
import Title from "@/components/TempDesignSystem/Text/Title"
|
||||||
@@ -10,6 +12,8 @@ import TrackingSDK from "@/components/TrackingSDK"
|
|||||||
|
|
||||||
import styles from "./startPage.module.css"
|
import styles from "./startPage.module.css"
|
||||||
|
|
||||||
|
import { BlocksEnums } from "@/types/enums/blocks"
|
||||||
|
|
||||||
export default async function StartPage() {
|
export default async function StartPage() {
|
||||||
const content = await getStartPage()
|
const content = await getStartPage()
|
||||||
if (!content) {
|
if (!content) {
|
||||||
@@ -43,13 +47,24 @@ export default async function StartPage() {
|
|||||||
) : null}
|
) : null}
|
||||||
</header>
|
</header>
|
||||||
<main className={styles.main}>
|
<main className={styles.main}>
|
||||||
{blocks ? <Blocks blocks={blocks} /> : null}
|
{blocks
|
||||||
<details
|
? blocks.map((block) => {
|
||||||
style={{ maxWidth: "100vw", overflow: "hidden", padding: "1rem 0" }}
|
if (block.typename === BlocksEnums.block.FullWidthCampaign) {
|
||||||
>
|
return (
|
||||||
<summary>JSON data</summary>
|
<FullWidthCampaign
|
||||||
<pre>{JSON.stringify(content, null, 2)}</pre>
|
key={block.typename}
|
||||||
</details>
|
content={block.full_width_campaign}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div key={block.typename} className={styles.section}>
|
||||||
|
<Blocks blocks={[block]} />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
: null}
|
||||||
</main>
|
</main>
|
||||||
<Suspense fallback={null}>
|
<Suspense fallback={null}>
|
||||||
<TrackingSDK pageData={content.tracking} />
|
<TrackingSDK pageData={content.tracking} />
|
||||||
|
|||||||
@@ -40,9 +40,19 @@
|
|||||||
|
|
||||||
.main {
|
.main {
|
||||||
display: grid;
|
display: grid;
|
||||||
width: 100%;
|
|
||||||
gap: var(--Spacing-x6);
|
gap: var(--Spacing-x6);
|
||||||
margin: 0 auto;
|
padding: calc(var(--Spacing-x5) * 2) 0 calc(var(--Spacing-x5) * 4);
|
||||||
max-width: var(--max-width-content);
|
}
|
||||||
padding: var(--Spacing-x4) 0;
|
|
||||||
|
@media screen and (min-width: 768px) {
|
||||||
|
.main {
|
||||||
|
gap: calc(var(--Spacing-x5) * 3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.section {
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
max-width: var(--max-width-content);
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import type { z } from "zod"
|
import type { z } from "zod"
|
||||||
|
|
||||||
|
import type { fullWidthCampaignSchema } from "@/server/routers/contentstack/schemas/blocks/fullWidthCampaign"
|
||||||
import type {
|
import type {
|
||||||
blocksSchema,
|
blocksSchema,
|
||||||
startPageRefsSchema,
|
startPageRefsSchema,
|
||||||
@@ -16,4 +17,6 @@ export interface StartPageRefs extends z.output<typeof startPageRefsSchema> {}
|
|||||||
|
|
||||||
export type Block = z.output<typeof blocksSchema>
|
export type Block = z.output<typeof blocksSchema>
|
||||||
|
|
||||||
export type FullWidthCampaign = Block["full_width_campaign"]
|
export type FullWidthCampaign = z.output<
|
||||||
|
typeof fullWidthCampaignSchema
|
||||||
|
>["full_width_campaign"]
|
||||||
|
|||||||
Reference in New Issue
Block a user