Fixed linter error.

This commit is contained in:
Akshay Joshi
2021-09-23 17:12:34 +05:30
parent ecaaa8a1b5
commit 8125320093

View File

@@ -2,7 +2,7 @@
/* eslint-disable react/prop-types */ /* eslint-disable react/prop-types */
import React from 'react'; import React from 'react';
import { useTable, useBlockLayout, useRowSelect, useSortBy, useResizeColumns, useFlexLayout, useGlobalFilter } from 'react-table'; import { useTable, useRowSelect, useSortBy, useResizeColumns, useFlexLayout, useGlobalFilter } from 'react-table';
import { FixedSizeList } from 'react-window'; import { FixedSizeList } from 'react-window';
import { makeStyles } from '@material-ui/core/styles'; import { makeStyles } from '@material-ui/core/styles';
import clsx from 'clsx'; import clsx from 'clsx';
@@ -83,8 +83,6 @@ export default function PgTable({ columns, data, isSelectRow, ...props }) {
[] []
); );
const scrollBarSize = React.useMemo(() => scrollbarWidth(), []);
const IndeterminateCheckbox = React.forwardRef( const IndeterminateCheckbox = React.forwardRef(
({ indeterminate, ...rest }, ref) => { ({ indeterminate, ...rest }, ref) => {
const defaultRef = React.useRef(); const defaultRef = React.useRef();
@@ -117,7 +115,6 @@ export default function PgTable({ columns, data, isSelectRow, ...props }) {
getTableBodyProps, getTableBodyProps,
headerGroups, headerGroups,
rows, rows,
totalColumnsWidth,
prepareRow, prepareRow,
selectedFlatRows, selectedFlatRows,
state: { selectedRowIds }, state: { selectedRowIds },
@@ -262,16 +259,6 @@ export default function PgTable({ columns, data, isSelectRow, ...props }) {
); );
} }
const scrollbarWidth = () => {
// thanks too https://davidwalsh.name/detect-scrollbar-width
const scrollDiv = document.createElement('div');
scrollDiv.setAttribute('style', 'width: 100px; height: 100px; overflow: scroll; position:absolute; top:-9999px;');
document.body.appendChild(scrollDiv);
const scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
document.body.removeChild(scrollDiv);
return scrollbarWidth;
};
PgTable.propTypes = { PgTable.propTypes = {
stepId: PropTypes.number, stepId: PropTypes.number,
height: PropTypes.number, height: PropTypes.number,