Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Clutch
Commits
be8d04d6
Unverified
Commit
be8d04d6
authored
4 years ago
by
Scarlett Perry
Committed by
GitHub
4 years ago
Browse files
Options
Download
Email Patches
Plain Diff
storybook: add button story for default and destructive variant (#563)
parent
bfd44e01
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
frontend/packages/core/src/button.tsx
+5
-1
frontend/packages/core/src/button.tsx
frontend/packages/core/src/stories/button.stories.tsx
+26
-0
frontend/packages/core/src/stories/button.stories.tsx
frontend/tsconfig.json
+2
-1
frontend/tsconfig.json
with
33 additions
and
2 deletions
+33
-2
frontend/packages/core/src/button.tsx
+
5
-
1
View file @
be8d04d6
...
...
@@ -19,7 +19,11 @@ const StyledButton = styled(MuiButton)`
`
}
`
;
interface
ButtonProps
extends
MuiButtonProps
{
interface
ButtonProps
extends
Pick
<
MuiButtonProps
,
"
disabled
"
|
"
endIcon
"
|
"
onClick
"
|
"
size
"
|
"
startIcon
"
|
"
type
"
|
"
variant
"
>
{
text
:
string
;
destructive
?:
boolean
;
}
...
...
This diff is collapsed.
Click to expand it.
frontend/packages/core/src/stories/button.stories.tsx
0 → 100644
+
26
-
0
View file @
be8d04d6
import
React
from
"
react
"
;
import
type
{
Meta
}
from
"
@storybook/react
"
;
import
type
{
ButtonProps
}
from
"
../button
"
;
import
{
Button
}
from
"
../button
"
;
export
default
{
title
:
"
Core/Button
"
,
component
:
Button
,
argTypes
:
{
onClick
:
{
action
:
"
onClick event
"
},
},
}
as
Meta
;
const
Template
=
(
props
:
ButtonProps
)
=>
<
Button
{
...
props
}
/>;
export
const
Default
=
Template
.
bind
({});
Default
.
args
=
{
text
:
"
continue
"
,
};
export
const
Destructive
=
Template
.
bind
({});
Destructive
.
args
=
{
text
:
"
delete
"
,
destructive
:
true
,
};
This diff is collapsed.
Click to expand it.
frontend/tsconfig.json
+
2
-
1
View file @
be8d04d6
...
...
@@ -20,7 +20,8 @@
},
"exclude"
:
[
"node_modules"
,
"**/stories/*"
,
"**/*.stories.ts*"
,
"**/*.stories.js*"
,
"**/*.test.js*"
,
"**/*.test.ts*"
],
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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