Commit 7b1339f6 authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

Merge branch 'master' of ssh://repo.cs.co.id:2222/wahyu/bahanoprek

# Conflicts:
#	view/OrderDetail.js
parents 6987923f a3066646
...@@ -226,13 +226,7 @@ class Account extends React.Component { ...@@ -226,13 +226,7 @@ class Account extends React.Component {
<View> <View>
<View style={styles.Card}> <View style={styles.Card}>
<View style={styles.card}> <View style={styles.card}>
<Card style={{ padding: 20, margin: 10, alignContent: 'center' }}> <Card style={{ padding: 5, margin: 5, alignContent: 'center' }}>
{/* <Text>
{i18n.t('yourCardNumber')} | {this.state.expire_date}{'\n'}
</Text> */}
{/* <Text>
YOUR CARD NUMBER | {this.state.expire_date}
</Text> */}
<View style={{ flexDirection: 'row', flex: 1, paddingBottom: 5 }}> <View style={{ flexDirection: 'row', flex: 1, paddingBottom: 5 }}>
<View style={{ flex: 0.5 }}> <View style={{ flex: 0.5 }}>
<Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>YOUR CARD NUMBER</Text> <Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>YOUR CARD NUMBER</Text>
...@@ -247,12 +241,6 @@ class Account extends React.Component { ...@@ -247,12 +241,6 @@ class Account extends React.Component {
</Text> </Text>
</View> </View>
<View style={styles.line}></View> <View style={styles.line}></View>
{/* <Text style={{ textAlign: 'left', fontWeight: 'bold' }}>
{i18n.t('balance')} {this.state.balance}
</Text> */}
<View style={{ flexDirection: 'row', flex: 1 }}> <View style={{ flexDirection: 'row', flex: 1 }}>
<View style={{ flex: 0.3, justifyContent: 'center' }}> <View style={{ flex: 0.3, justifyContent: 'center' }}>
{/* <Text>{i18n.t('balance')}</Text> */} {/* <Text>{i18n.t('balance')}</Text> */}
...@@ -262,12 +250,7 @@ class Account extends React.Component { ...@@ -262,12 +250,7 @@ class Account extends React.Component {
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'gray' }}>IDR {this.state.balance}</Text> <Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'gray' }}>IDR {this.state.balance}</Text>
</View> </View>
</View> </View>
<View style={styles.line2}></View> <View style={styles.line2}></View>
{/* <Text style={{ textAlign: 'left', fontWeight: 'bold' }}>
{i18n.t('point')} {this.state.point}
</Text> */}
<View style={{ flexDirection: 'row', flex: 1 }}> <View style={{ flexDirection: 'row', flex: 1 }}>
<View style={{ flex: 0.3, justifyContent: 'center' }}> <View style={{ flex: 0.3, justifyContent: 'center' }}>
{/* <Text>{i18n.t('balance')}</Text> */} {/* <Text>{i18n.t('balance')}</Text> */}
...@@ -283,7 +266,7 @@ class Account extends React.Component { ...@@ -283,7 +266,7 @@ class Account extends React.Component {
<TouchableOpacity style={styles.submitTopUp} activeOpacity={.5} onPress={() => this.props.navigation.navigate('TopUpInfo')}> <TouchableOpacity style={styles.submitTopUp} activeOpacity={.5} onPress={() => this.props.navigation.navigate('TopUpInfo')}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center' }}>TOP UP BALANCE</Text> <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center' }}>TOP UP BALANCE</Text>
</TouchableOpacity> </TouchableOpacity>
<View style={{ padding: 10, margin: 10, height: 200, top: 10 }}> <View style={{ padding: 10, height: 200, top: 10, margin: 10 }}>
<ImageBackground style={{ width: '100%', height: '100%', padding: 0, margin: 0 }} resizeMode='stretch' source={this.state.img_card ? { uri: this.state.img_card } : null}> <ImageBackground style={{ width: '100%', height: '100%', padding: 0, margin: 0 }} resizeMode='stretch' source={this.state.img_card ? { uri: this.state.img_card } : null}>
<View style={{ justifyContent: 'center' }}> <View style={{ justifyContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', margin: 15, fontSize: 14, color: '#c9af6d', top: 120 }}> <Text style={{ fontFamily: 'Gotham-Black', margin: 15, fontSize: 14, color: '#c9af6d', top: 120 }}>
...@@ -293,8 +276,8 @@ class Account extends React.Component { ...@@ -293,8 +276,8 @@ class Account extends React.Component {
</ImageBackground> </ImageBackground>
</View> </View>
<View style={{ marginLeft: 20, marginRight: 20, padding: 5 }}> <View style={{ marginLeft: 20, marginRight: 20, padding: 5 }}>
<View style={{ flex: 1, flexDirection: 'row', justifyContent: 'center' }}> <View style={{ flex: 1, flexDirection: 'row', justifyContent: 'center', margin: 5 }}>
<TouchableOpacity style={{ marginBottom:5}} onPress={() => this.TransferBalance()} > <TouchableOpacity style={{ marginBottom: 5, margin: 3 }} onPress={() => this.TransferBalance()} >
<Card style={{ height: 120, width: 155 }}> <Card style={{ height: 120, width: 155 }}>
<View style={{ height: 50, alignItems: 'center', padding: 10 }}> <View style={{ height: 50, alignItems: 'center', padding: 10 }}>
<Image <Image
...@@ -306,63 +289,65 @@ class Account extends React.Component { ...@@ -306,63 +289,65 @@ class Account extends React.Component {
</Card> </Card>
</TouchableOpacity> </TouchableOpacity>
<View style={{ width: 5 }}></View> <View style={{ width: 5 }}></View>
<TouchableOpacity style={{ marginBottom:5}}> <TouchableOpacity style={{ marginBottom: 5, margin: 3 }}>
<Card style={{ height: 120, width: 155 }}> <Card style={{ height: 120, width: 155 }}>
<View style={{ height: 50, alignItems: 'center', padding: 10 }}> <View style={{ height: 50, alignItems: 'center', padding: 10 }}>
<Image <Image
style={{ height: 50, width: 50, justifyContent: 'center' }} style={{ height: 50, width: 50, justifyContent: 'center' }}
source={require('../assets/icon/2.png')} source={require('../assets/icon/2.png')}
/> />
<Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', top: 5, fontSize: 14, color: '#838383' }}>BALANCE / POINT</Text> <Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', top: 5, fontSize: 14, color: '#838383' }}>USE BALANCE / POINT</Text>
</View> </View>
</Card> </Card>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
<View style={{ flex: 1, flexDirection: 'row', justifyContent: 'center'}}> <View style={{ flex: 1, flexDirection: 'row', justifyContent: 'center' }}>
<TouchableOpacity style={{ marginBottom: 5 }} onPress={() => this.TransferBalance()} >
<Card style={{ height: 120, width: 155 }}>
<TouchableOpacity style={{ marginBottom: 5, margin: 4 }} onPress={() => this.props.navigation.navigate('Transaction History')} >
<Card style={{ height: 120, width: 155 }}>
<View style={{ height: 50, alignItems: 'center', padding: 10 }}> <View style={{ height: 50, alignItems: 'center', padding: 10 }}>
<Image <Image
style={{ height: 50, width: 50, justifyContent: 'center' }} style={{ height: 50, width: 50, justifyContent: 'center' }}
source={require('../assets/icon/4.png')} source={require('../assets/icon/1.png')}
/> />
<Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', top: 5, fontSize: 14, margin: 5, color: '#838383' }}>RENEWAL</Text> <Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', fontSize: 14, margin: 5, color: '#838383' }}>TRANSACTION HISTORY</Text>
</View> </View>
</Card> </Card>
</TouchableOpacity> </TouchableOpacity>
<View style={{ width: 5 }}></View> <View style={{ width: 5 }}></View>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Transaction History')} > <TouchableOpacity style={{ marginBottom: 5, margin: 4 }} onPress={() => this.TransferBalance()} >
<Card style={{ height: 120, width: 155 }}> <Card style={{ height: 120, width: 155 }}>
<View style={{ height: 50, alignItems: 'center', padding: 10 }}> <View style={{ height: 50, alignItems: 'center', padding: 10 }}>
<Image <Image
style={{ height: 50, width: 50, justifyContent: 'center' }} style={{ height: 50, width: 50, justifyContent: 'center' }}
source={require('../assets/icon/4.png')} source={require('../assets/icon/3.png')}
/> />
<Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', fontSize: 14, margin: 5, color: '#838383' }}>TRANSACTION HISTORY</Text> <Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', top: 5, fontSize: 14, margin: 5, color: '#838383' }}>RENEWAL</Text>
</View> </View>
</Card> </Card>
</TouchableOpacity> </TouchableOpacity>
</View>
<View style={{ flex: 1, flexDirection: 'row', justifyContent: 'center' }}>
{this.state.premium === false ? (
<TouchableOpacity onPress={() => this.props.navigation.navigate('Upgrade Premium')} style={{ marginBottom: 20, marginRight: 5, marginLeft: 5 }}>
<Card style={{ height: 120, width: 155 }}>
<View style={{ height: 50, alignItems: 'center' }}>
<MaterialIcons name="autorenew" size={30} color="gray" style={{ top: 20 }} />
<Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', top: 30, fontSize: 14, color: '#838383' }}>UPGRADE PREMIUM</Text>
</View>
</Card>
</TouchableOpacity>
) : (
null
)}
</View> </View>
<View style={{ flex:1, flexDirection: 'row', justifyContent: 'center'}}>
{this.state.premium === false ? (
<TouchableOpacity onPress={() => this.props.navigation.navigate('Upgrade Premium')} style={{ marginBottom: 20, marginRight: 5, marginLeft: 5 }}>
<Card style={{ height: 120, width: 155 }}>
<View style={{ height: 50, alignItems: 'center' }}>
<MaterialIcons name="autorenew" size={30} color="gray" style={{ top: 20 }} />
<Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', top: 30, fontSize: 14, color: '#838383' }}>UPGRADE PREMIUM</Text>
</View>
</Card>
</TouchableOpacity>
) : (
null
)}
</View>
</View> </View>
<View style={{ flex: 1 }}> <View style={{ flex: 1 }}>
<TouchableOpacity onPress={() => this.logout()}> <TouchableOpacity onPress={() => this.logout()}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', justifyContent: 'center', marginLeft: 20, marginRight: 20, marginBottom: 20, padding: 5, bottom: 5,top:1 }}> <View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', justifyContent: 'center', marginLeft: 20, marginRight: 20, marginBottom: 20, padding: 5, bottom: 5, top: 1 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center' }}>LOGOUT</Text> <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center' }}>LOGOUT</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
...@@ -405,7 +390,7 @@ const styles = StyleSheet.create({ ...@@ -405,7 +390,7 @@ const styles = StyleSheet.create({
}, },
card: { card: {
top: 20, top: 10,
flex: 1, flex: 1,
alignItems: 'center', alignItems: 'center',
marginRight: 10, marginRight: 10,
...@@ -510,43 +495,3 @@ const mapDispatchToProps = (dispacth) => { ...@@ -510,43 +495,3 @@ const mapDispatchToProps = (dispacth) => {
} }
export default connect(mapStateToProps, mapDispatchToProps)(Account); export default connect(mapStateToProps, mapDispatchToProps)(Account);
{/* <TouchableOpacity onPress={() => this.props.navigation.navigate('Profile')} style={{ marginBottom: 10 }}>
<Card style={{ height: 100, width: 160 }}>
<View style={{ height: 50, alignItems: 'center' }}>
<MaterialIcons name="monetization-on" size={30} color="gray" style={{ top: 20 }} />
<Text style={{ textAlign: 'center', top: 30, fontSize: 14 }}>PROFIL</Text>
</View>
</Card>
</TouchableOpacity>
<View style={{ width: 5 }}></View>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Card Activation')}>
<Card style={{ height: 100, width: 160 }}>
<View style={{ height: 50, alignItems: 'center' }}>
<AntDesign name="shoppingcart" size={30} color="gray" style={{ top: 20 }} />
<Text style={{ textAlign: 'center', top: 30, fontSize: 14 }}>ACTIVATION CARD</Text>
</View>
</Card>
</TouchableOpacity> */}
{/* <View style={{ flex: 1, flexDirection: 'row', justifyContent: 'center' }}>
<View style={{ height: 250, flex: 1, backgroundColor: 'grey', marginRight: 20, marginLeft: 20, top: 25, borderRadius: 20 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', top: 20 }}>No card yet</Text>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Card Activation')}>
<View style={{ height: 50, borderRadius: 20, backgroundColor: 'white', marginRight: 20, marginLeft: 20, }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 15 }}>ACTIVATE CARD</Text>
</View>
</TouchableOpacity>
</View>
</View>
<View>
<TouchableOpacity style={{backgroundColor:'red',top:20}} onPress={() => this.logout()}>
<View style={{ height: 40, borderRadius: 20, backgroundColor: '#CFB368' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', margin: 15 }}>LOGOUT</Text>
</View>
</TouchableOpacity>
</View> */}
\ No newline at end of file
...@@ -83,7 +83,7 @@ class OrderDetail extends React.Component { ...@@ -83,7 +83,7 @@ class OrderDetail extends React.Component {
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/transaction/detail', params).then(res => { Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/transaction/detail', params).then(res => {
let data = res.data let data = res.data
// console.log('ini data' + JSON.stringify(data)) // console.log('ini data' + JSON.stringify(data))
// console.log("INI OUTLET "+ data.outlet) console.log("INI OUTLET "+ data.outlet)
// console.log("OUTLET-CODE" + data.outlet_code) // console.log("OUTLET-CODE" + data.outlet_code)
// console.log("TRANS-DISPLAY" + data.trans_type_display) // console.log("TRANS-DISPLAY" + data.trans_type_display)
...@@ -98,18 +98,40 @@ class OrderDetail extends React.Component { ...@@ -98,18 +98,40 @@ class OrderDetail extends React.Component {
}) })
}).catch(error => { }).catch(error => {
const { navigation } = this.props let response = error.response.data;
let response = error.response.data Alert.alert(error ,response.msg);
session(response, navigation)
Alert.alert(response.msg);
this.setState({ this.setState({
indicator: false, indicator: false,
}) })
// let response = error.response.data;
// Alert.alert(response.msg); // Alert.alert(response.msg);
}) })
} }
rating(){
let paramater = {
session_id: this.props.session_id,
transaction_id: this.props.route.params.idTrans,
rating: this.state.rating,
review: this.state.review,
lat: this.props.lat,
long: this.props.long
}
console.log("INI PARAMS"+ JSON.stringify(paramater) );
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/review/transaction', paramater).then(res => {
Alert.alert('','Terimakasih Atas masukan anda!')
this.props.navigation.navigate('Home');
}).catch(error => {
console.log ("INI error " + error)
let response = error.response.data;
Alert.alert(error,response.msg);
})
}
render() { render() {
console.log(this.state.detail_trans) console.log(this.state.detail_trans)
// console.log(this.state.detail_trans.used_reward) // console.log(this.state.detail_trans.used_reward)
...@@ -330,47 +352,23 @@ class OrderDetail extends React.Component { ...@@ -330,47 +352,23 @@ class OrderDetail extends React.Component {
{ {
this.state.trans_status == 4 ? ( this.state.trans_status == 4 ? (
null null
) : ( ) : (
<TouchableOpacity style={{ justifyContent: 'center' }} onPress={() => this.props.navigation.navigate('RatingOrder', { idTrans: item.id })}> <TouchableOpacity style={{ justifyContent: 'center' }} onPress={() => this.props.navigation.navigate('RatingOrder', { idTrans: this.state.detail_trans.id })}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', justifyContent: 'center', marginRight: 20, marginLeft: 20, marginTop: 50 }}> <View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', justifyContent: 'center', marginRight: 20, marginLeft: 20, marginTop: 50 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center', paddingHorizontal: 5 }}>Rating Order</Text> <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center', paddingHorizontal: 5 }}>Rating Order</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
) )
} }
<View style={{ marginVertical: 20 }} /> <View style={{ marginVertical: 20 }} />
{/* <TouchableOpacity style={{ justifyContent: 'center' }} onPress={() =>this.rating()}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', justifyContent: 'center', marginRight: 20, marginLeft: 20, marginTop: 50 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center', paddingHorizontal: 5 }}>Rating Order</Text>
</View>
{/* <View> </TouchableOpacity> */}
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}>
<Text>OUTLET : {this.state.outlet}</Text>
<Text>OUTLET CODE : {this.state.outlet_code}</Text>
<Text>OUTLET : {this.state.trans_status_display}</Text>
</Card>
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}>
{
this.state.transaction_detail.map((item, index) => {
return (
<View key={index}>
<Text>NAMA ITEM : {item.item_name}</Text>
<Text>QTY : {item.item_quantity}</Text>
<Text>PRICE : {item.item_price}</Text>
<Text>DISCOUNT : {item.item_discount}</Text>
<View style={{ borderWidth: 1, margin: 10 }}></View>
<Text>TOTAL : {item.item_subtotal}</Text>
</View>
)
})
}
</Card>
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}>
<Text>{}</Text>
</Card>
</View> */}
</ScrollView> </ScrollView>
</View> </View>
) )
...@@ -445,7 +443,9 @@ const mapStateToProps = (state) => { ...@@ -445,7 +443,9 @@ const mapStateToProps = (state) => {
return { return {
session_id: state.session_id, session_id: state.session_id,
trans_id: state.trans_id trans_id: state.trans_id,
lat: state.lat,
long: state.long,
} }
} }
......
...@@ -32,7 +32,7 @@ class Outlets extends React.Component { ...@@ -32,7 +32,7 @@ class Outlets extends React.Component {
data_outlet: [], data_outlet: [],
outlet_selected: '', outlet_selected: '',
data_name: '', data_name: '',
indicator:true indicator: true
} }
} }
...@@ -114,7 +114,7 @@ class Outlets extends React.Component { ...@@ -114,7 +114,7 @@ class Outlets extends React.Component {
this.setState({ this.setState({
dataOutlets: dataOutlets, dataOutlets: dataOutlets,
data_before_search: dataOutlets, data_before_search: dataOutlets,
}) })
this.setState({ this.setState({
...@@ -125,7 +125,7 @@ class Outlets extends React.Component { ...@@ -125,7 +125,7 @@ class Outlets extends React.Component {
let response = error.response.data; let response = error.response.data;
Alert.alert(response.msg); Alert.alert(response.msg);
this.setState({ this.setState({
indicator: false indicator: false
}) })
}) })
} }
...@@ -216,7 +216,13 @@ class Outlets extends React.Component { ...@@ -216,7 +216,13 @@ class Outlets extends React.Component {
dataOutlets: this.state.data_before_search, dataOutlets: this.state.data_before_search,
search: '' search: ''
}) })
} else { } else if (value == null) {
this.setState({
dataOutlets: this.state.data_before_search,
search: ''
})
}
else {
this.setState({ this.setState({
dataOutlets: filteredOutlets, dataOutlets: filteredOutlets,
search: value search: value
...@@ -228,8 +234,8 @@ class Outlets extends React.Component { ...@@ -228,8 +234,8 @@ class Outlets extends React.Component {
RenderItem = ({ item }) => { RenderItem = ({ item }) => {
return ( return (
<View style={{ flexDirection: 'row', flex: 1,marginRight:20,marginLeft:20,marginBottom:20}}> <View style={{ flexDirection: 'row', flex: 1, marginRight: 20, marginLeft: 20, marginBottom: 20 }}>
<View style={styles.content_list}> <View style={styles.content_list}>
<View style={styles.list_addrees}> <View style={styles.list_addrees}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#ccb46c', fontSize: 18 }}>{item.name}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#ccb46c', fontSize: 18 }}>{item.name}</Text>
<Text style={{ flexWrap: 'wrap', fontFamily: 'Gotham-Light', color: '#b1b1b2' }}>{item.full_address}</Text> <Text style={{ flexWrap: 'wrap', fontFamily: 'Gotham-Light', color: '#b1b1b2' }}>{item.full_address}</Text>
...@@ -238,7 +244,7 @@ class Outlets extends React.Component { ...@@ -238,7 +244,7 @@ class Outlets extends React.Component {
</Text> </Text>
</View> </View>
<View style={{ flex: 2, flexDirection: 'row' }}> <View style={{ flex: 2, flexDirection: 'row' }}>
<View style={{margin:5}}> <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'
...@@ -248,7 +254,7 @@ class Outlets extends React.Component { ...@@ -248,7 +254,7 @@ class Outlets extends React.Component {
/> />
</TouchableOpacity> </TouchableOpacity>
</View> </View>
<View style={{margin:5}}> <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'
...@@ -260,7 +266,7 @@ class Outlets extends React.Component { ...@@ -260,7 +266,7 @@ class Outlets extends React.Component {
</View> </View>
</View> </View>
</View> </View>
</View> </View>
); );
} }
...@@ -274,7 +280,7 @@ class Outlets extends React.Component { ...@@ -274,7 +280,7 @@ class Outlets extends React.Component {
textStyle={styles.spinnerTextStyle} textStyle={styles.spinnerTextStyle}
/> */} /> */}
<View style={{ flex: 1 }}> <View style={{ flex: 1 }}>
<MapView style={{ flex: 1 ,marginRight:10,marginLeft:10}} <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,
...@@ -297,37 +303,31 @@ class Outlets extends React.Component { ...@@ -297,37 +303,31 @@ 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: 'All city' }}
onValueChange={(label) => this.filterData(label)} onValueChange={(label) => this.filterData(label)}
items={this.state.data_outlet} items={this.state.data_outlet}
/> />
</View>
</View>
{/* <View style={{ height:50, flex: 1, flexDirection: 'row' }}>
<View style={{flex:1}}>
</View> </View>
</View> */} </View>
<View style={styles.body}> <View style={styles.body}>
{this.state.indicator == true ? ( {this.state.dataOutlets.length > 0 ? (
<ActivityIndicator size="large" color="#c9af6d" style={{margin:20}} /> <FlatList
) : ( 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>
)} )}
</View> </View>
</View> </View>
) )
...@@ -358,9 +358,9 @@ const styles = StyleSheet.create({ ...@@ -358,9 +358,9 @@ const styles = StyleSheet.create({
justifyContent: 'center', justifyContent: 'center',
margin: 10, margin: 10,
}, },
content_list:{ content_list: {
flex:1, flex: 1,
flexDirection:'row', flexDirection: 'row',
} }
}) })
......
...@@ -110,22 +110,22 @@ class ProfilePage extends PureComponent { ...@@ -110,22 +110,22 @@ class ProfilePage extends PureComponent {
<View style={{ flex: 3 }}> <View style={{ flex: 3 }}>
<View style={{ flex: 1, margin: 20,top:10}}> <View style={{ flex: 1, margin: 20,top:10}}>
<View style={{top:20}}> <View style={{top:20}}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 18, textAlign: 'center' }}>Email</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 18, textAlign: 'center',margin:3 }}>Email</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 14, textAlign: 'center'}}>{this.state.email}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 14, textAlign: 'center'}}>{this.state.email}</Text>
</View> </View>
<View style={{top:30}}> <View style={{top:30}}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 18, textAlign: 'center' }}>Phone</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 18, textAlign: 'center',margin:3 }}>Phone</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 14, textAlign: 'center'}}>{this.state.mobile_phone}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 14, textAlign: 'center'}}>{this.state.mobile_phone}</Text>
</View> </View>
<View style={{top:40}}> <View style={{top:40}}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 18, textAlign: 'center'}}>Date of Birth</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 18, textAlign: 'center',margin:3}}>Date of Birth</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 14, textAlign: 'center'}}>{this.state.dob_day} / {this.state.dob_month} / {this.state.dob_year}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 14, textAlign: 'center'}}>{this.state.dob_day} / {this.state.dob_month} / {this.state.dob_year}</Text>
</View> </View>
<View style={{top:50,marginBottom:50}}> <View style={{top:50,marginBottom:50}}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 18, textAlign: 'center' }}>Gender</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 18, textAlign: 'center',margin:3 }}>Gender</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 14, textAlign: 'center'}}>{this.state.gender}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 14, textAlign: 'center'}}>{this.state.gender}</Text>
</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