-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSplit.js
More file actions
44 lines (41 loc) · 1.23 KB
/
Split.js
File metadata and controls
44 lines (41 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { withStyles } from '@material-ui/core';
import RSplit from 'react-split';
const styles = (theme) => ({
root: {
'& > *': {
overflow: 'hidden',
},
display: 'flex',
width: '100%',
height: '100%',
'& .gutter': {
backgroundColor: theme.palette.background.secondary,
backgroundRepeat: 'no-repeat',
backgroundPosition: '50%',
},
'& .gutter.gutter-horizontal': {
flexDirection: 'column',
cursor: 'col-resize',
backgroundImage:
"url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==')",
},
'& .gutter.gutter-vertical': {
flexDirection: 'row',
cursor: 'row-resize',
backgroundImage:
"url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAFAQMAAABo7865AAAABlBMVEVHcEzMzMzyAv2sAAAAAXRSTlMAQObYZgAAABBJREFUeF5jOAMEEAIEEFwAn3kMwcB6I2AAAAAASUVORK5CYII=')",
},
},
});
function Split({ classes, children, ...props }) {
return (
<RSplit
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
className={classes.root}
>
{children}
</RSplit>
);
}
export default withStyles(styles)(Split);