Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mr-julyedu
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
baiguangyao
mr-julyedu
Commits
a2e1f415
Commit
a2e1f415
authored
Aug 07, 2020
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storybook
parent
3c39d073
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
91 additions
and
0 deletions
+91
-0
.storybook/main.js
+54
-0
stories/0-Welcome.stories.js
+14
-0
stories/1-Button.stories.js
+23
-0
No files found.
.storybook/main.js
0 → 100644
View file @
a2e1f415
const
postcssNormalize
=
require
(
'postcss-normalize'
)
const
path
=
require
(
'path'
)
module
.
exports
=
{
stories
:
[
'../src/common/**/*.stories.tsx'
],
addons
:
[
{
name
:
'@storybook/preset-typescript'
,
options
:
{
tsLoaderOptions
:
{
configFile
:
path
.
resolve
(
__dirname
,
'../tsconfig.json'
),
},
},
},
'@storybook/addon-actions'
,
'@storybook/addon-links'
,
'@storybook/addon-knobs'
,
],
webpackFinal
:
async
config
=>
{
config
.
module
.
rules
.
push
({
test
:
/
\.
scss$/
,
use
:
[
'style-loader'
,
'css-loader'
,
{
loader
:
require
.
resolve
(
'postcss-loader'
),
options
:
{
ident
:
'postcss'
,
plugins
:
()
=>
[
require
(
'postcss-flexbugs-fixes'
),
require
(
'postcss-preset-env'
)({
autoprefixer
:
{
flexbox
:
'no-2009'
,
},
stage
:
3
,
}),
/*require('postcss-px-to-viewport')({
viewportWidth: 375,
unitPrecision: 6,
selectorBlackList: ['skip-vw'],
}),*/
postcssNormalize
(),
],
sourceMap
:
false
,
},
},
{
loader
:
'sass-loader'
,
},
],
})
return
config
;
},
};
stories/0-Welcome.stories.js
0 → 100644
View file @
a2e1f415
import
React
from
'react'
;
import
{
linkTo
}
from
'@storybook/addon-links'
;
import
{
Welcome
}
from
'@storybook/react/demo'
;
export
default
{
title
:
'Welcome'
,
component
:
Welcome
,
};
export
const
ToStorybook
=
()
=>
<
Welcome
showApp
=
{
linkTo
(
'Button'
)}
/>
;
ToStorybook
.
story
=
{
name
:
'to Storybook'
,
};
stories/1-Button.stories.js
0 → 100644
View file @
a2e1f415
import
React
from
'react'
;
import
{
action
}
from
'@storybook/addon-actions'
;
import
{
Button
}
from
'@storybook/react/demo'
;
export
default
{
title
:
'Button'
,
component
:
Button
,
};
export
const
Text
=
()
=>
<
Button
onClick
=
{
action
(
'clicked'
)}
>
Hello
Button
<
/Button>
;
export
const
Emoji
=
()
=>
(
<
Button
onClick
=
{
action
(
'clicked'
)}
>
<
span
role
=
"img"
aria
-
label
=
"so cool"
>
😀
😎
👍
💯
<
/span
>
<
/Button
>
);
Emoji
.
story
=
{
name
:
'with emoji'
,
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment