mirror of
https://github.com/jaywcjlove/wxmp.git
synced 2026-01-12 16:28:48 +08:00
feat: add electron app.
This commit is contained in:
19
website/src/pages/home/Preview.tsx
Normal file
19
website/src/pages/home/Preview.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import { MarkdownPreviewProps } from '@uiw/react-markdown-preview';
|
||||
import styled from 'styled-components';
|
||||
import { useContext } from 'react';
|
||||
import { Context } from '../../store/context';
|
||||
|
||||
import { markdownToHTML } from '../../utils/markdownToHTML';
|
||||
|
||||
const Warpper = styled.div`
|
||||
width: 375px;
|
||||
padding: 20px;
|
||||
box-shadow: 0 0 60px rgb(0 0 0 / 10%);
|
||||
min-height: 100%;
|
||||
`;
|
||||
|
||||
export const Preview = (props: MarkdownPreviewProps) => {
|
||||
const { css } = useContext(Context);
|
||||
const html = markdownToHTML(props.source || '', css);
|
||||
return <Warpper contentEditable spellCheck={false} dangerouslySetInnerHTML={{ __html: html }} />;
|
||||
};
|
||||
Reference in New Issue
Block a user