diff --git a/packages/bruno-app/src/components/CodeEditor/StyledWrapper.js b/packages/bruno-app/src/components/CodeEditor/StyledWrapper.js
index 29eaa74c6..a2c1f9b17 100644
--- a/packages/bruno-app/src/components/CodeEditor/StyledWrapper.js
+++ b/packages/bruno-app/src/components/CodeEditor/StyledWrapper.js
@@ -2,12 +2,31 @@ import styled from 'styled-components';
const StyledWrapper = styled.div`
div.CodeMirror {
- border: solid 1px var(--color-codemirror-border);
+ background: ${(props) => props.theme.codemirror.bg};
+ border: solid 1px ${(props) => props.theme.codemirror.border};
}
textarea.cm-editor {
position: relative;
}
+
+ // Todo: dark mode temporary fix
+ // Clean this
+ .cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute {
+ color: #9cdcfe !important;
+ }
+
+ .cm-s-monokai span.cm-string {
+ color: #ce9178 !important;
+ }
+
+ .cm-s-monokai span.cm-number{
+ color: #b5cea8 !important;
+ }
+
+ .cm-s-monokai span.cm-atom{
+ color: #569cd6 !important;
+ }
`;
export default StyledWrapper;
diff --git a/packages/bruno-app/src/components/CodeEditor/index.js b/packages/bruno-app/src/components/CodeEditor/index.js
index 61fb0e66c..3f7c57218 100644
--- a/packages/bruno-app/src/components/CodeEditor/index.js
+++ b/packages/bruno-app/src/components/CodeEditor/index.js
@@ -39,6 +39,7 @@ export default class QueryEditor extends React.Component {
foldGutter: true,
gutters: ['CodeMirror-linenumbers', 'CodeMirror-foldgutter'],
readOnly: this.props.readOnly ? 'nocursor' : false,
+ theme: this.props.theme === 'dark' ? 'monokai' : 'default',
extraKeys: {
'Cmd-Enter': () => {
if (this.props.onRun) {
@@ -87,6 +88,12 @@ export default class QueryEditor extends React.Component {
this.editor.setValue(this.props.value);
this.editor.setOption('mode', this.props.mode);
}
+
+ if (this.props.theme !== prevProps.theme && this.editor) {
+ this.cachedValue = this.props.value;
+ this.editor.setValue(this.props.value);
+ this.editor.setOption('theme', this.props.theme === 'dark' ? 'monokai' : 'default');
+ }
this.ignoreChangeEvent = false;
}
diff --git a/packages/bruno-app/src/components/RequestPane/QueryEditor/StyledWrapper.js b/packages/bruno-app/src/components/RequestPane/QueryEditor/StyledWrapper.js
index 0b7d9803d..df93f4126 100644
--- a/packages/bruno-app/src/components/RequestPane/QueryEditor/StyledWrapper.js
+++ b/packages/bruno-app/src/components/RequestPane/QueryEditor/StyledWrapper.js
@@ -2,7 +2,8 @@ import styled from 'styled-components';
const StyledWrapper = styled.div`
div.CodeMirror {
- border: solid 1px var(--color-codemirror-border);
+ background: ${(props) => props.theme.codemirror.bg};
+ border: solid 1px ${(props) => props.theme.codemirror.border};
/* todo: find a better way */
height: calc(100vh - 250px);
}
diff --git a/packages/bruno-app/src/components/RequestPane/RequestBody/RequestBodyMode/StyledWrapper.js b/packages/bruno-app/src/components/RequestPane/RequestBody/RequestBodyMode/StyledWrapper.js
index 6239f07fe..e72774524 100644
--- a/packages/bruno-app/src/components/RequestPane/RequestBody/RequestBodyMode/StyledWrapper.js
+++ b/packages/bruno-app/src/components/RequestPane/RequestBody/RequestBodyMode/StyledWrapper.js
@@ -4,7 +4,7 @@ const Wrapper = styled.div`
font-size: 0.8125rem;
.body-mode-selector {
- background: #efefef;
+ background: ${(props) => props.theme.requestTabPanel.bodyModeSelect.color};
border-radius: 3px;
.dropdown-item {
diff --git a/packages/bruno-app/src/components/RequestPane/RequestBody/index.js b/packages/bruno-app/src/components/RequestPane/RequestBody/index.js
index 0d8c88311..9b7ab9b56 100644
--- a/packages/bruno-app/src/components/RequestPane/RequestBody/index.js
+++ b/packages/bruno-app/src/components/RequestPane/RequestBody/index.js
@@ -4,6 +4,7 @@ import CodeEditor from 'components/CodeEditor';
import FormUrlEncodedParams from 'components/RequestPane/FormUrlEncodedParams';
import MultipartFormParams from 'components/RequestPane/MultipartFormParams';
import { useDispatch } from 'react-redux';
+import { useTheme } from 'providers/Theme';
import { updateRequestBody } from 'providers/ReduxStore/slices/collections';
import { sendRequest, saveRequest } from 'providers/ReduxStore/slices/collections/actions';
import StyledWrapper from './StyledWrapper';
@@ -12,6 +13,9 @@ const RequestBody = ({ item, collection }) => {
const dispatch = useDispatch();
const body = item.draft ? get(item, 'draft.request.body') : get(item, 'request.body');
const bodyMode = item.draft ? get(item, 'draft.request.body.mode') : get(item, 'request.body.mode');
+ const {
+ storedTheme
+ } = useTheme();
const onEdit = (value) => {
dispatch(
@@ -41,7 +45,7 @@ const RequestBody = ({ item, collection }) => {
return (
-
+
);
}
diff --git a/packages/bruno-app/src/components/RequestPane/RequestHeaders/StyledWrapper.js b/packages/bruno-app/src/components/RequestPane/RequestHeaders/StyledWrapper.js
index c1e06a621..2233d2c58 100644
--- a/packages/bruno-app/src/components/RequestPane/RequestHeaders/StyledWrapper.js
+++ b/packages/bruno-app/src/components/RequestPane/RequestHeaders/StyledWrapper.js
@@ -12,7 +12,7 @@ const Wrapper = styled.div`
}
thead {
- color: ${(props) => props.theme.table.thead.color};;
+ color: ${(props) => props.theme.table.thead.color};
font-size: 0.8125rem;
user-select: none;
}
@@ -23,8 +23,6 @@ const Wrapper = styled.div`
.btn-add-header {
font-size: 0.8125rem;
- margin-block: 10px;
- padding: 5px;
}
input[type='text'] {
diff --git a/packages/bruno-app/src/components/RequestPane/RequestHeaders/index.js b/packages/bruno-app/src/components/RequestPane/RequestHeaders/index.js
index 8e39dec55..66247d216 100644
--- a/packages/bruno-app/src/components/RequestPane/RequestHeaders/index.js
+++ b/packages/bruno-app/src/components/RequestPane/RequestHeaders/index.js
@@ -124,7 +124,7 @@ const RequestHeaders = ({ item, collection }) => {
: null}
-