@@ -36,7 +36,7 @@ const globalOptions = {
3636 highlightLines : null ,
3737 initialPath : '/' ,
3838 useCodeMirror : false ,
39- enableEslint : false ,
39+ enableESLint : false ,
4040 defaultFile : null ,
4141 showNavigation : false ,
4242} ;
@@ -69,19 +69,20 @@ const presets = {
6969 } ,
7070} ;
7171
72+ function getView ( { showEditor, showPreview } ) {
73+ if ( showEditor && showPreview ) return 'split' ;
74+ if ( showEditor ) return 'editor' ;
75+ return 'preview' ;
76+ }
77+
7278function getUrl ( settings , darkMode ) {
7379 const flags = {
7480 hidenavigation : settings . showNavigation ? 0 : 1 ,
7581 theme : darkMode ? 'dark' : 'light' ,
7682 fontsize : settings . fontSize || 14 ,
7783 expanddevtools : settings . expandDevTools ? 1 : null ,
7884 hidedevtools : settings . expandDevTools ? 0 : 1 ,
79- view :
80- settings . showEditor && settings . showPreview
81- ? 'split'
82- : settings . showEditor
83- ? 'editor'
84- : 'preview' ,
85+ view : getView ( settings ) ,
8586 previewwindow : settings . showTests ? 'tests' : null ,
8687 codemirror : settings . useCodeMirror ? 1 : null ,
8788 highlights : settings . highlightLines || null ,
@@ -107,7 +108,7 @@ function ShareModal() {
107108 ...presets [ 'split-view' ] ,
108109 } ) ;
109110
110- const [ darkMode , setDarkMode ] = React . useState ( true ) ;
111+ const [ darkMode , setDarkMode ] = React . useState < boolean > ( true ) ;
111112
112113 const change = property => {
113114 setSettings ( { ...settings , preset : 'custom' , ...property } ) ;
@@ -122,7 +123,7 @@ function ShareModal() {
122123 } ;
123124
124125 /** Copy Embed code */
125- const urlContainer = React . useRef < HTMLInputElement | null > ( null ) ;
126+ const urlContainer = React . useRef < HTMLTextAreaElement | null > ( null ) ;
126127 const [ copied , setCopied ] = React . useState ( false ) ;
127128
128129 const copyEmbedCode = ( ) => {
0 commit comments