Merged in feat/SW-1543-hide-join-scandic-friends-logged-in (pull request #1261)
feat(SW-1543): join scandic friends block is now hidden for logged in users Approved-by: Chuma Mcphoy (We Ahead)
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { getProfileSafely } from "@/lib/trpc/memoizedRequests"
|
||||
|
||||
import { SurpriseIcon } from "@/components/Icons"
|
||||
import Image from "@/components/Image"
|
||||
import Button from "@/components/TempDesignSystem/Button"
|
||||
@@ -15,9 +17,14 @@ interface JoinScandicFriendsProps {
|
||||
content: JoinScandicFriends
|
||||
}
|
||||
|
||||
export default function JoinScandicFriends({
|
||||
export default async function JoinScandicFriends({
|
||||
content,
|
||||
}: JoinScandicFriendsProps) {
|
||||
const session = await getProfileSafely()
|
||||
if (session) {
|
||||
return null
|
||||
}
|
||||
|
||||
const { show_header, show_usp, usp, primary_button } = content
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { Suspense } from "react"
|
||||
|
||||
import CardsGrid from "@/components/Blocks/CardsGrid"
|
||||
import CarouselCards from "@/components/Blocks/CarouselCards"
|
||||
import DynamicContent from "@/components/Blocks/DynamicContent"
|
||||
@@ -106,7 +108,11 @@ export default function Blocks({ blocks }: BlocksProps) {
|
||||
case BlocksEnums.block.FullWidthCampaign:
|
||||
return <FullWidthCampaign content={block.full_width_campaign} />
|
||||
case BlocksEnums.block.JoinScandicFriends:
|
||||
return <JoinScandicFriends content={block.join_scandic_friends} />
|
||||
return (
|
||||
<Suspense>
|
||||
<JoinScandicFriends content={block.join_scandic_friends} />
|
||||
</Suspense>
|
||||
)
|
||||
default:
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ export default async function StartPage() {
|
||||
) : null}
|
||||
</header>
|
||||
<main className={styles.main}>
|
||||
{(blocks || []).map((block, index) => {
|
||||
{blocks.map((block, index) => {
|
||||
if (block.typename === BlocksEnums.block.FullWidthCampaign) {
|
||||
return (
|
||||
<FullWidthCampaign
|
||||
|
||||
@@ -55,6 +55,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
.section:empty {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.section {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
|
||||
@@ -61,7 +61,9 @@ export const startPageSchema = z.object({
|
||||
heading: z.string(),
|
||||
hero_image: tempImageVaultAssetSchema,
|
||||
}),
|
||||
blocks: discriminatedUnionArray(blocksSchema.options).nullable(),
|
||||
blocks: discriminatedUnionArray(blocksSchema.options)
|
||||
.nullable()
|
||||
.transform((val) => val || []),
|
||||
system: systemSchema.merge(
|
||||
z.object({
|
||||
created_at: z.string(),
|
||||
|
||||
Reference in New Issue
Block a user