refactor Row, Col to accept all div props
This commit is contained in:
parent
d8af8accbb
commit
3d9d60e8fe
|
@ -1,16 +1,10 @@
|
|||
import clsx from 'clsx'
|
||||
import { CSSProperties, Ref, ReactNode } from 'react'
|
||||
|
||||
export function Col(props: {
|
||||
children?: ReactNode
|
||||
className?: string
|
||||
style?: CSSProperties
|
||||
ref?: Ref<HTMLDivElement>
|
||||
}) {
|
||||
const { children, className, style, ref } = props
|
||||
export function Col(props: JSX.IntrinsicElements['div']) {
|
||||
const { children, className, ...rest } = props
|
||||
|
||||
return (
|
||||
<div className={clsx(className, 'flex flex-col')} style={style} ref={ref}>
|
||||
<div className={clsx(className, 'flex flex-col')} {...rest}>
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
|
|
|
@ -1,15 +1,10 @@
|
|||
import clsx from 'clsx'
|
||||
import { ReactNode } from 'react'
|
||||
|
||||
export function Row(props: {
|
||||
children?: ReactNode
|
||||
className?: string
|
||||
id?: string
|
||||
}) {
|
||||
const { children, className, id } = props
|
||||
export function Row(props: JSX.IntrinsicElements['div']) {
|
||||
const { children, className, ...rest } = props
|
||||
|
||||
return (
|
||||
<div className={clsx(className, 'flex flex-row')} id={id}>
|
||||
<div className={clsx(className, 'flex flex-row')} {...rest}>
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user