-
Notifications
You must be signed in to change notification settings - Fork 209
Expand file tree
/
Copy pathCell.tsx
More file actions
44 lines (43 loc) · 840 Bytes
/
Cell.tsx
File metadata and controls
44 lines (43 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import React, { FC } from 'react'
import cx from 'classnames'
export const Cell: FC<{
gutter: boolean
stickyRight: boolean
stickyFirstColumn?: boolean
disabled?: boolean
className?: string
active?: boolean
children?: any
width: number
left: number
}> = ({
children,
gutter,
stickyRight,
stickyFirstColumn,
active,
disabled,
className,
width,
left,
}) => {
return (
<div
className={cx(
'dsg-cell',
gutter && 'dsg-cell-gutter',
disabled && 'dsg-cell-disabled',
gutter && active && 'dsg-cell-gutter-active',
stickyRight && 'dsg-cell-sticky-right',
stickyFirstColumn && 'dsg-cell-sticky-first',
className
)}
style={{
width,
left: stickyRight ? undefined : left,
}}
>
{children}
</div>
)
}