@@ -21,9 +21,9 @@ const Container = styled.div`
2121
2222const Split = styled . div `
2323 position: relative;
24- width: ${ props => ( props . show ? '50%' : '0px' ) } ;
25- max-width: ${ props => ( props . only ? '100%' : '50%' ) } ;
26- min-width: ${ props => ( props . only ? '100%' : '50%' ) } ;
24+ width: ${ props => ( props . show ? ` ${ props . size } %` : '0px' ) } ;
25+ max-width: ${ props => ( props . only ? '100%' : ` ${ props . size } %` ) } ;
26+ min-width: ${ props => ( props . only ? '100%' : ` ${ props . size } %` ) } ;
2727 height: calc(100% + 3rem);
2828` ;
2929
@@ -42,6 +42,7 @@ type Props = {
4242 useCodeMirror : boolean ,
4343 enableEslint : boolean ,
4444 isInProjectView : boolean ,
45+ editorSize : number ,
4546} ;
4647
4748type State = {
@@ -164,6 +165,7 @@ export default class Content extends React.PureComponent<Props, State> {
164165 autoDownloadTypes : true ,
165166 lintEnabled : this . props . enableEslint ,
166167 codeMirror : this . props . useCodeMirror ,
168+ lineHeight : 1.4 ,
167169 } ) ;
168170
169171 setCurrentModule = ( _ , moduleId ) => {
@@ -178,6 +180,7 @@ export default class Content extends React.PureComponent<Props, State> {
178180 isInProjectView,
179181 currentModule,
180182 hideNavigation,
183+ editorSize,
181184 } = this . props ;
182185
183186 const { errors } = this . state ;
@@ -203,7 +206,11 @@ export default class Content extends React.PureComponent<Props, State> {
203206 return (
204207 < Container >
205208 { showEditor && (
206- < Split show = { showEditor } only = { showEditor && ! showPreview } >
209+ < Split
210+ show = { showEditor }
211+ only = { showEditor && ! showPreview }
212+ size = { editorSize }
213+ >
207214 < CodeEditor
208215 code = { alteredMainModule . code }
209216 id = { alteredMainModule . id }
@@ -221,14 +228,19 @@ export default class Content extends React.PureComponent<Props, State> {
221228 setCurrentModule = { this . setCurrentModule }
222229 template = { sandbox . template }
223230 dependencies = { sandbox . npmDependencies }
231+ hideNavigation = { hideNavigation }
224232 canSave = { false }
225233 corrections = { [ ] }
226234 />
227235 </ Split >
228236 ) }
229237
230238 { showPreview && (
231- < Split show = { showPreview } only = { showPreview && ! showEditor } >
239+ < Split
240+ show = { showPreview }
241+ only = { showPreview && ! showEditor }
242+ size = { 100 - editorSize }
243+ >
232244 < Preview
233245 sandboxId = { sandbox . id }
234246 template = { sandbox . template }
0 commit comments