react-native-complete-flatlist
Advanced tools
Comparing version 2.0.2 to 2.0.3
31
index.js
@@ -11,9 +11,8 @@ import React from 'react'; | ||
Animated, | ||
} from "react-native"; | ||
} from 'react-native'; | ||
class CompleteFlatList extends React.Component { | ||
state = { | ||
behavior: "padding", | ||
refreshing: false, | ||
searchText: "", | ||
searchText: '', | ||
rowScale: new Animated.Value(0), | ||
@@ -32,3 +31,3 @@ slide: new Animated.Value(0), | ||
onSearch: null, | ||
highlightColor: "", | ||
highlightColor: '', | ||
backgroundStyles: {}, | ||
@@ -69,8 +68,7 @@ searchTextInputStyle: {}, | ||
this.setState({ refreshing: true }); | ||
setTimeout(() => { | ||
this.setState({ refreshing: false }); | ||
}, 7000); | ||
setTimeout(() => this.setState({ refreshing: false }), 7000); | ||
}; | ||
refresh = () => { | ||
let filtereddata = null; | ||
if (this.props.data.length === 0) { | ||
@@ -85,3 +83,3 @@ filtereddata = [{ type: "emptyrow", name: "No data available" }]; | ||
const { data, searchKey, highlightColor, onSearch } = this.props; | ||
if (this.state.searchText === "" || onSearch !== null) { | ||
if (this.state.searchText === '' || onSearch !== null) { | ||
return data; | ||
@@ -195,9 +193,7 @@ } | ||
return ( | ||
<View | ||
behavior={this.state.behavior} | ||
style={[styles.container, backgroundStyles]} | ||
> | ||
<View style={[styles.container, backgroundStyles]}> | ||
{showSearch && searchbar} | ||
{this.props.elementBetweenSearchAndList} | ||
<FlatList | ||
style={{ height: '100%' }} | ||
ItemSeparatorComponent={renderSeparator} | ||
@@ -209,13 +205,7 @@ scrollEventThrottle={16} | ||
onSearch !== null ? ( | ||
<RefreshControl | ||
refreshing={isRefreshing} | ||
onRefresh={() => onSearch(searchText)} | ||
/> | ||
<RefreshControl refreshing={isRefreshing} onRefresh={() => onSearch(searchText)} /> | ||
) | ||
: | ||
pullToRefreshCallback !== null ? ( | ||
<RefreshControl | ||
refreshing={isRefreshing} | ||
onRefresh={pullToRefreshCallback} | ||
/> | ||
<RefreshControl refreshing={isRefreshing} onRefresh={pullToRefreshCallback} /> | ||
) : null | ||
@@ -264,2 +254,3 @@ } | ||
flex: 1, | ||
height: '100%', | ||
justifyContent: "center", | ||
@@ -266,0 +257,0 @@ alignItems: "center", |
{ | ||
"name": "react-native-complete-flatlist", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "An extension of React Native's Flatlist with search bar, highlighted search, pull to refresh, and etc is ready to use", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16309
243