-
-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove superfluous react-double-scrollbar (#804)
Co-authored-by: Domino987 <[email protected]>
- Loading branch information
1 parent
b2b9e68
commit b2c2b90
Showing
3 changed files
with
11 additions
and
26 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |