Newer
Older
piotr.kupczyk@id.ethz.ch
committed
import React from 'react'
import { withStyles } from '@material-ui/core/styles'
import TableRow from '@material-ui/core/TableRow'
import TableCell from '@material-ui/core/TableCell'
import logger from '@src/js/common/logger.js'
const styles = () => ({
piotr.kupczyk@id.ethz.ch
committed
cell: {
padding: 0
piotr.kupczyk@id.ethz.ch
committed
},
piotr.kupczyk@id.ethz.ch
committed
content: {
piotr.kupczyk@id.ethz.ch
committed
position: 'sticky',
left: 0,
piotr.kupczyk@id.ethz.ch
committed
whiteSpace: 'nowrap',
piotr.kupczyk@id.ethz.ch
committed
width: '750px'
piotr.kupczyk@id.ethz.ch
committed
}
})
class GridRowFullWidth extends React.PureComponent {
render() {
logger.log(logger.DEBUG, 'GridRowFullWidth.render')
const {
multiselectable,
columns,
selected = false,
children,
styles = {},
classes
} = this.props
return (
<TableRow selected={selected}>
<TableCell
piotr.kupczyk@id.ethz.ch
committed
colSpan={
columns.length === 0
? 1
: columns.length + (multiselectable ? 1 : 0)
}
piotr.kupczyk@id.ethz.ch
committed
classes={{
piotr.kupczyk@id.ethz.ch
committed
root: `${classes.cell} ${styles.cell}`
piotr.kupczyk@id.ethz.ch
committed
}}
>
piotr.kupczyk@id.ethz.ch
committed
<div className={`${classes.content} ${styles.content}`}>
{children}
piotr.kupczyk@id.ethz.ch
committed
</div>
</TableCell>
</TableRow>
)
}
}
export default withStyles(styles)(GridRowFullWidth)