code cleaning
This commit is contained in:
parent
64748bd76d
commit
e1b3afd543
1 changed files with 0 additions and 10 deletions
|
|
@ -401,7 +401,6 @@ export default function ResponsiveTable<T extends Object>(props: Props<T>) {
|
|||
|
||||
const columnClick = (column: Column<T>) => {
|
||||
const sortKey = column.sortKey ? column.sortKey : column.title.toLowerCase()
|
||||
// console.log(column.sortKey)
|
||||
if (setOrderBy) {
|
||||
if (orderBy === sortKey && setOrder && order) {
|
||||
if (order === "desc") {
|
||||
|
|
@ -409,13 +408,11 @@ export default function ResponsiveTable<T extends Object>(props: Props<T>) {
|
|||
} else {
|
||||
setOrderBy("")
|
||||
}
|
||||
// setOrder(order === "asc" ? "desc" : "asc")
|
||||
} else {
|
||||
if (setOrder) setOrder("desc")
|
||||
setOrderBy(sortKey)
|
||||
}
|
||||
}
|
||||
// if (setOrder && order) setOrder(order === "asc" ? "desc" : "asc")
|
||||
}
|
||||
|
||||
const showOrderIcon = (column: Column<T>) => {
|
||||
|
|
@ -439,9 +436,6 @@ export default function ResponsiveTable<T extends Object>(props: Props<T>) {
|
|||
newWidths.push(node.clientWidth)
|
||||
}
|
||||
})
|
||||
console.log(index)
|
||||
console.log(newWidths.length)
|
||||
console.log(newWidths)
|
||||
|
||||
rowWidthsRef.current = newWidths
|
||||
dragIndexRef.current = index;
|
||||
|
|
@ -467,11 +461,8 @@ export default function ResponsiveTable<T extends Object>(props: Props<T>) {
|
|||
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)
|
||||
newWidths.every((width, j) => {
|
||||
if (j <= index || width === 0) return true
|
||||
else if (newWidths[j] !== undefined) {
|
||||
|
|
@ -612,7 +603,6 @@ export default function ResponsiveTable<T extends Object>(props: Props<T>) {
|
|||
}
|
||||
{columns ?
|
||||
columns.map((column, j) => {
|
||||
// console.log(j)
|
||||
if (filterList.includes(column.title) || column.hidden) return (
|
||||
<TableCell key={"row-"+index+"cell-"+j} sx={{ width: 0, padding: 0, margin: 0}}></TableCell>
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue