@@ -18,7 +18,9 @@ const Container = styled.div`
1818
1919const Split = styled . div `
2020 position: relative;
21- width: ${ props => props . show ? '100%' : '0px' } ;
21+ width: ${ props => props . show ? '50%' : '0px' } ;
22+ max-width: ${ props => props . only ? '100%' : '50%' } ;
23+ min-width: ${ props => props . only ? '100%' : '50%' } ;
2224 height: ${ props => props . editor ? 'calc(100% + 3rem)' : '100%' } ;
2325` ;
2426
@@ -66,8 +68,8 @@ export default class Content extends React.Component {
6668
6769 return (
6870 < Container >
69- < Split editor show = { showEditor } >
70- { showEditor &&
71+ { showEditor &&
72+ < Split editor show = { showEditor } only = { showEditor && ! showPreview } >
7173 < CodeEditor
7274 code = { mainModule . code }
7375 error = { null }
@@ -80,23 +82,24 @@ export default class Content extends React.Component {
8082 ) }
8183 preferences = { preferences }
8284 onlyViewMode
83- /> }
84- </ Split >
85+ />
86+ </ Split > }
8587
86- < Split show = { showPreview } >
87- < Preview
88- sandboxId = { sandbox . id }
89- isInProjectView = { false }
90- modules = { sandbox . modules }
91- directories = { sandbox . directories }
92- bundle = { this . state . bundle }
93- externalResources = { sandbox . externalResources }
94- module = { mainModule }
95- fetchBundle = { this . fetchBundle }
96- setError = { ( ) => { } }
97- preferences = { preferences }
98- />
99- </ Split >
88+ { showPreview &&
89+ < Split show = { showPreview } only = { showPreview && ! showEditor } >
90+ < Preview
91+ sandboxId = { sandbox . id }
92+ isInProjectView = { false }
93+ modules = { sandbox . modules }
94+ directories = { sandbox . directories }
95+ bundle = { this . state . bundle }
96+ externalResources = { sandbox . externalResources }
97+ module = { mainModule }
98+ fetchBundle = { this . fetchBundle }
99+ setError = { ( ) => { } }
100+ preferences = { preferences }
101+ />
102+ </ Split > }
100103 </ Container >
101104 ) ;
102105 }
0 commit comments