mirror of
https://github.com/usebruno/bruno.git
synced 2025-01-24 14:48:41 +01:00
Merge pull request #1132 from flerouwu/bugfix/doc-editor-font
fix(web): documentation editor font not following preferences value
This commit is contained in:
commit
19efa2fd35
@ -3,7 +3,7 @@ import get from 'lodash/get';
|
|||||||
import { updateRequestDocs } from 'providers/ReduxStore/slices/collections';
|
import { updateRequestDocs } from 'providers/ReduxStore/slices/collections';
|
||||||
import { useTheme } from 'providers/Theme/index';
|
import { useTheme } from 'providers/Theme/index';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { useDispatch } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import { saveRequest } from 'providers/ReduxStore/slices/collections/actions';
|
import { saveRequest } 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 Documentation = ({ item, collection }) => {
|
|||||||
const { storedTheme } = useTheme();
|
const { storedTheme } = useTheme();
|
||||||
const [isEditing, setIsEditing] = useState(false);
|
const [isEditing, setIsEditing] = useState(false);
|
||||||
const docs = item.draft ? get(item, 'draft.request.docs') : get(item, 'request.docs');
|
const docs = item.draft ? get(item, 'draft.request.docs') : get(item, 'request.docs');
|
||||||
|
const preferences = useSelector((state) => state.app.preferences);
|
||||||
|
|
||||||
const toggleViewMode = () => {
|
const toggleViewMode = () => {
|
||||||
setIsEditing((prev) => !prev);
|
setIsEditing((prev) => !prev);
|
||||||
@ -45,6 +46,7 @@ const Documentation = ({ item, collection }) => {
|
|||||||
<CodeEditor
|
<CodeEditor
|
||||||
collection={collection}
|
collection={collection}
|
||||||
theme={storedTheme}
|
theme={storedTheme}
|
||||||
|
font={get(preferences, 'font.codeFont', 'default')}
|
||||||
value={docs || ''}
|
value={docs || ''}
|
||||||
onEdit={onEdit}
|
onEdit={onEdit}
|
||||||
onSave={onSave}
|
onSave={onSave}
|
||||||
|
Loading…
Reference in New Issue
Block a user