Skip to content

Commit 198b4ae

Browse files
fix: storybook issue caused by eslint formatting (#50)
1 parent e515f98 commit 198b4ae

File tree

2 files changed

+34
-30
lines changed

2 files changed

+34
-30
lines changed

stories/ChipsStories/FilterChip.stories.tsx

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { Title, Subtitle, Description, Primary, ArgsTable, Stories, PRIMARY_STORY } from '@storybook/addon-docs';
12
import { useArgs } from '@storybook/client-api';
23
import React from 'react';
3-
import { Title, Subtitle, Description, Primary, ArgsTable, Stories, PRIMARY_STORY } from '@storybook/addon-docs';
44
// @ts-ignore
55
import Readme from '../../packages/css/src/chips/README.md';
66

@@ -12,17 +12,19 @@ export default {
1212
component: MdFilterChip,
1313
parameters: {
1414
docs: {
15-
page: () => {return (
16-
<>
17-
<Title />
18-
<Subtitle />
19-
<Description />
20-
<Primary />
21-
<ArgsTable story={PRIMARY_STORY} />
22-
<Stories />
23-
<Description markdown={Readme} />
24-
</>
25-
)},
15+
page: () => {
16+
return (
17+
<>
18+
<Title />
19+
<Subtitle />
20+
<Description />
21+
<Primary />
22+
<ArgsTable story={PRIMARY_STORY} />
23+
<Stories />
24+
<Description markdown={Readme} />
25+
</>
26+
);
27+
},
2628
description: {
2729
component:
2830
"A chip component used for filters. Requires an onClick handler.<br/><br/>`import { MdFilterChip } from '@miljodirektoratet/md-react'`",
@@ -97,15 +99,15 @@ const Template = args => {
9799
const [_, updateArgs] = useArgs();
98100

99101
const handleClick = () => {
100-
updateArgs({ ...args active: !args.active });
102+
updateArgs({ ...args, active: !args.active });
101103
};
102104

103105
return (
104106
<MdFilterChip
105107
{...args}
106108
prefixIcon={args.prefixIcon ? <MdUserIcon /> : null}
107-
onClick={e => {
108-
handleClick(e);
109+
onClick={() => {
110+
handleClick();
109111
}}
110112
/>
111113
);

stories/ChipsStories/InputChip.stories.tsx

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { Title, Subtitle, Description, Primary, ArgsTable, Stories, PRIMARY_STORY } from '@storybook/addon-docs';
12
import { useArgs } from '@storybook/client-api';
23
import React from 'react';
3-
import { Title, Subtitle, Description, Primary, ArgsTable, Stories, PRIMARY_STORY } from '@storybook/addon-docs';
44
// @ts-ignore
55
import Readme from '../../packages/css/src/chips/README.md';
66

@@ -12,17 +12,19 @@ export default {
1212
component: MdInputChip,
1313
parameters: {
1414
docs: {
15-
page: () => {return (
16-
<>
17-
<Title />
18-
<Subtitle />
19-
<Description />
20-
<Primary />
21-
<ArgsTable story={PRIMARY_STORY} />
22-
<Stories />
23-
<Description markdown={Readme} />
24-
</>
25-
)},
15+
page: () => {
16+
return (
17+
<>
18+
<Title />
19+
<Subtitle />
20+
<Description />
21+
<Primary />
22+
<ArgsTable story={PRIMARY_STORY} />
23+
<Stories />
24+
<Description markdown={Readme} />
25+
</>
26+
);
27+
},
2628
description: {
2729
component:
2830
"A chip component. Requires an onClick handler. In this example clicks toggle active state.<br/><br/>`import { MdInputChip } from '@miljodirektoratet/md-react'`",
@@ -117,15 +119,15 @@ const Template = args => {
117119
const [_, updateArgs] = useArgs();
118120

119121
const handleClick = () => {
120-
updateArgs({ ...args active: !args.active });
122+
updateArgs({ ...args, active: !args.active });
121123
};
122124

123125
return (
124126
<MdInputChip
125127
{...args}
126128
prefixIcon={args.prefixIcon ? <MdUserIcon /> : null}
127-
onClick={e => {
128-
handleClick(e);
129+
onClick={() => {
130+
handleClick();
129131
}}
130132
/>
131133
);

0 commit comments

Comments
 (0)