fix(preview): showPreview toggle working

This commit is contained in:
ritz078 committed 2019-07-18 21:15:09 +05:30
1 parent 1bd559514b
commit 314a626f34
2 files changed
+28 -18

No files matched your search

+7 -1
View File
@@ -101,7 +101,13 @@ const ConversionPanel: React.FunctionComponent<
return (
<>
<Pane display="flex" flexDirection="row" overflow="hidden" flex={1}>
<Pane
display="flex"
flexDirection="row"
overflow="hidden"
flex={1}
height={"calc(100vh - 40px)"}
>
<Pane
display="flex"
flex={1}
+21 -17
View File
@@ -182,6 +182,8 @@ export default function({
setValue(defaultValue);
}, [defaultValue]);
console.log(showPreview);
return (
<Pane display="flex" flex={1} flexDirection="column" overflow="hidden">
<Pane
@@ -309,25 +311,27 @@ export default function({
)}
</Pane>
{topNotifications &&
topNotifications({
isSettingsOpen: showSettingsDialogue,
toggleSettings: _toggleSettingsDialog
})}
<Pane display="flex" flexDirection="column" flex={1} overflow="hidden">
{topNotifications &&
topNotifications({
isSettingsOpen: showSettingsDialogue,
toggleSettings: _toggleSettingsDialog
})}
<Monaco
language={language}
value={value}
options={options}
onChange={value => {
setValue(value);
onChange(value);
}}
innerRef={editorRef}
/>
<Monaco
language={language}
value={value}
options={options}
onChange={value => {
setValue(value);
onChange(value);
}}
innerRef={editorRef}
/>
</Pane>
{IN_BROWSER && showPreview && previewElement && (
<>
<Pane display="flex" flex={1} flexDirection="column" overflow="hidden">
<Pane
height={50}
backgroundColor="#fff"
@@ -359,7 +363,7 @@ export default function({
>
{previewElement(value)}
</Pane>
</>
</Pane>
)}
</Pane>
);