Skip to content
This repository was archived by the owner on Jun 13, 2020. It is now read-only.

Commit b30b9df

Browse files
committed
Style story code
1 parent 389d917 commit b30b9df

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

stories/Code.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const propTypes = {
1313
export default function Code(props) {
1414
return (
1515
<code>
16-
<p>{'<InputNumeric'}</p>
16+
<p className="component-name">{'<InputNumeric'}</p>
1717
{
1818
Object.keys(props.options).map((key) => {
1919
const value = props.options[key];
@@ -26,7 +26,7 @@ export default function Code(props) {
2626
return <p key={key}>&nbsp;&nbsp;{key}=&#123;{value}&#125;</p>;
2727
})
2828
}
29-
<p>{'/>'}</p>
29+
<p className="component-name">{'/>'}</p>
3030
</code>
3131
);
3232
}

stories/index.stories.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import React from 'react';
22
import { storiesOf } from '@storybook/react';
33
import { withState } from '@dump247/storybook-state';
4+
45
import Code from './Code';
56
import InputNumeric from '../lib/InputNumeric';
7+
import './style.css';
68

79

810
storiesOf('InputNumeric', module)
@@ -13,6 +15,7 @@ storiesOf('InputNumeric', module)
1315
value={store.state.value}
1416
onChange={value => store.set({ value })}
1517
/>
18+
<br />
1619
<Code
1720
options={{
1821
value: 'this.state.value',
@@ -30,6 +33,7 @@ storiesOf('InputNumeric', module)
3033
step={0.2}
3134
onChange={value => store.set({ value })}
3235
/>
36+
<br />
3337
<Code
3438
options={{
3539
value: 'this.state.value',
@@ -50,6 +54,7 @@ storiesOf('InputNumeric', module)
5054
step={0.01}
5155
onChange={value => store.set({ value })}
5256
/>
57+
<br />
5358
<Code
5459
options={{
5560
value: 'this.state.value',

stories/style.css

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
p {
2+
margin: 0;
3+
}
4+
5+
code {
6+
display: inline-block;
7+
margin: 40px 0 0 0;
8+
padding: 5px 10px;
9+
background: #F6F6F6;
10+
border-radius: 5px;
11+
12+
font-size: 14px;
13+
line-height: 1.6;
14+
}
15+
16+
code .component-name {
17+
font-weight: bold;
18+
}

0 commit comments

Comments
 (0)