mirror of
https://github.com/jaywcjlove/wxmp.git
synced 2026-01-12 16:28:48 +08:00
feat: add color palette.
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
import { MarkdownPreviewProps } from '@uiw/react-markdown-preview';
|
||||
import { useContext } from 'react';
|
||||
import { Context } from '../../store/context';
|
||||
|
||||
import { markdownToHTML } from '../../utils/markdownToHTML';
|
||||
import { Warpper } from '../home/Preview';
|
||||
|
||||
export const Preview = (props: MarkdownPreviewProps) => {
|
||||
const { css, markdown } = useContext(Context);
|
||||
const html = markdownToHTML(markdown, css);
|
||||
export const Preview = () => {
|
||||
const { css, markdown, preColor, previewTheme } = useContext(Context);
|
||||
const html = markdownToHTML(markdown, css, { preColor, previewTheme });
|
||||
return <Warpper contentEditable spellCheck={false} dangerouslySetInnerHTML={{ __html: html }} />;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user