feat: add two and three column grid variants
This commit is contained in:
@@ -7,17 +7,8 @@ export default function CardGrid({
|
||||
children,
|
||||
isMobileCarousel = false,
|
||||
className,
|
||||
variant,
|
||||
}: PropsWithChildren<CardGridProps>) {
|
||||
const amountOfChildren = React.Children.toArray(children).length
|
||||
|
||||
let variant: CardGridProps["variant"] = undefined
|
||||
|
||||
if (amountOfChildren % 3 === 0) {
|
||||
variant = "treeColumnGrid"
|
||||
} else if (amountOfChildren % 2 === 0) {
|
||||
variant = "twoColumnGrid"
|
||||
}
|
||||
|
||||
return (
|
||||
<section
|
||||
className={cardGridVariants({
|
||||
|
||||
Reference in New Issue
Block a user