Skip to content

Commit

Permalink
Make left-panel scrollable.
Browse files Browse the repository at this point in the history
  • Loading branch information
arunoda committed May 10, 2016
1 parent f9046d2 commit a6424b1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
4 changes: 2 additions & 2 deletions dist/manager.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/manager.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 15 additions & 8 deletions src/client/manager/modules/ui/components/left_panel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,28 @@ import Stories from './stories';
import TextFilter from './text_filter';
import pick from 'lodash.pick';

const scrollStyle = {
height: '100vh',
overflowY: 'auto',
};

const mainStyle = {
padding: 20,
};

const storyProps = ['stories', 'selectedKind', 'selectedStory', 'onSelectStory'];

const LeftPanel = (props) => (
<div style={mainStyle}>
<Header openShortcutsHelp={props.openShortcutsHelp} />
<TextFilter
text={props.storyFilter}
onClear={() => props.onStoryFilter('')}
onChange={(text) => props.onStoryFilter(text)}
/>
{props.stories ? (<Stories {...pick(props, storyProps)} />) : null}
<div style={scrollStyle}>
<div style={mainStyle}>
<Header openShortcutsHelp={props.openShortcutsHelp} />
<TextFilter
text={props.storyFilter}
onClear={() => props.onStoryFilter('')}
onChange={(text) => props.onStoryFilter(text)}
/>
{props.stories ? (<Stories {...pick(props, storyProps)} />) : null}
</div>
</div>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';
import { baseFonts } from '../theme';

const listStyle = {
overflowY: 'auto',
marginTop: 10,
...baseFonts,
};
Expand Down

0 comments on commit a6424b1

Please sign in to comment.