refactor: move Markdown Editor and Markdown component into together

pull/150/head
moonrailgun 2 years ago
parent f18973bad5
commit 53f812f733

@ -1,11 +1,13 @@
import React from 'react';
import { Editor } from '@bytemd/react';
import { plugins } from './plugins';
import { uploadFile } from 'tailchat-shared';
import { Markdown } from '../Markdown';
import { createRoot } from 'react-dom/client';
import gfm from '@bytemd/plugin-gfm';
import 'bytemd/dist/index.css';
import './style.less';
import './editor.less';
export const plugins = [gfm()];
interface MarkdownEditorProps {
value: string;

@ -1,5 +1,7 @@
import { Loadable } from '../Loadable';
export { Markdown } from './render';
export const MarkdownEditor = Loadable(() =>
import('./editor').then((module) => module.MarkdownEditor)
);

@ -1,11 +1,11 @@
import { makeAbsoluteUrl } from '@/utils/url-helper';
import React, { useCallback, useMemo } from 'react';
import { isValidStr, parseUrlStr } from 'tailchat-shared';
import { Loadable } from './Loadable';
import { Loadable } from '../Loadable';
import { Image } from 'tailchat-design';
import remarkGfm from 'remark-gfm';
import rehypeRaw from 'rehype-raw';
import './Markdown.less';
import './render.less';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore

@ -1,6 +0,0 @@
import gfm from '@bytemd/plugin-gfm';
export const plugins = [
gfm(),
// Add more plugins here
];

@ -65,8 +65,7 @@ export { ErrorBoundary } from '@/components/ErrorBoundary';
export { ErrorView } from '@/components/ErrorView';
export { UserAvatar } from '@/components/UserAvatar';
export { UserName } from '@/components/UserName';
export { Markdown } from '@/components/Markdown';
export { MarkdownEditor } from '@/components/MarkdownEditor';
export { Markdown, MarkdownEditor } from '@/components/Markdown';
export { Webview, WebviewKeepAlive } from '@/components/Webview';
export { Card } from '@/components/Card';
export { Problem } from '@/components/Problem';

Loading…
Cancel
Save