editor theme

This commit is contained in:
Jan Prochazka
2020-11-12 11:55:42 +01:00
parent aa0501a729
commit a49f429f13
8 changed files with 40 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ import React from 'react';
import styled from 'styled-components';
import AceEditor from 'react-ace';
import useDimensions from '../utility/useDimensions';
import useTheme from '../theme/useTheme';
const Wrapper = styled.div`
position: absolute;
@@ -22,6 +23,7 @@ export default function JavaScriptEditor({
}) {
const [containerRef, { height, width }] = useDimensions();
const ownEditorRef = React.useRef(null);
const theme = useTheme();
const currentEditorRef = editorRef || ownEditorRef;
@@ -51,7 +53,7 @@ export default function JavaScriptEditor({
<AceEditor
ref={currentEditorRef}
mode="javascript"
theme="github"
theme={theme.aceEditorTheme}
onChange={onChange}
name="UNIQUE_ID_OF_DIV"
editorProps={{ $blockScrolling: true }}

View File

@@ -8,6 +8,7 @@ import useCodeCompletion from './useCodeCompletion';
import useShowModal from '../modals/showModal';
import InsertJoinModal from '../modals/InsertJoinModal';
import { getDatabaseInfo } from '../utility/metadataLoaders';
import useTheme from '../theme/useTheme';
const Wrapper = styled.div`
position: absolute;
@@ -55,6 +56,7 @@ export default function SqlEditor({
}) {
const [containerRef, { height, width }] = useDimensions();
const ownEditorRef = React.useRef(null);
const theme = useTheme();
const currentEditorRef = editorRef || ownEditorRef;
const showModal = useShowModal();
@@ -109,7 +111,7 @@ export default function SqlEditor({
<AceEditor
ref={currentEditorRef}
mode={engineToMode[engine] || 'sql'}
theme="github"
theme={theme.aceEditorTheme}
onChange={onChange}
name="UNIQUE_ID_OF_DIV"
editorProps={{ $blockScrolling: true }}