diff --git a/src/common/ResponsiveTable.tsx b/src/common/ResponsiveTable.tsx index 8c26891..a26cfe4 100644 --- a/src/common/ResponsiveTable.tsx +++ b/src/common/ResponsiveTable.tsx @@ -278,9 +278,7 @@ export default function ResponsiveTable(props: Props) { } const renderMobileRow = (row: T, index: number) => { - if (renderMobile) return ( - renderMobile(row, index) - ) + if (renderMobile) return renderMobile(row, index) if (columns) { return ( @@ -441,6 +439,9 @@ export default function ResponsiveTable(props: Props) { newWidths.push(node.clientWidth) } }) + console.log(index) + console.log(newWidths.length) + console.log(newWidths) rowWidthsRef.current = newWidths dragIndexRef.current = index; @@ -458,15 +459,16 @@ export default function ResponsiveTable(props: Props) { } const resizeDrag = (e: any) => { - // console.log(dragIndex) const index = dragIndexRef.current; const dragStart = dragStartRef.current const rowWidths = rowWidthsRef.current - if (!index) return - if (!rowWidths[index]) return - if (!rowWidths[index+1]) return + if (index === undefined) return + if (rowWidths[index] === undefined) return + if (rowWidths[index+1] === undefined) return if (!dragStart) return + console.log("dragging") + let newWidths: number[] = [...rowWidths] newWidths[index] = newWidths[index] - (dragStart - e.clientX) newWidths[index+1] = newWidths[index+1] + (dragStart - e.clientX) @@ -474,10 +476,6 @@ export default function ResponsiveTable(props: Props) { } - useEffect(() => { - - }) - return ( @@ -530,7 +528,9 @@ export default function ResponsiveTable(props: Props) { { renderGutter && } { columns ? columns.map((column, index) => { - if (filterList.includes(column.title) || column.hidden) return null + if (filterList.includes(column.title) || column.hidden) return ( + + ) return ( @@ -606,7 +606,9 @@ export default function ResponsiveTable(props: Props) { {columns ? columns.map((column, j) => { // console.log(j) - if (filterList.includes(column.title) || column.hidden) return null + if (filterList.includes(column.title) || column.hidden) return ( + + ) if (column.render) return ( {column.render(row)} diff --git a/src/pages/Devices.tsx b/src/pages/Devices.tsx index 8790f68..8cdacc3 100644 --- a/src/pages/Devices.tsx +++ b/src/pages/Devices.tsx @@ -57,6 +57,11 @@ const useStyles = makeStyles((theme: Theme) => { width: theme.spacing(10) // justifyContent: "center", }, + deviceContainer: { + margin: theme.spacing(1), + display: "flex", + width: theme.spacing(10) + }, descriptionCellContainer: { margin: theme.spacing(1), marginLeft: theme.spacing(2), @@ -68,7 +73,7 @@ const useStyles = makeStyles((theme: Theme) => { margin: theme.spacing(1), marginLeft: theme.spacing(2), display: "flex", - width: theme.spacing(18) + minWidth: theme.spacing(10) // justifyContent: "center", }, green: { @@ -413,7 +418,7 @@ export default function Devices() { sortKey: "name", render: (device: Device) => { return ( - + {/* // */}