From e2d754702ac8828a95ba7097f879d71cf4a91d3d Mon Sep 17 00:00:00 2001 From: lohit Date: Mon, 19 Feb 2024 17:30:49 +0530 Subject: [PATCH] feat(#BRU-10) - codeeditor syntax colors for system theme (#1595) --- .../src/components/CollectionSettings/Docs/index.js | 4 ++-- .../src/components/CollectionSettings/Script/index.js | 6 +++--- .../src/components/CollectionSettings/Tests/index.js | 4 ++-- packages/bruno-app/src/components/Documentation/index.js | 4 ++-- .../src/components/RequestPane/GraphQLVariables/index.js | 4 ++-- .../src/components/RequestPane/RequestBody/index.js | 4 ++-- .../bruno-app/src/components/RequestPane/Script/index.js | 6 +++--- .../bruno-app/src/components/RequestPane/Tests/index.js | 4 ++-- .../ResponsePane/QueryResult/QueryResultPreview/index.js | 4 ++-- .../src/components/ResponsePane/QueryResult/index.js | 4 ++-- .../CollectionItem/GenerateCodeItem/CodeView/index.js | 4 ++-- 11 files changed, 24 insertions(+), 24 deletions(-) diff --git a/packages/bruno-app/src/components/CollectionSettings/Docs/index.js b/packages/bruno-app/src/components/CollectionSettings/Docs/index.js index 88c272b13..d449d12d3 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Docs/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Docs/index.js @@ -11,7 +11,7 @@ import StyledWrapper from './StyledWrapper'; const Docs = ({ collection }) => { const dispatch = useDispatch(); - const { storedTheme } = useTheme(); + const { displayedTheme } = useTheme(); const [isEditing, setIsEditing] = useState(false); const docs = get(collection, 'root.docs', ''); const preferences = useSelector((state) => state.app.preferences); @@ -40,7 +40,7 @@ const Docs = ({ collection }) => { {isEditing ? ( { const requestScript = get(collection, 'root.request.script.req', ''); const responseScript = get(collection, 'root.request.script.res', ''); - const { storedTheme } = useTheme(); + const { displayedTheme } = useTheme(); const preferences = useSelector((state) => state.app.preferences); const onRequestScriptEdit = (value) => { @@ -44,7 +44,7 @@ const Script = ({ collection }) => { { { const dispatch = useDispatch(); const tests = get(collection, 'root.request.tests', ''); - const { storedTheme } = useTheme(); + const { displayedTheme } = useTheme(); const preferences = useSelector((state) => state.app.preferences); const onEdit = (value) => { @@ -30,7 +30,7 @@ const Tests = ({ collection }) => { { const dispatch = useDispatch(); - const { storedTheme } = useTheme(); + const { displayedTheme } = useTheme(); const [isEditing, setIsEditing] = useState(false); const docs = item.draft ? get(item, 'draft.request.docs') : get(item, 'request.docs'); const preferences = useSelector((state) => state.app.preferences); @@ -45,7 +45,7 @@ const Documentation = ({ item, collection }) => { {isEditing ? ( { const dispatch = useDispatch(); - const { storedTheme } = useTheme(); + const { displayedTheme } = useTheme(); const preferences = useSelector((state) => state.app.preferences); const onEdit = (value) => { @@ -31,7 +31,7 @@ const GraphQLVariables = ({ variables, 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 { displayedTheme } = useTheme(); const preferences = useSelector((state) => state.app.preferences); const onEdit = (value) => { @@ -48,7 +48,7 @@ const RequestBody = ({ item, collection }) => { { const requestScript = item.draft ? get(item, 'draft.request.script.req') : get(item, 'request.script.req'); const responseScript = item.draft ? get(item, 'draft.request.script.res') : get(item, 'request.script.res'); - const { storedTheme } = useTheme(); + const { displayedTheme } = useTheme(); const preferences = useSelector((state) => state.app.preferences); const onRequestScriptEdit = (value) => { @@ -45,7 +45,7 @@ const Script = ({ item, collection }) => { { { const dispatch = useDispatch(); const tests = item.draft ? get(item, 'draft.request.tests') : get(item, 'request.tests'); - const { storedTheme } = useTheme(); + const { displayedTheme } = useTheme(); const preferences = useSelector((state) => state.app.preferences); const onEdit = (value) => { @@ -32,7 +32,7 @@ const Tests = ({ item, collection }) => { { const preferences = useSelector((state) => state.app.preferences); const dispatch = useDispatch(); @@ -71,7 +71,7 @@ const QueryResultPreview = ({ { setFilter(e.target.value); @@ -132,7 +132,7 @@ const QueryResult = ({ item, collection, data, dataBuffer, width, disableRunEven collection={collection} allowedPreviewModes={allowedPreviewModes} disableRunEventListener={disableRunEventListener} - storedTheme={storedTheme} + displayedTheme={displayedTheme} /> {queryFilterEnabled && } diff --git a/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/GenerateCodeItem/CodeView/index.js b/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/GenerateCodeItem/CodeView/index.js index d76aadc39..f0fa506b2 100644 --- a/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/GenerateCodeItem/CodeView/index.js +++ b/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/GenerateCodeItem/CodeView/index.js @@ -11,7 +11,7 @@ import { IconCopy } from '@tabler/icons'; import { findCollectionByItemUid } from '../../../../../../../utils/collections/index'; const CodeView = ({ language, item }) => { - const { storedTheme } = useTheme(); + const { displayedTheme } = useTheme(); const preferences = useSelector((state) => state.app.preferences); const { target, client, language: lang } = language; const requestHeaders = item.draft ? get(item, 'draft.request.headers') : get(item, 'request.headers'); @@ -45,7 +45,7 @@ const CodeView = ({ language, item }) => { readOnly value={snippet} font={get(preferences, 'font.codeFont', 'default')} - theme={storedTheme} + theme={displayedTheme} mode={lang} />