Feat: datatable prop to choose row size
This commit is contained in:
parent
2663f0b4a8
commit
5fd1974242
4 changed files with 12 additions and 4 deletions
|
|
@ -35,7 +35,8 @@ const Row = ({
|
|||
expandRow,
|
||||
expWidth,
|
||||
expandable,
|
||||
onClick
|
||||
onClick,
|
||||
size
|
||||
}) => {
|
||||
const classes = useStyles()
|
||||
|
||||
|
|
@ -45,11 +46,11 @@ const Row = ({
|
|||
[classes.row]: true,
|
||||
[classes.expanded]: expanded
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={classes.rowWrapper}>
|
||||
<div className={classnames({ [classes.before]: expanded && id !== 0 })}>
|
||||
<Tr
|
||||
size={size}
|
||||
className={classnames(trClasses)}
|
||||
onClick={() => {
|
||||
expandable && expandRow(id)
|
||||
|
|
@ -97,6 +98,7 @@ const DataTable = ({
|
|||
onClick,
|
||||
loading,
|
||||
emptyText,
|
||||
rowSize,
|
||||
...props
|
||||
}) => {
|
||||
const [expanded, setExpanded] = useState(initialExpanded)
|
||||
|
|
@ -131,6 +133,7 @@ const DataTable = ({
|
|||
<div ref={registerChild} style={style}>
|
||||
<Row
|
||||
width={width}
|
||||
size={rowSize}
|
||||
id={index}
|
||||
expWidth={expWidth}
|
||||
elements={elements}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue