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

@@ -10,7 +10,8 @@ import { LoyaltyBlocksTypenameEnum } from "@/types/components/loyalty/enums"
import { LangParams } from "@/types/params"
export function Blocks({ lang, blocks }: BlocksProps & LangParams) {
return blocks.map((block) => {
return blocks.map((block, idx) => {
const firstItem = idx === 0
switch (block.__typename) {
case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksCardsGrid:
return <CardsGrid cards_grid={block.cards_grid} />
@@ -34,7 +35,12 @@ export function Blocks({ lang, blocks }: BlocksProps & LangParams) {
: undefined,
}
return <DynamicContentBlock dynamicContent={dynamicContent} />
return (
<DynamicContentBlock
dynamicContent={dynamicContent}
firstItem={firstItem}
/>
)
case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksShortcuts:
const shortcuts = block.shortcuts.shortcuts.map((shortcut) => ({
...shortcut,
@@ -42,6 +48,7 @@ export function Blocks({ lang, blocks }: BlocksProps & LangParams) {
}))
return (
<Shortcuts
firstItem={firstItem}
shortcuts={shortcuts}
title={block.shortcuts.title}
subtitle={block.shortcuts.preamble}