Skip to content

Commit 6c836c1

Browse files
committed
updated renderHTML to fix error in all components
1 parent 6be9b3f commit 6c836c1

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

.storybook/renderToHTML.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { renderToStaticMarkup } from 'react-dom/server'
22
import { decode } from 'html-entities'
3-
import prettier from 'prettier'
4-
import HTMLParser from 'prettier/parser-html'
3+
import * as prettier from 'prettier'
4+
import * as HTMLParser from 'prettier/parser-html'
55

66
export default (story) => {
77
let html = prettier.format(decode(renderToStaticMarkup(story)), {

stories/Atom/BaseTypography/BaseTypography.stories.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default {
3232
</ul>
3333
<p>Typographic scale when using abbreviation in text component:</p>
3434

35-
<Story of={AbbreviationComponent}><Canvas of={AbbreviationComponent} /></Story>
35+
<Canvas of={AbbreviationComponent} />
3636

3737
<h3>Blockquote</h3>
3838
<p>The blockquote component is used to define a section that is quoted from another source.</p>
@@ -41,7 +41,7 @@ export default {
4141
</ul>
4242
<p>Typographic scale when using blockquote in text component:</p>
4343

44-
<Story of={BlockquoteComponent}><Canvas of={BlockquoteComponent} /></Story>
44+
<Canvas of={BlockquoteComponent} />
4545

4646
<h3>Cite</h3>
4747
<p>The Cite component defines the title of a creative work (e.g. a book, a poem, a song, a movie, a painting, a sculpture, etc.).</p>
@@ -50,7 +50,7 @@ export default {
5050
</ul>
5151
<p>Typographic scale when using cite in text component:</p>
5252

53-
<Story of={CiteComponent}><Canvas of={CiteComponent} /></Story>
53+
<Canvas of={CiteComponent} />
5454

5555
<h3>Code</h3>
5656
<p>The code component is used to define a piece of computer code. The content inside is displayed in the browser's default monospace font.</p>
@@ -59,31 +59,31 @@ export default {
5959
</ul>
6060
<p>Typographic scale when using code in text component:</p>
6161

62-
<Story of={CodeComponent}><Canvas of={CodeComponent} /></Story>
62+
<Canvas of={CodeComponent} />
6363

6464
<h3>Description List</h3>
6565
<p>A description list is a list of terms, with a description of each term.</p>
6666
<ul>
6767
<li>The <code>dl tag</code> defines the description list, the <code>dt tag</code> defines the term (name), and the <code>dd tag</code> describes each term.</li>
6868
</ul>
6969

70-
<Story of={DescriptionlistComponent}><Canvas of={DescriptionlistComponent} /></Story>
70+
<Canvas of={DescriptionlistComponent} />
7171

7272
<h3>Details</h3>
7373
<p>The details tag creates a disclosure widget in which information is visible only when the widget is toggled into an "open" state. A summary or label must be provided using the summary element.</p>
7474

75-
<Story of={DetailsTagComponent}><Canvas of={DetailsTagComponent} /></Story>
75+
<Canvas of={DetailsTagComponent} />
7676

7777
<h3>Figcaption</h3>
7878
<p>The <code>figcaption</code> tag is used to caption the image. The <code>figcaption</code> tag is used with the <code>figure</code> tag.</p>
7979

80-
<Story of={FigcaptionComponent}><Canvas of={FigcaptionComponent} /></Story>
80+
<Canvas of={FigcaptionComponent} />
8181

8282
<h3>Headings</h3>
8383
<p>We can use the <code>h1/h2/h3/h4/h5/h6 tags</code> in any component to display the headings. h1 for most important heading to h6 for least important heading.</p>
8484
<p>Typographic scale when using headings in text component:</p>
8585

86-
<Story of={HeadingComponent}><Canvas of={HeadingComponent} /></Story>
86+
<Canvas of={HeadingComponent} />
8787

8888
<h3>Horizontal Rule</h3>
8989
<p>The <code>hr tag</code> defines a thematic break in an HTML page, and is most often displayed as a horizontal rule.</p>
@@ -92,7 +92,7 @@ export default {
9292
</ul>
9393
<p>Typographic scale when using hr in text component:</p>
9494

95-
<Story of={HrComponent}><Canvas of={HrComponent} /></Story>
95+
<Canvas of={HrComponent} />
9696

9797
<h3>Mark</h3>
9898
<p>The <code>mark tag</code> defines marked or highlighted text.</p>
@@ -101,15 +101,15 @@ export default {
101101
</ul>
102102
<p>Typographic scale when using mark in text component:</p>
103103

104-
<Story of={MarkComponent}><Canvas of={MarkComponent} /></Story>
104+
<Canvas of={MarkComponent} />
105105

106106
<h3>Ordered List</h3>
107107
<p>The <code>ol tag</code> defines an ordered list. An ordered list can be numerical or alphabetical.</p>
108108
<ul>
109109
<li>We can use the <code>ol tag</code> in any component to render the text found within the <code>ol tag</code> in a numerical or alphabetical list.</li>
110110
</ul>
111111

112-
<Story of={ListComponent}><Canvas of={ListComponent} /></Story>
112+
<Canvas of={ListComponent} />
113113

114114
<h3>Paragraph</h3>
115115
<p>The <code>p tag</code> defines a paragraph.</p>
@@ -118,7 +118,7 @@ export default {
118118
</ul>
119119
<p>Typographic scale when using paragraph in text component:</p>
120120

121-
<Story of={PComponent}><Canvas of={PComponent} /></Story>
121+
<Canvas of={PComponent} />
122122

123123
<h3>Quotation</h3>
124124
<p>The <code>q tag</code> defines a short quotation.</p>
@@ -127,7 +127,7 @@ export default {
127127
</ul>
128128
<p>Typographic scale when using quotation in text component:</p>
129129

130-
<Story of={QuotationComponent}><Canvas of={QuotationComponent} /></Story>
130+
<Canvas of={QuotationComponent} />
131131

132132
<h3>Small</h3>
133133

@@ -137,7 +137,7 @@ export default {
137137
</ul>
138138
<p>Typographic scale when using small in text component:</p>
139139

140-
<Story of={SmallComponent}><Canvas of={SmallComponent} /></Story>
140+
<Canvas of={SmallComponent} />
141141

142142
<h3>Unordered List</h3>
143143

@@ -146,7 +146,7 @@ export default {
146146
<li>We can use the <code>ul tag</code> in any component to render the text found within the <code>ul tag</code> in a bulleted list.</li>
147147
</ul>
148148

149-
<Story of={ListComponent}><Canvas of={ListComponent} /></Story>
149+
<Canvas of={ListComponent} />
150150

151151
<h3>Usage</h3>
152152

stories/Atom/Logo/Logo.stories.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,22 @@ export default {
6363
<h4>1. PNUD logo - Blue <a href="images/pnud-logo-blue.svg" download>Download</a></h4>
6464

6565

66-
<Story><Canvas of={PNUDLogoBlue} /></Story>
66+
<Canvas of={PNUDLogoBlue} />
6767

6868
<h4>2. PNUD logo - White <a href="images/pnud-logo-white.svg" download>Download</a></h4>
6969

7070

71-
<Story of={PNUDLogoWhite}><Canvas of={PNUDLogoWhite} /></Story>
71+
<Canvas of={PNUDLogoWhite} />
7272

7373
<h4>3. UNDP Logo - Blue</h4>
7474

7575

76-
<Story of={UNDPLogoBlue}><Canvas of={UNDPLogoBlue} /></Story>
76+
<Canvas of={UNDPLogoBlue} />
7777

7878
<h4>4. UNDP Logo - White</h4>
7979

8080

81-
<Story of={UNDPLogoWhite}><Canvas of={UNDPLogoWhite} /></Story>
81+
<Canvas of={UNDPLogoWhite} />
8282

8383
<h3>Interactions</h3>
8484
<p>By clicking on the logo, the website is redirected to the homepage.</p>

0 commit comments

Comments
 (0)