feat: Add parent elements to Col component

Signed-off-by: Avior <f.bouillon@aptatio.com>
This commit is contained in:
Florian Bouillon 2022-11-21 16:39:12 +01:00
parent e105399e15
commit 931062a3e7
Signed by: Florian Bouillon
GPG Key ID: E05B3A94178D3A7C

View File

@ -1,8 +1,9 @@
import { objectOmit } from '@dzeio/object-util'
import React from 'react'
import { buildClassName } from '../Util'
import css from './Col.module.styl'
interface Props {
interface Props extends React.HTMLAttributes<HTMLDivElement> {
size?: 0|1|2|3|4|5|6|7|8|9|10|11|12
offset?: 1|2|3|4|5|6|7|8|9|10|11
children?: React.ReactNode
@ -21,10 +22,25 @@ interface Props {
mobileGrow?: boolean
}
export default class Col extends React.Component<Props> {
public render = () => (
<div className={buildClassName(
<div {...objectOmit(
this.props,
"size",
"offset",
"children",
"className",
"nogrow",
"tabletSize",
"tabletoffset",
"tabletGrow",
"mobileSize",
"mobileoffset",
"mobileGrow"
)} className={buildClassName(
css.col,
// Normal