1
0
mirror of https://github.com/vercel/commerce.git synced 2025-07-24 18:51:23 +00:00
Files
assets
components
auth
cart
common
icons
product
ui
Button
Container
Grid
Grid.module.css
Grid.tsx
index.ts
Hero
Input
Link
LoadingDots
Logo
Marquee
Modal
Sidebar
Skeleton
Text
README.md
context.tsx
index.ts
wishlist
config
docs
lib
pages
public
.editorconfig
.env.template
.gitignore
.prettierignore
README.md
global.d.ts
license.md
next-env.d.ts
next.config.js
package-lock.json
package.json
postcss.config.js
tailwind.config.js
tsconfig.json
yarn.lock
commerce/components/ui/Grid/Grid.tsx
2020-10-16 12:46:02 -03:00

35 lines
795 B
TypeScript

import cn from 'classnames'
import { FC, ReactNode, Component } from 'react'
import s from './Grid.module.css'
interface Props {
className?: string
children?: ReactNode[] | Component[] | any[]
layout?: 'A' | 'B' | 'C' | 'D' | 'normal'
variant?: 'default' | 'filled'
}
const Grid: FC<Props> = ({
className,
layout = 'A',
children,
variant = 'default',
}) => {
const rootClassName = cn(
s.root,
{
[s.layoutA]: layout === 'A',
[s.layoutB]: layout === 'B',
[s.layoutC]: layout === 'C',
[s.layoutD]: layout === 'D',
[s.layoutNormal]: layout === 'normal',
[s.default]: variant === 'default',
[s.filled]: variant === 'filled',
},
className
)
return <div className={rootClassName}>{children}</div>
}
export default Grid