Commit 5d180b47 authored by Trisno's avatar Trisno
parents 0da47714 e0639065
...@@ -107,7 +107,7 @@ class Outlets extends React.Component { ...@@ -107,7 +107,7 @@ class Outlets extends React.Component {
} }
dataOutlets[i]['full_address'] = address; dataOutlets[i]['full_address'] = address;
console.log("INI YAA: " + JSON.stringify(dataOutlets)); // console.log("INI YAA: " + JSON.stringify(dataOutlets));
} }
this.setState({ this.setState({
...@@ -143,7 +143,7 @@ class Outlets extends React.Component { ...@@ -143,7 +143,7 @@ class Outlets extends React.Component {
} }
} }
console.log("ISI DATANYA : " + JSON.stringify(data_city)) // console.log("ISI DATANYA : " + JSON.stringify(data_city))
this.setState({ this.setState({
data_outlet: data_city data_outlet: data_city
...@@ -173,9 +173,9 @@ class Outlets extends React.Component { ...@@ -173,9 +173,9 @@ class Outlets extends React.Component {
data_name: outletName data_name: outletName
}) })
console.log("INI ADALAH RESPON : + " + JSON.stringify(res)) // console.log("INI ADALAH RESPON : + " + JSON.stringify(res))
console.log("INI DATANYA NAME : " + outletName) // console.log("INI DATANYA NAME : " + outletName)
}).catch(error => { }).catch(error => {
const { navigation } = this.props const { navigation } = this.props
let response = error.response.data let response = error.response.data
...@@ -226,50 +226,52 @@ class Outlets extends React.Component { ...@@ -226,50 +226,52 @@ class Outlets extends React.Component {
RenderItem = ({ item }) => { RenderItem = ({ item }) => {
return ( return (
<View style={{ flexDirection: 'row', flex: 6 }}> <View style={{ flexDirection: 'row', flex: 1,marginRight:10,marginLeft:10,marginBottom:10}}>
<View style={styles.content_list}>
<View style={styles.list_addrees}> <View style={styles.list_addrees}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#ccb46c', fontSize: 18, margin: 5 }}>{item.name}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#ccb46c', fontSize: 18,margin:1 }}>{item.name}</Text>
<Text style={{ fontFamily: 'Gotham-Light', color: '#b1b1b2', fontSize: 12, margin: 5 }}>{item.full_address}</Text> <Text style={{ flexWrap: 'wrap', fontFamily: 'Gotham-Light', color: '#b1b1b2' }}>{item.full_address}</Text>
<Text style={{ fontFamily: 'Gotham-Light', margin: 5, color: '#aeaead' }}> <Text style={{ fontFamily: 'Gotham-Light', color: '#aeaead' }}>
{item.distance} KM {item.distance} KM
</Text> </Text>
</View> </View>
<View style={{flex:4,flexDirection:'row'}}> <View style={{ flex: 2, flexDirection: 'row' }}>
<View style={{ flex: 2, top: 20 }}> <View style={{margin:5}}>
<TouchableOpacity onPress={() => { Linking.openURL('tel:' + item.phone) }}> <TouchableOpacity onPress={() => { Linking.openURL('tel:' + item.phone) }}>
<Icon <Icon
name='ios-call' name='ios-call'
type='ionicon' type='ionicon'
color='grey' color='grey'
size={30} size={38}
/> />
</TouchableOpacity> </TouchableOpacity>
</View> </View>
<View style={{ flex: 2, top: 20 }}> <View style={{margin:5}}>
<TouchableOpacity onPress={() => Linking.openURL('https://www.google.com/maps/dir/?api=1&destination=' + item.lat + ' ' + item.long)}> <TouchableOpacity onPress={() => Linking.openURL('https://www.google.com/maps/dir/?api=1&destination=' + item.lat + ' ' + item.long)}>
<Icon <Icon
name='ios-navigate' name='ios-navigate'
type='ionicon' type='ionicon'
color='grey' color='grey'
size={30} size={38}
/> />
</TouchableOpacity> </TouchableOpacity>
</View> </View>
</View> </View>
</View> </View>
</View>
); );
} }
render() { render() {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<Spinner {/* <Spinner
visible={this.state.spinner} visible={this.state.spinner}
textContent={'Loading...'} textContent={'Loading...'}
textStyle={styles.spinnerTextStyle} textStyle={styles.spinnerTextStyle}
/> /> */}
<View style={{ flex: 1 }}> <View style={{ flex: 1 }}>
<MapView style={{ flex: 1 }} <MapView style={{ flex: 1 ,marginRight:10,marginLeft:10}}
region={{ region={{
latitude: this.state.my_lat, latitude: this.state.my_lat,
longitude: this.state.my_long, longitude: this.state.my_long,
...@@ -292,18 +294,23 @@ class Outlets extends React.Component { ...@@ -292,18 +294,23 @@ class Outlets extends React.Component {
</MapView> </MapView>
</View> </View>
<View style={{ height: 50, flexDirection: 'row' }}> <View style={{height:50,flexDirection:'row'}}>
<View style={{ flex: 1 }}></View> <View style={{ flex: 1 }}></View>
<View style={{ flex: 1 }}> <View style={{flex:1}}>
<RNPickerSelect <RNPickerSelect
placeholder={{ label: 'Select Area', value: null }} placeholder={{ label: 'Select Area', value: null}}
onValueChange={(label) => this.filterData(label)} onValueChange={(label) => this.filterData(label)}
items={this.state.data_outlet} items={this.state.data_outlet}
/> />
</View> </View>
</View> </View>
{/* <View style={{ height:50, flex: 1, flexDirection: 'row' }}>
<View style={{flex:1}}>
</View>
</View> */}
<View style={styles.body}> <View style={styles.body}>
<FlatList <FlatList
data={_.orderBy(this.state.dataOutlets, ['distance'], ['asc'])} data={_.orderBy(this.state.dataOutlets, ['distance'], ['asc'])}
...@@ -325,6 +332,7 @@ const styles = StyleSheet.create({ ...@@ -325,6 +332,7 @@ const styles = StyleSheet.create({
container: { container: {
flex: 1, flex: 1,
backgroundColor: 'white', backgroundColor: 'white',
}, },
header: { header: {
...@@ -336,13 +344,16 @@ const styles = StyleSheet.create({ ...@@ -336,13 +344,16 @@ const styles = StyleSheet.create({
}, },
list_addrees: { list_addrees: {
flex: 6, flex: 6,
margin: 20,
}, },
searchbar: { searchbar: {
flex: 1, flex: 1,
justifyContent: 'center', justifyContent: 'center',
margin: 10, margin: 10,
},
content_list:{
flex:1,
flexDirection:'row',
} }
}) })
......
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