|
@@ -7,6 +7,7 @@ import { ConfigActionType } from "src/reducer/reducer";
|
|
|
import { useConfig } from "src/hocs/config";
|
|
|
import { Loading } from "src/components/Loading";
|
|
|
import { loader } from "@monaco-editor/react";
|
|
|
+import { CarbonAds } from "src/components/CarbonAds";
|
|
|
|
|
|
loader.config({ paths: { vs: "/monaco-editor/min/vs" } });
|
|
|
|
|
@@ -25,6 +26,13 @@ const editorOptions = {
|
|
|
},
|
|
|
};
|
|
|
|
|
|
+const StyledWrapper = styled.div`
|
|
|
+ display: grid;
|
|
|
+ height: calc(100vh - 36px);
|
|
|
+ grid-template-columns: 1fr;
|
|
|
+ grid-auto-rows: 1fr 100px;
|
|
|
+`;
|
|
|
+
|
|
|
export const JsonEditor: React.FC = () => {
|
|
|
const { json, settings, dispatch } = useConfig();
|
|
|
const [value, setValue] = React.useState("");
|
|
@@ -64,15 +72,18 @@ export const JsonEditor: React.FC = () => {
|
|
|
return (
|
|
|
<StyledEditorWrapper>
|
|
|
<ErrorContainer error={error} setError={setError} />
|
|
|
- <Editor
|
|
|
- height="100%"
|
|
|
- defaultLanguage="json"
|
|
|
- value={value}
|
|
|
- theme={editorTheme}
|
|
|
- options={editorOptions}
|
|
|
- loading={<Loading message="Loading Editor..." />}
|
|
|
- onChange={(value) => setValue(value as string)}
|
|
|
- />
|
|
|
+ <StyledWrapper>
|
|
|
+ <Editor
|
|
|
+ height="auto"
|
|
|
+ defaultLanguage="json"
|
|
|
+ value={value}
|
|
|
+ theme={editorTheme}
|
|
|
+ options={editorOptions}
|
|
|
+ loading={<Loading message="Loading Editor..." />}
|
|
|
+ onChange={(value) => setValue(value as string)}
|
|
|
+ />
|
|
|
+ <CarbonAds />
|
|
|
+ </StyledWrapper>
|
|
|
</StyledEditorWrapper>
|
|
|
);
|
|
|
};
|