Skip to content

Commit 7446677

Browse files
committed
feat: init workbench
1 parent 2ff9c9e commit 7446677

File tree

4 files changed

+122
-14
lines changed

4 files changed

+122
-14
lines changed

src/workbench/index.tsx

+45-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,53 @@
11
import * as React from 'react';
2+
import SplitPane from 'react-split-pane';
3+
4+
import { prefixClaName } from '@/common/className';
5+
import { APP_PREFIX } from '@/common/const';
26

37
import Sidebar from './sidebar';
8+
import MenuBar from './menuBar';
9+
import ActivityBar from './activityBar';
10+
import StatusBar from './statusBar';
11+
import Editor from './editor';
12+
import Panel from './panel';
13+
14+
import './workbench.scss';
15+
16+
const MainBench: React.FunctionComponent = function(props: any) {
17+
return (
18+
<div className={prefixClaName('mainBench')}>{props.children}</div>
19+
);
20+
};
421

5-
export const Workbench: React.SFC = function() {
22+
export const Workbench: React.FunctionComponent = function() {
623
return (
7-
<div>
8-
<Sidebar />
9-
Workbench
24+
<div className={APP_PREFIX + ' center'}>
25+
<div className={prefixClaName('workbench')}>
26+
<MenuBar />
27+
<ActivityBar />
28+
<MainBench>
29+
<SplitPane
30+
split={'vertical'}
31+
minSize={246}
32+
maxSize={-246}
33+
primary="first"
34+
allowResize={true}
35+
>
36+
<Sidebar />
37+
<SplitPane
38+
primary="first"
39+
split="horizontal"
40+
defaultSize={'70%'}
41+
maxSize={-1}
42+
allowResize={true}
43+
>
44+
<Editor />
45+
<Panel/>
46+
</SplitPane>
47+
</SplitPane>
48+
</MainBench>
49+
</div>
50+
<StatusBar />
1051
</div>
1152
);
1253
};
File renamed without changes.

src/workbench/sidebar.tsx

-10
This file was deleted.

src/workbench/workbench.scss

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
@import '@/style/const.scss';
2+
@import '@/style/main.scss';
3+
4+
.#{$prefix}-workbench {
5+
position: absolute;
6+
top: 0;
7+
right: 0;
8+
bottom: 0;
9+
left: 0;
10+
z-index: 1;
11+
padding-bottom: 22px;
12+
// TODO temp style, just for development
13+
background-color: #252526;
14+
color: #ccc;
15+
}
16+
17+
.#{$prefix}-mainBench {
18+
width: auto;
19+
height: auto;
20+
top: 0;
21+
left: 48px;
22+
right: 0;
23+
position: absolute;
24+
bottom: 22px;
25+
26+
.Resizer {
27+
background: #000;
28+
opacity: 0.2;
29+
z-index: 1;
30+
-moz-box-sizing: border-box;
31+
-webkit-box-sizing: border-box;
32+
box-sizing: border-box;
33+
-moz-background-clip: padding;
34+
-webkit-background-clip: padding;
35+
background-clip: padding-box;
36+
}
37+
38+
.Resizer:hover {
39+
-webkit-transition: all 2s ease;
40+
transition: all 2s ease;
41+
}
42+
43+
.Resizer.horizontal {
44+
height: 11px;
45+
margin: -5px 0;
46+
border-top: 5px solid rgba(255, 255, 255, 0);
47+
border-bottom: 5px solid rgba(255, 255, 255, 0);
48+
cursor: row-resize;
49+
width: 100%;
50+
}
51+
52+
.Resizer.horizontal:hover {
53+
border-top: 5px solid rgba(0, 0, 0, 0.5);
54+
border-bottom: 5px solid rgba(0, 0, 0, 0.5);
55+
}
56+
57+
.Resizer.vertical {
58+
width: 11px;
59+
margin: 0 -5px;
60+
border-left: 5px solid rgba(255, 255, 255, 0);
61+
border-right: 5px solid rgba(255, 255, 255, 0);
62+
cursor: col-resize;
63+
}
64+
65+
.Resizer.vertical:hover {
66+
border-left: 5px solid rgba(0, 0, 0, 0.5);
67+
border-right: 5px solid rgba(0, 0, 0, 0.5);
68+
}
69+
70+
.Resizer.disabled {
71+
cursor: not-allowed;
72+
}
73+
74+
.Resizer.disabled:hover {
75+
border-color: transparent;
76+
}
77+
}

0 commit comments

Comments
 (0)