Moved MarkupItReactRenderer to /components. Added a story for it.

This commit is contained in:
Andrey Okonetchnikov 2016-09-27 12:57:41 +02:00
parent 78eb65bca2
commit 107e8f7104
7 changed files with 38 additions and 3 deletions

View File

@ -8,7 +8,7 @@ import MarkupIt from 'markup-it';
import markdownSyntax from 'markup-it/syntaxes/markdown';
import htmlSyntax from 'markup-it/syntaxes/html';
import reInline from 'markup-it/syntaxes/markdown/re/inline';
import MarkupItReactRenderer from '../MarkupItReactRenderer';
import MarkupItReactRenderer from '../../UI/MarkupItReactRenderer/MarkupItReactRenderer';
describe('MarkitupReactRenderer', () => {

View File

@ -1,6 +1,6 @@
import React, { PropTypes } from 'react';
import { getSyntaxes } from './richText';
import MarkupItReactRenderer from './MarkupItReactRenderer';
import MarkupItReactRenderer from '../MarkupItReactRenderer/index';
const schema = {
'mediaproxy': ({ token }) => (

View File

@ -1,7 +1,7 @@
import React from 'react';
import { storiesOf, action } from '@kadira/storybook';
import FindBar from '../UI/FindBar/FindBar';
import FindBar from '../FindBar/FindBar';
const CREATE_COLLECTION = 'CREATE_COLLECTION';
const CREATE_POST = 'CREATE_POST';

View File

@ -0,0 +1,34 @@
import React from 'react';
import markdownSyntax from 'markup-it/syntaxes/markdown';
import htmlSyntax from 'markup-it/syntaxes/html';
import MarkupItReactRenderer from '../MarkupItReactRenderer';
import { storiesOf } from '@kadira/storybook';
const mdContent = `
# Title
* List 1
* List 2
`;
const htmlContent = `
<h1>Title</h1>
<ol>
<li>List item 1</li>
<li>List item 2</li>
</ol>
`;
storiesOf('MarkupItReactRenderer', module)
.add('Markdown', () => (
<MarkupItReactRenderer
value={mdContent}
syntax={markdownSyntax}
/>
)).add('HTML', () => (
<MarkupItReactRenderer
value={htmlContent}
syntax={htmlSyntax}
/>
));

View File

@ -2,3 +2,4 @@ import './Card';
import './Icon';
import './Toast';
import './FindBar';
import './MarkupItReactRenderer';