File tree 1 file changed +27
-18
lines changed
1 file changed +27
-18
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,32 @@ export function WorkbenchView(props: IWorkbench & ILayout & ILayoutController) {
45
45
horizontalSplitPanePos,
46
46
} = props ;
47
47
48
+ const getContent = ( panelMaximized : boolean , panelHidden : boolean ) => {
49
+ const editor = (
50
+ < Pane
51
+ initialSize = { panelHidden ? '100%' : horizontalSplitPanePos [ 0 ] }
52
+ maxSize = "100%"
53
+ minSize = "10%"
54
+ >
55
+ < EditorView />
56
+ </ Pane >
57
+ ) ;
58
+
59
+ const panel = (
60
+ < Pane >
61
+ < PanelView />
62
+ </ Pane >
63
+ ) ;
64
+
65
+ if ( panelHidden ) {
66
+ return editor ;
67
+ }
68
+ if ( panelMaximized ) {
69
+ return panel ;
70
+ }
71
+ return [ editor , panel ] ;
72
+ } ;
73
+
48
74
return (
49
75
< div id = { ID_APP } className = { appClassName } tabIndex = { 0 } >
50
76
< div className = { workbenchClassName } >
@@ -75,24 +101,7 @@ export function WorkbenchView(props: IWorkbench & ILayout & ILayoutController) {
75
101
// react-split-pane onChange: (newSizes: [size, ratio]) => void;
76
102
onChange = { onHorizontalPaneSizeChange as any }
77
103
>
78
- { ! panel . panelMaximized ? (
79
- < Pane
80
- initialSize = {
81
- panel . hidden
82
- ? '100%'
83
- : horizontalSplitPanePos [ 0 ]
84
- }
85
- maxSize = "100%"
86
- minSize = "10%"
87
- >
88
- < EditorView />
89
- </ Pane >
90
- ) : null }
91
- { ! panel . hidden ? (
92
- < Pane >
93
- < PanelView />
94
- </ Pane >
95
- ) : null }
104
+ { getContent ( ! ! panel . panelMaximized , ! ! panel . hidden ) }
96
105
</ SplitPane >
97
106
</ SplitPane >
98
107
</ div >
You can’t perform that action at this time.
0 commit comments