Skip to content

Commit

Permalink
Add inverted prop in SectionListExample
Browse files Browse the repository at this point in the history
Summary:
This PR adds an option to pass`inverted` prop to SectionListExample in RNTester. FlatListExample already has this option but it's not available in SectionListExample.

Run RNTester app on device or simulator and select SectionListExample. Depending on switching `inverted` option, you can see either inverted list or not.

[GENERAL][ENHANCEMENT][RNTeater] - Add inverted prop to SectionListExample
Closes facebook#18370

Differential Revision: D7317168

Pulled By: hramos

fbshipit-source-id: c6c212c705e686281f23954775cc3465cce3c8df
  • Loading branch information
kyo504 authored and LukeDurrant committed Apr 11, 2018
1 parent 143884e commit 89b89b3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions RNTester/js/SectionListExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class SectionListExample extends React.PureComponent<{}, $FlowFixMeState> {
filterText: '',
logViewable: false,
virtualized: true,
inverted: false,
};

_scrollPos = new Animated.Value(0);
Expand Down Expand Up @@ -125,6 +126,7 @@ class SectionListExample extends React.PureComponent<{}, $FlowFixMeState> {
{renderSmallSwitchOption(this, 'virtualized')}
{renderSmallSwitchOption(this, 'logViewable')}
{renderSmallSwitchOption(this, 'debug')}
{renderSmallSwitchOption(this, 'inverted')}
<Spindicator value={this._scrollPos} />
</View>
<View style={styles.scrollToRow}>
Expand All @@ -146,6 +148,7 @@ class SectionListExample extends React.PureComponent<{}, $FlowFixMeState> {
<CustomSeparatorComponent {...info} text="ITEM SEPARATOR" />
}
debug={this.state.debug}
inverted={this.state.inverted}
enableVirtualization={this.state.virtualized}
onRefresh={() => Alert.alert('onRefresh: nothing to refresh :P')}
onScroll={this._scrollSinkY}
Expand Down Expand Up @@ -232,6 +235,8 @@ const styles = StyleSheet.create({
},
optionSection: {
flexDirection: 'row',
flexWrap: 'wrap',
alignItems: 'center',
},
searchRow: {
paddingHorizontal: 10,
Expand Down

0 comments on commit 89b89b3

Please sign in to comment.