mirror of
https://github.com/usebruno/bruno.git
synced 2025-01-03 12:39:34 +01:00
Merge pull request #1263 from tobiasbrandstaedter/feature/font-preferences-collection-level
feat(#1224): use font preferences in collections
This commit is contained in:
commit
83f5763e01
@ -3,7 +3,7 @@ import get from 'lodash/get';
|
|||||||
import { updateCollectionDocs } from 'providers/ReduxStore/slices/collections';
|
import { updateCollectionDocs } from 'providers/ReduxStore/slices/collections';
|
||||||
import { useTheme } from 'providers/Theme';
|
import { useTheme } from 'providers/Theme';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { useDispatch } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import { saveCollectionRoot } from 'providers/ReduxStore/slices/collections/actions';
|
import { saveCollectionRoot } from 'providers/ReduxStore/slices/collections/actions';
|
||||||
import Markdown from 'components/MarkDown';
|
import Markdown from 'components/MarkDown';
|
||||||
import CodeEditor from 'components/CodeEditor';
|
import CodeEditor from 'components/CodeEditor';
|
||||||
@ -14,6 +14,7 @@ const Docs = ({ collection }) => {
|
|||||||
const { storedTheme } = useTheme();
|
const { storedTheme } = useTheme();
|
||||||
const [isEditing, setIsEditing] = useState(false);
|
const [isEditing, setIsEditing] = useState(false);
|
||||||
const docs = get(collection, 'root.docs', '');
|
const docs = get(collection, 'root.docs', '');
|
||||||
|
const preferences = useSelector((state) => state.app.preferences);
|
||||||
|
|
||||||
const toggleViewMode = () => {
|
const toggleViewMode = () => {
|
||||||
setIsEditing((prev) => !prev);
|
setIsEditing((prev) => !prev);
|
||||||
@ -44,6 +45,7 @@ const Docs = ({ collection }) => {
|
|||||||
onEdit={onEdit}
|
onEdit={onEdit}
|
||||||
onSave={onSave}
|
onSave={onSave}
|
||||||
mode="application/text"
|
mode="application/text"
|
||||||
|
font={get(preferences, 'font.codeFont', 'default')}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<Markdown onDoubleClick={toggleViewMode} content={docs} />
|
<Markdown onDoubleClick={toggleViewMode} content={docs} />
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import get from 'lodash/get';
|
import get from 'lodash/get';
|
||||||
import { useDispatch } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import CodeEditor from 'components/CodeEditor';
|
import CodeEditor from 'components/CodeEditor';
|
||||||
import { updateCollectionRequestScript, updateCollectionResponseScript } from 'providers/ReduxStore/slices/collections';
|
import { updateCollectionRequestScript, updateCollectionResponseScript } from 'providers/ReduxStore/slices/collections';
|
||||||
import { saveCollectionRoot } from 'providers/ReduxStore/slices/collections/actions';
|
import { saveCollectionRoot } from 'providers/ReduxStore/slices/collections/actions';
|
||||||
@ -13,6 +13,7 @@ const Script = ({ collection }) => {
|
|||||||
const responseScript = get(collection, 'root.request.script.res', '');
|
const responseScript = get(collection, 'root.request.script.res', '');
|
||||||
|
|
||||||
const { storedTheme } = useTheme();
|
const { storedTheme } = useTheme();
|
||||||
|
const preferences = useSelector((state) => state.app.preferences);
|
||||||
|
|
||||||
const onRequestScriptEdit = (value) => {
|
const onRequestScriptEdit = (value) => {
|
||||||
dispatch(
|
dispatch(
|
||||||
@ -47,6 +48,7 @@ const Script = ({ collection }) => {
|
|||||||
onEdit={onRequestScriptEdit}
|
onEdit={onRequestScriptEdit}
|
||||||
mode="javascript"
|
mode="javascript"
|
||||||
onSave={handleSave}
|
onSave={handleSave}
|
||||||
|
font={get(preferences, 'font.codeFont', 'default')}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex-1 mt-6">
|
<div className="flex-1 mt-6">
|
||||||
@ -58,6 +60,7 @@ const Script = ({ collection }) => {
|
|||||||
onEdit={onResponseScriptEdit}
|
onEdit={onResponseScriptEdit}
|
||||||
mode="javascript"
|
mode="javascript"
|
||||||
onSave={handleSave}
|
onSave={handleSave}
|
||||||
|
font={get(preferences, 'font.codeFont', 'default')}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import get from 'lodash/get';
|
import get from 'lodash/get';
|
||||||
import { useDispatch } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import CodeEditor from 'components/CodeEditor';
|
import CodeEditor from 'components/CodeEditor';
|
||||||
import { updateCollectionTests } from 'providers/ReduxStore/slices/collections';
|
import { updateCollectionTests } from 'providers/ReduxStore/slices/collections';
|
||||||
import { saveCollectionRoot } from 'providers/ReduxStore/slices/collections/actions';
|
import { saveCollectionRoot } from 'providers/ReduxStore/slices/collections/actions';
|
||||||
@ -12,6 +12,7 @@ const Tests = ({ collection }) => {
|
|||||||
const tests = get(collection, 'root.request.tests', '');
|
const tests = get(collection, 'root.request.tests', '');
|
||||||
|
|
||||||
const { storedTheme } = useTheme();
|
const { storedTheme } = useTheme();
|
||||||
|
const preferences = useSelector((state) => state.app.preferences);
|
||||||
|
|
||||||
const onEdit = (value) => {
|
const onEdit = (value) => {
|
||||||
dispatch(
|
dispatch(
|
||||||
@ -33,6 +34,7 @@ const Tests = ({ collection }) => {
|
|||||||
onEdit={onEdit}
|
onEdit={onEdit}
|
||||||
mode="javascript"
|
mode="javascript"
|
||||||
onSave={handleSave}
|
onSave={handleSave}
|
||||||
|
font={get(preferences, 'font.codeFont', 'default')}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div className="mt-6">
|
<div className="mt-6">
|
||||||
|
Loading…
Reference in New Issue
Block a user