tweak(web): adjust markdown heading margins (#393)

* tweak(web): components for markdown headings

Fixed nomenclature and set as default export.

* fix(ui): temp remove MarkdownComponents file

* fix(ui): return MarkdownComponents file
This commit is contained in:
Jellyton
2023-08-07 03:05:15 -07:00
committed by GitHub
parent fcb0a566d3
commit c8cca20c89
6 changed files with 27 additions and 6 deletions

View File

@@ -7,6 +7,7 @@ import { fetchNui } from '../../../utils/fetchNui';
import ReactMarkdown from 'react-markdown';
import HeaderButton from './components/HeaderButton';
import ScaleFade from '../../../transitions/ScaleFade';
import MarkdownComponents from '../../../config/MarkdownComponents';
const openMenu = (id: string | undefined) => {
fetchNui<ContextMenuProps>('openContext', { id: id, back: true });
@@ -92,7 +93,7 @@ const ContextMenu: React.FC = () => {
)}
<Box className={classes.titleContainer}>
<Text className={classes.titleText}>
<ReactMarkdown>{contextMenu.title}</ReactMarkdown>
<ReactMarkdown components={MarkdownComponents}>{contextMenu.title}</ReactMarkdown>
</Text>
</Box>
<HeaderButton icon="xmark" canClose={contextMenu.canClose} iconSize={18} handleClick={closeContext} />

View File

@@ -5,6 +5,7 @@ import { Option, ContextMenuProps } from '../../../../typings';
import { fetchNui } from '../../../../utils/fetchNui';
import { isIconUrl } from '../../../../utils/isIconUrl';
import { IconProp } from '@fortawesome/fontawesome-svg-core';
import MarkdownComponents from '../../../../config/MarkdownComponents';
const openMenu = (id: string | undefined) => {
fetchNui<ContextMenuProps>('openContext', { id: id, back: false });
@@ -108,12 +109,12 @@ const ContextButton: React.FC<{
</Stack>
)}
<Text className={classes.buttonTitleText}>
<ReactMarkdown>{button.title || buttonKey}</ReactMarkdown>
<ReactMarkdown components={MarkdownComponents}>{button.title || buttonKey}</ReactMarkdown>
</Text>
</Group>
{button.description && (
<Text className={classes.description}>
<ReactMarkdown>{button.description}</ReactMarkdown>
<ReactMarkdown components={MarkdownComponents}>{button.description}</ReactMarkdown>
</Text>
)}
{button.progress !== undefined && (