fix: add headers correctly
This commit is contained in:
@@ -3,7 +3,7 @@ import DynamicContentBlock from "@/components/Loyalty/Blocks/DynamicContent"
|
||||
import Shortcuts from "@/components/MyPages/Blocks/Shortcuts"
|
||||
import { modWebviewLink } from "@/utils/webviews"
|
||||
|
||||
import CardGrid from "../CardGrid"
|
||||
import CardsGrid from "../CardsGrid"
|
||||
|
||||
import type { BlocksProps } from "@/types/components/loyalty/blocks"
|
||||
import { LoyaltyBlocksTypenameEnum } from "@/types/components/loyalty/enums"
|
||||
@@ -12,20 +12,8 @@ import { LangParams } from "@/types/params"
|
||||
export function Blocks({ lang, blocks }: BlocksProps & LangParams) {
|
||||
return blocks.map((block) => {
|
||||
switch (block.__typename) {
|
||||
case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksCardGrid:
|
||||
const cardGrid = {
|
||||
...block.card_grid,
|
||||
cards: block.card_grid.cards.map((card) => {
|
||||
return {
|
||||
...card,
|
||||
link: card.link
|
||||
? { ...card.link, href: modWebviewLink(card.link.href, lang) }
|
||||
: undefined,
|
||||
}
|
||||
}),
|
||||
}
|
||||
|
||||
return <CardGrid card_grid={cardGrid} />
|
||||
case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksCardsGrid:
|
||||
return <CardsGrid cards_grid={block.cards_grid} />
|
||||
case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksContent:
|
||||
return (
|
||||
<section>
|
||||
|
||||
Reference in New Issue
Block a user