Commit a5ff2b4d authored by Trisno's avatar Trisno

loading bar di outlet

parent 7c26a0b9
...@@ -40,13 +40,13 @@ class Outlets extends React.Component { ...@@ -40,13 +40,13 @@ class Outlets extends React.Component {
this._unsubscribe = this.props.navigation.addListener('focus', () => { this._unsubscribe = this.props.navigation.addListener('focus', () => {
this.setState({ this.setState({
indicator: true, indicator: true,
}) })
this._getOutletClosest() this._getOutletClosest()
this.OrderedList() this.OrderedList()
this._getPermissions() this._getPermissions()
}); });
} }
_getPermissions = async () => { _getPermissions = async () => {
...@@ -315,24 +315,25 @@ class Outlets extends React.Component { ...@@ -315,24 +315,25 @@ class Outlets extends React.Component {
placeholder={{ label: 'All City' }} placeholder={{ label: 'All City' }}
onValueChange={(label) => this.filterData(label)} onValueChange={(label) => this.filterData(label)}
items={this.state.data_outlet} items={this.state.data_outlet}
style={{inputIOSContainer: {paddingVertical: 10, alignItems: 'center'}}} style={{ inputIOSContainer: { paddingVertical: 10, alignItems: 'center' } }}
/> />
</View> </View>
</View> </View>
<View style={styles.body}> <View style={styles.body}>
{this.state.dataOutlets.length > 0 ? ( {this.state.indicator ? (<ActivityIndicator style={{ top: 20, justifyContent: "center" }} size="large" color="#c9af6d" />) : (
<FlatList this.state.dataOutlets.length > 0 ? (
data={_.orderBy(this.state.dataOutlets, ['distance'], ['asc'])} <FlatList
renderItem={this.RenderItem} data={_.orderBy(this.state.dataOutlets, ['distance'], ['asc'])}
keyExtractor={item => item.id} renderItem={this.RenderItem}
windowSize={5} keyExtractor={item => item.id}
initialNumToRender={18} windowSize={5}
maxToRenderPerBatch={2} initialNumToRender={18}
onEndReachedThreshold={0.5} maxToRenderPerBatch={2}
/> onEndReachedThreshold={0.5}
) : ( />
<Text style={{ flexWrap: 'wrap', fontFamily: 'Gotham-Light', color: '#b1b1b2', textAlign:'center' }}> Tidak Ada Outlets di area anda !</Text> ) : (
)} <Text style={{ flexWrap: 'wrap', fontFamily: 'Gotham-Light', color: '#b1b1b2', textAlign: 'center' }}> Tidak Ada Outlets di area anda !</Text>
))}
</View> </View>
</View> </View>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment