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
8e54a68d
Unverified
Commit
8e54a68d
authored
4 years ago
by
Derek
Committed by
GitHub
4 years ago
Browse files
Options
Download
Email Patches
Plain Diff
storybook: add expansion panel story (#634)
parent
450c0bd5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/packages/core/src/panel.tsx
+2
-2
frontend/packages/core/src/panel.tsx
frontend/packages/core/src/stories/panel.stories.tsx
+28
-0
frontend/packages/core/src/stories/panel.stories.tsx
with
30 additions
and
2 deletions
+30
-2
frontend/packages/core/src/panel.tsx
+
2
-
2
View file @
8e54a68d
...
...
@@ -12,7 +12,7 @@ const FullWidthExpansionPanel = styled(MuiExpansionPanel)`
width: 100%;
`
;
interface
ExpansionPanelProps
{
export
interface
ExpansionPanelProps
{
heading
:
string
;
summary
:
string
;
expanded
?:
boolean
;
...
...
@@ -25,7 +25,7 @@ const ExpansionPanel: React.FC<ExpansionPanelProps> = ({
children
,
})
=>
{
return
(
<
FullWidthExpansionPanel
e
xpanded
=
{
expanded
}
>
<
FullWidthExpansionPanel
defaultE
xpanded
=
{
expanded
}
>
<
AccordionSummary
expandIcon
=
{
<
ExpandMoreIcon
/>
}
>
<
Typography
>
{
heading
}
</
Typography
>
<
div
style
=
{
{
flexGrow
:
1
}
}
/>
...
...
This diff is collapsed.
Click to expand it.
frontend/packages/core/src/stories/panel.stories.tsx
0 → 100644
+
28
-
0
View file @
8e54a68d
import
React
from
"
react
"
;
import
type
{
Meta
}
from
"
@storybook/react
"
;
import
type
{
ExpansionPanelProps
}
from
"
../panel
"
;
import
ExpansionPanel
from
"
../panel
"
;
export
default
{
title
:
"
Core/ExpansionPanel
"
,
component
:
ExpansionPanel
,
}
as
Meta
;
const
Template
=
(
props
:
ExpansionPanelProps
)
=>
(
<
ExpansionPanel
{
...
props
}
>
<
img
alt
=
"clutch logo"
src
=
"https://clutch.sh/img/navigation/logo.svg"
height
=
"100px"
/>
</
ExpansionPanel
>
);
export
const
Primary
=
Template
.
bind
({});
Primary
.
args
=
{
heading
:
"
Check this out!
"
,
summary
:
"
This is an expansion panel.
"
,
};
export
const
Expanded
=
Template
.
bind
({});
Expanded
.
args
=
{
...
Primary
.
args
,
expanded
:
true
,
};
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