feat(SW-439): add support for one column grid
This commit is contained in:
@@ -5,15 +5,31 @@ import Grids from "@/components/TempDesignSystem/Grids"
|
||||
import LoyaltyCard from "@/components/TempDesignSystem/LoyaltyCard"
|
||||
import TeaserCard from "@/components/TempDesignSystem/TeaserCard"
|
||||
|
||||
import type { CardsGridProps } from "@/types/components/blocks/cardsGrid"
|
||||
import type {
|
||||
CardsGridProps,
|
||||
Columns,
|
||||
} from "@/types/components/blocks/cardsGrid"
|
||||
import { CardsGridEnum, CardsGridLayoutEnum } from "@/types/enums/cardsGrid"
|
||||
|
||||
export default function CardsGrid({
|
||||
cards_grid,
|
||||
firstItem = false,
|
||||
}: CardsGridProps) {
|
||||
const columns =
|
||||
cards_grid.layout === CardsGridLayoutEnum.THREE_COLUMNS ? 3 : 2
|
||||
let columns: Columns
|
||||
|
||||
switch (cards_grid.layout) {
|
||||
case CardsGridLayoutEnum.ONE_COLUMN:
|
||||
columns = 1
|
||||
break
|
||||
case CardsGridLayoutEnum.TWO_COLUMNS:
|
||||
columns = 2
|
||||
break
|
||||
case CardsGridLayoutEnum.THREE_COLUMNS:
|
||||
columns = 3
|
||||
break
|
||||
default:
|
||||
columns = 3
|
||||
}
|
||||
|
||||
return (
|
||||
<SectionContainer>
|
||||
|
||||
Reference in New Issue
Block a user