Skip to content

Commit

Permalink
Remove superfluous react-double-scrollbar (#804)
Browse files Browse the repository at this point in the history
Co-authored-by: Domino987 <[email protected]>
  • Loading branch information
imnasnainaec and Domino987 authored Nov 8, 2023
1 parent b2b9e68 commit b2c2b90
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 26 deletions.
17 changes: 2 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@
"deep-eql": "^4.1.1",
"deepmerge": "^4.2.2",
"prop-types": "^15.8.1",
"react-double-scrollbar": "0.0.15",
"uuid": "^9.0.0",
"zustand": "^4.3.0"
},
Expand Down
19 changes: 9 additions & 10 deletions src/components/MTableScrollbar/index.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
import React from 'react';
import { Box } from '@mui/material';
import DoubleScrollbar from 'react-double-scrollbar';

const horizontalScrollContainer = {
const doubleStyle = {
overflowX: 'auto',
position: 'relative',
position: 'relative'
};

const singleStyle = {
...doubleStyle,
'& ::-webkit-scrollbar': {
WebkitAppearance: 'none'
},
'& ::-webkit-scrollbar:horizontal': {
height: 8
},
'& ::-webkit-scrollbar-thumb': {
borderRadius: 4,
backgroundColor: 'rgba(0, 0, 0, .3)',
border: '2px solid white',
backgroundColor: 'rgba(0, 0, 0, .3)'
borderRadius: 4
}
};

const ScrollBar = ({ double, children }) => {
if (double) {
return <DoubleScrollbar>{children}</DoubleScrollbar>;
} else {
return <Box sx={horizontalScrollContainer}>{children}</Box>;
}
return <Box sx={double ? doubleStyle : singleStyle}>{children}</Box>;
};

export default ScrollBar;

0 comments on commit b2c2b90

Please sign in to comment.