Skip to content

Commit fb870c3

Browse files
committed
more fixes for types
1 parent 6cb6d72 commit fb870c3

File tree

1 file changed

+10
-9
lines changed
  • packages/app/src/app/pages/common/Modals/ShareModal2

1 file changed

+10
-9
lines changed

packages/app/src/app/pages/common/Modals/ShareModal2/index.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
7278
function 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

Comments
 (0)