Skip to content

Commit

Permalink
Shortened the long render item and header lines
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-oakes committed Jul 7, 2017
1 parent 97222c9 commit 4fc31fb
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions app/react-native/src/preview/components/StoryListView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,19 @@ export default class StoryListView extends Component {
return (
<SectionList
style={style.list}
renderItem={({ item }) => <ListItem title={item.name} selected={item.kind === this.state.selectedKind && item.name === this.state.selectedStory} onPress={() => this.changeStory(item.kind, item.name)} />}
renderSectionHeader={({ section }) => <SectionHeader title={section.title} selected={section.title === this.state.selectedKind} />}
renderItem={({ item }) => (
<ListItem
title={item.name}
selected={item.kind === this.state.selectedKind && item.name === this.state.selectedStory}
onPress={() => this.changeStory(item.kind, item.name)}
/>
)}
renderSectionHeader={({ section }) => (
<SectionHeader
title={section.title}
selected={section.title === this.state.selectedKind}
/>
)}
sections={this.state.sections}
stickySectionHeadersEnabled={false}
/>
Expand Down

0 comments on commit 4fc31fb

Please sign in to comment.