feat(WEB-304): remaning UI from design system primitives

This commit is contained in:
Simon Emanuelsson
2024-06-07 10:36:23 +02:00
parent 6737970f54
commit 7c4b8401e9
228 changed files with 3516 additions and 3237 deletions

View File

@@ -8,7 +8,8 @@ import type { BlocksProps } from "@/types/components/loyalty/blocks"
import { LoyaltyBlocksTypenameEnum } from "@/types/components/loyalty/enums"
export function Blocks({ blocks }: BlocksProps) {
return blocks.map((block) => {
return blocks.map((block, idx) => {
const firstItem = idx === 0
switch (block.__typename) {
case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksContent:
return (
@@ -20,10 +21,16 @@ export function Blocks({ blocks }: BlocksProps) {
</section>
)
case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksDynamicContent:
return <DynamicContentBlock dynamicContent={block.dynamic_content} />
return (
<DynamicContentBlock
dynamicContent={block.dynamic_content}
firstItem={firstItem}
/>
)
case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksShortcuts:
return (
<Shortcuts
firstItem={firstItem}
shortcuts={block.shortcuts.shortcuts}
subtitle={block.shortcuts.preamble}
title={block.shortcuts.title}