Commit 5bd2f858 authored by Trisno's avatar Trisno
parents 49199f65 2cd8629d
...@@ -242,9 +242,9 @@ class DeliveryAddrees extends React.Component { ...@@ -242,9 +242,9 @@ class DeliveryAddrees extends React.Component {
</View> </View>
<View style={{ flex: 3, justifyContent: 'center' }}> <View style={{ flex: 3, justifyContent: 'center' }}>
<View> <View>
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 15 }}>{item.name}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 15,margin:1 }}>{item.name}</Text>
</View> </View>
<Text style={{ fontFamily: 'Gotham-Light', color: 'grey', fontSize: 15 }}>{item.address}</Text> <Text style={{ fontFamily: 'Gotham-Light', color: '#838383', fontSize: 15 }}>{item.address}</Text>
</View> </View>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
......
import React from 'react'; import React from 'react';
import { View, Text, StyleSheet, FlatList, TextInput, Alert } from 'react-native'; import { View, Text, StyleSheet, FlatList, TextInput, Alert, ActivityIndicator } from 'react-native';
import { ScrollView, TouchableOpacity } from 'react-native-gesture-handler'; import { ScrollView, TouchableOpacity } from 'react-native-gesture-handler';
import Spinner from 'react-native-loading-spinner-overlay'; import Spinner from 'react-native-loading-spinner-overlay';
import { CheckBox } from 'react-native-elements'; import { CheckBox } from 'react-native-elements';
...@@ -26,6 +26,7 @@ class PickupName extends React.Component { ...@@ -26,6 +26,7 @@ class PickupName extends React.Component {
data: [], // data yg sedang aktif data: [], // data yg sedang aktif
data_before_search: [], data_before_search: [],
spinner: false, spinner: false,
indicator: true,
} }
} }
...@@ -135,14 +136,14 @@ class PickupName extends React.Component { ...@@ -135,14 +136,14 @@ class PickupName extends React.Component {
}) })
this.setState({ this.setState({
spinner: false, indicator: false,
}) })
}).catch(error => { }).catch(error => {
let response = error.response.data; let response = error.response.data;
Alert.alert(response.msg); Alert.alert(response.msg);
this.setState({ this.setState({
spinner: false, indicator: false,
}) })
}) })
} }
...@@ -285,7 +286,7 @@ class PickupName extends React.Component { ...@@ -285,7 +286,7 @@ class PickupName extends React.Component {
textStyle={styles.spinnerTextStyle} textStyle={styles.spinnerTextStyle}
/> */} /> */}
<View style={styles.searchbar}> <View style={styles.searchbar}>
<View style={{ height: 45, borderRadius: 10, borderColor: '#ccb46c', borderWidth: 1, flexDirection: 'row',backgroundColor:'red' }}> <View style={{ height: 45, borderRadius: 10, borderColor: '#ccb46c', borderWidth: 1, flexDirection: 'row' }}>
<View style={{ flex: 1,top:5 }}> <View style={{ flex: 1,top:5 }}>
<MaterialCommunityIcons name="map-marker" size={32} color="#ccb46c" /> <MaterialCommunityIcons name="map-marker" size={32} color="#ccb46c" />
</View> </View>
...@@ -301,15 +302,20 @@ class PickupName extends React.Component { ...@@ -301,15 +302,20 @@ class PickupName extends React.Component {
</View> </View>
</View> </View>
<View style={styles.body}> <View style={styles.body}>
{this.state.indicator == true ? (
<ActivityIndicator size="large" color="#c9af6d" />
) : (
<FlatList <FlatList
data={_.orderBy(this.state.dataOutlets, ['distance'], ['asc'])} data={_.orderBy(this.state.dataOutlets, ['distance'], ['asc'])}
renderItem={this.RenderItem} renderItem={this.RenderItem}
keyExtractor={item => item.id} keyExtractor={item => item.id}
windowSize={5} windowSize={5}
initialNumToRender={18} initialNumToRender={18}
maxToRenderPerBatch={2} maxToRenderPerBatch={2}
onEndReachedThreshold={0.5} onEndReachedThreshold={0.5}
/> />
)}
</View> </View>
</View> </View>
) )
...@@ -337,11 +343,11 @@ const styles = StyleSheet.create({ ...@@ -337,11 +343,11 @@ const styles = StyleSheet.create({
}, },
searchbar: { searchbar: {
flex: 1, flex: 0.5,
justifyContent: 'center', justifyContent: 'center',
top:10,
marginRight: 20, marginRight: 20,
marginLeft:20, marginLeft:20,
backgroundColor:'green'
} }
}) })
......
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