-
Notifications
You must be signed in to change notification settings - Fork 182
/
welcome.stories.tsx
70 lines (58 loc) · 1.58 KB
/
welcome.stories.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import React from 'react';
import MarkdownIt from 'markdown-it';
import highlightJs from 'highlight.js';
import ReadMe from '../README.md';
import Contributing from '../CONTRIBUTING.md';
import Changelog from '../CHANGELOG.md';
import highlightStyles from './code/highlight.css';
import Markdown from './markdown/markdown';
import License from 'raw-loader!../LICENSE.txt';
const markdownIt = new MarkdownIt('commonmark', {
html: false,
highlight(str, lang) {
if (lang && highlightJs.getLanguage(lang)) {
return highlightJs.highlight(str, {language: lang}).value;
}
return '';
}
}).enable('table');
export default {
title: 'Ring UI/Welcome',
parameters: {
hermione: {skip: true}
}
};
export const gettingStarted = () => {
const renderedMarkdown = markdownIt.render(ReadMe);
return (
<Markdown>
<div
className={highlightStyles.highlightContainer}
dangerouslySetInnerHTML={{__html: renderedMarkdown}}
/>
</Markdown>
);
};
export const contributing = () => {
const renderedMarkdown = markdownIt.render(Contributing);
return (
<Markdown>
<div
className={highlightStyles.highlightContainer}
dangerouslySetInnerHTML={{__html: renderedMarkdown}}
/>
</Markdown>
);
};
export const changelog = () => {
const renderedMarkdown = markdownIt.render(Changelog);
return (
<Markdown>
<div
className={highlightStyles.highlightContainer}
dangerouslySetInnerHTML={{__html: renderedMarkdown}}
/>
</Markdown>
);
};
export const license = () => <pre>{License}</pre>;