mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-04 22:21:27 +08:00
extract empty stories tree check to seperate function
This commit is contained in:
parent
7addf9f69d
commit
4806e8b83c
@ -25,6 +25,10 @@ const storyProps = [
|
||||
'sidebarAnimations',
|
||||
];
|
||||
|
||||
function hierarchyContainsStories(storiesHierarchy) {
|
||||
return storiesHierarchy && storiesHierarchy.map.size
|
||||
}
|
||||
|
||||
// eslint-disable-next-line react/prefer-stateless-function
|
||||
class LeftPanel extends Component {
|
||||
render() {
|
||||
@ -46,7 +50,7 @@ class LeftPanel extends Component {
|
||||
onChange={text => onStoryFilter(text)}
|
||||
/>
|
||||
<div style={scrollStyle}>
|
||||
{storiesHierarchy && storiesHierarchy.map.size
|
||||
{hierarchyContainsStories(storiesHierarchy)
|
||||
? <Stories {...pick(this.props, storyProps)} />
|
||||
: null}
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user