Commit ed6ffdf3 authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

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

# Conflicts:
#	view/RewardSelect.js
#	view/RewardsList.js
parents 15baa0ef 82e9461b
{
"expo": {
"name": "Excelso_update 09.30 / 18.05.2020",
"name": "Excelso_update 11.30 / 18.05.2020",
"slug": "excelso-pro",
"privacy": "public",
"sdkVersion": "36.0.0",
......
......@@ -92,22 +92,22 @@ function HomePage({ navigation }) {
if (route.name === 'HOME') {
// iconName = focused ? 'ios-home' : 'ios-home'
return <Image source={require('../assets/icon/icon-home.png')} style={{height :50, width:50}} tintColor={ focused ? '#CFB368' : 'gray'} />
return <Image source={require('../assets/icon/icon-home.png')} style={{ height: 50, width: 50 }} tintColor={focused ? '#CFB368' : 'gray'} />
} else if (route.name === 'MENU') {
// iconName = focused ? 'ios-paper' : 'ios-paper';
return <Image source={require('../assets/icon/icon-menu.png')} style={{height :50, width:50}} tintColor={ focused ? '#CFB368' : 'gray'}/>
return <Image source={require('../assets/icon/icon-menu.png')} style={{ height: 50, width: 50 }} tintColor={focused ? '#CFB368' : 'gray'} />
} else if (route.name === 'REWARDS') {
// iconName = focused ? 'ios-gift' : 'ios-gift';
return <Image source={require('../assets/icon/icon-rewards.png')} style={{height :50, width:50}} tintColor={ focused ? '#CFB368' : 'gray'}/>
return <Image source={require('../assets/icon/icon-rewards.png')} style={{ height: 50, width: 50 }} tintColor={focused ? '#CFB368' : 'gray'} />
} else if (route.name === 'ORDER') {
// iconName = focused ? 'md-cart' : 'md-cart';
return <Image source={require('../assets/icon/icon-order.png')} style={{height :50, width:50}} tintColor={ focused ? '#CFB368' : 'gray'}/>
return <Image source={require('../assets/icon/icon-order.png')} style={{ height: 50, width: 50 }} tintColor={focused ? '#CFB368' : 'gray'} />
} else if (route.name === 'OUTLETS') {
// iconName = focused ? 'ios-cafe' : 'ios-cafe';
return <Image source={require('../assets/icon/icon-outlets.png')} style={{height :50, width:50}} tintColor={ focused ? '#CFB368' : 'gray'}/>
return <Image source={require('../assets/icon/icon-outlets.png')} style={{ height: 50, width: 50 }} tintColor={focused ? '#CFB368' : 'gray'} />
} else if (route.name === 'ACCOUNT') {
// iconName = focused ? 'account' : 'account';
return <Image source={require('../assets/icon/icon-account.png')} style={{height :50, width:50}} tintColor={ focused ? '#CFB368' : 'gray'}/>
return <Image source={require('../assets/icon/icon-account.png')} style={{ height: 50, width: 50 }} tintColor={focused ? '#CFB368' : 'gray'} />
}
// You can return any component that you like here!
......@@ -146,7 +146,7 @@ class Auth extends React.Component {
<Stack.Screen name="Login" component={Login} options={{ headerShown: false }} />
<Stack.Screen name="LoginWelcome" component={WelcomeLog} options={{
headerShown: false ,
headerShown: false,
}} />
<Stack.Screen name="Home" component={Home} />
......@@ -162,7 +162,7 @@ class Auth extends React.Component {
color: 'white',
textAlign: 'center'
}, title: 'PROFIL'
}}/>
}} />
<Stack.Screen name="Change Profil" component={ChangeProfile} options={{
headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle: { alignContent: 'center' },
......@@ -174,7 +174,7 @@ class Auth extends React.Component {
color: 'white',
textAlign: 'center'
}, title: 'CHANGE PROFIL'
}}/>
}} />
<Stack.Screen name="Register" component={Register} />
{/* <Stack.Screen name="Change language" component={ChangeLanguage} /> */}
<Stack.Screen name="Email Confirmation" component={EmailConfirmation} options={{
......@@ -190,7 +190,7 @@ class Auth extends React.Component {
}, title: 'EMAIL CONFIRMATION'
}} />
<Stack.Screen name="Welcomes" component={WelcomeReg} options={{
headerShown: false ,
headerShown: false,
}} />
</>
......@@ -199,7 +199,7 @@ class Auth extends React.Component {
<Stack.Screen name="Email Confirmation" component={EmailConfirmation} />
<Stack.Screen name="Login" component={Login} />
<Stack.Screen name="LoginWelcome" component={WelcomeLog} options={{
headerShown: false ,
headerShown: false,
}} />
<Stack.Screen name="Home" component={Home} options={{ headerShown: false }} />
</>
......@@ -231,7 +231,7 @@ class Auth extends React.Component {
color: 'white',
textAlign: 'center'
}, title: 'PROFIL'
}}/>
}} />
<Stack.Screen name="Change Profil" component={ChangeProfile} />
<Stack.Screen name="Change language" component={ChangeLanguage} />
<Stack.Screen name="Change password" component={ChangePassword} options={{
......@@ -245,7 +245,7 @@ class Auth extends React.Component {
color: 'white',
textAlign: 'center'
}, title: 'CHANGE PROFIL'
}}/>
}} />
<Stack.Screen name="Card Activation" component={CardActivation} />
<Stack.Screen name="Renewal" component={Renewal} />
<Stack.Screen name="Account" component={Account} />
......@@ -255,9 +255,21 @@ class Auth extends React.Component {
<Stack.Screen name="Email Confirmation" component={EmailConfirmation} />
<Stack.Screen name="Upgrade Premium" component={UpgradePremium} />
<Stack.Screen name="Camera" component={Cameras} />
<Stack.Screen name="Delivery Address" component={DeliveryAddress} />
<Stack.Screen name="Delivery Address" component={DeliveryAddress} options={{
headerStyle: { backgroundColor: "#ccb46c" },
headerBackTitleStyle: { color: 'white' },
headerTintColor: '#fff',
headerTitleAlign: 'center',
headerTitleStyle: {
fontFamily: 'Gotham-Black',
color: 'white',
fontSize: 20,
},
title: 'Delivery Address'
}} />
<Stack.Screen name="Address Detail" component={AddressDetail} />
<Stack.Screen name="Menu Detail" component={MenuDetail} options={({route})=>({title:route.params.nameMenu,
<Stack.Screen name="Menu Detail" component={MenuDetail} options={({ route }) => ({
title: route.params.nameMenu,
headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle: { alignContent: 'center' },
headerTitleAlign: 'center',
......@@ -267,7 +279,8 @@ class Auth extends React.Component {
fontFamily: 'Gotham-Black',
color: 'white',
textAlign: 'center'
}}) } />
}
})} />
<Stack.Screen name="Pickup Name" component={PickupName} options={{
headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle: { alignContent: 'center' },
......@@ -279,7 +292,7 @@ class Auth extends React.Component {
color: 'white',
textAlign: 'center'
}, title: 'PICKUP STORE'
}}/>
}} />
<Stack.Screen name="Outlet Detail" component={OutletDetail} />
<Stack.Screen name="Menu Select" component={MenuSelection} options={{ headerShown: false }} />
<Stack.Screen name="Card Info" component={CardInfo} />
......
import React from 'react';
import { View, Text, StyleSheet, Button, FlatList, Alert } from 'react-native';
import { View, Text, StyleSheet, Button, FlatList, Alert, TextInput, Image } from 'react-native';
import { ScrollView, TouchableOpacity } from 'react-native-gesture-handler';
import { connect } from 'react-redux';
import { CheckBox, Icon } from 'react-native-elements';
import Axios from 'axios';
import ActionType from '../redux/globalActionType';
import { MaterialCommunityIcons, Ionicons } from '@expo/vector-icons';
// import ravLog from '../helper/debug';
class DeliveryAddrees extends React.Component {
......@@ -11,6 +13,8 @@ class DeliveryAddrees extends React.Component {
super(props)
this.state = {
data: [],
data_before_search: [],
search: '',
// outlet_id: '',
// grabamount: ''
}
......@@ -42,7 +46,8 @@ class DeliveryAddrees extends React.Component {
}
this.setState({
data: address
data: address,
data_before_search: dataAlamat,
})
}).catch(error => {
let response = error.response.data;
......@@ -106,6 +111,27 @@ class DeliveryAddrees extends React.Component {
}
filterData(text) {
const newData = this.state.data_before_search.filter(function (item) {
const itemData = item.name ? item.name.toUpperCase() : ''.toUpperCase();
const textData = text.toUpperCase();
return itemData.indexOf(textData) > -1;
});
if (text === '') {
this.setState({
data: this.state.data_before_search,
search: ''
})
} else {
this.setState({
data: newData,
search: text
});
}
}
onSave(address, id) {
let setDataAddress = {
......@@ -183,15 +209,33 @@ class DeliveryAddrees extends React.Component {
return (
<View style={styles.list_addrees}>
<TouchableOpacity onPress={() => this.onSave(item.address, item.id)}>
<View style={{ flex: 1, flexDirection: 'row', margin: 20, }}>
<View style={{ flex: 1, marginBottom: 10, justifyContent: 'center' }}>
<CheckBox
center
checkedIcon='dot-circle-o'
uncheckedIcon='circle-o'
checked={this.state.checked}
checkedColor="#ccb46c"
uncheckedColor="#ccb46c"
/>
<Text style={{ textAlign: 'center', color: '#ccb46c', fontFamily: 'Gotham-Light' }}>PILIH</Text>
</View>
<View style={{ flex: 3, justifyContent: 'center' }}>
<View style={{ margin: 5, }}>
<Text style={{ fontWeight: 'bold', fontSize: 20 }}>{item.name}</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 19, marginBottom: 5 }}>{item.name}</Text>
</View>
<Text style={{ fontFamily: 'Gotham-Light', color: 'grey', fontSize: 15, marginBottom: 5 }}>{item.address}</Text>
</View>
<View style={{ flex: 1,justifyContent:'center' }}>
<View style={{ margin: 5, }}>
<Image
style={{height:20,width:20,tintColor:'#ccb46c'}}
source={require('../assets/ellipsis-v.png')}
/>
</View>
</View>
</View>
<Text style={{ margin: 5 }}>
{item.address}
</Text>
<Text style={{ margin: 5 }}>
Patokan : {item.description}
</Text>
</TouchableOpacity>
</View>
......@@ -202,12 +246,29 @@ class DeliveryAddrees extends React.Component {
return (
<View style={styles.container}>
<View style={styles.body}>
{/* <ScrollView> */}
<View style={{ height: 45, borderRadius: 10, borderColor: '#ccb46c', borderWidth: 1, flexDirection: 'row', marginTop: 15, marginLeft: 10, marginRight: 10 }}>
<View style={{ flex: 1 }}>
<MaterialCommunityIcons name="map-marker" size={32} color="#ccb46c" />
</View>
<View style={{ flex: 6 }}>
<TextInput style={{ height: 45 }} placeholder="Cari Alamat"
onChangeText={text => this.filterData(text)}
onClear={text => this.filterData('')}
value={this.state.search}></TextInput>
</View>
<View style={{ flex: 1, margin: 5 }}>
<Ionicons name="ios-search" size={32} color="#ccb46c" />
</View>
</View>
<View style={styles.btn_addreess}>
<Button title="Tambah Alamat" onPress={() => this.addAdreess()}></Button>
<TouchableOpacity onPress={() => this.addAdreess()}>
<View style={{ height: 40, borderRadius: 15, marginRight: 70, marginLeft: 70, backgroundColor: '#CFB368', justifyContent: 'center', alignContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', color: 'white', fontSize: 20 }}> + Tambah Alamat </Text>
</View>
</TouchableOpacity>
</View>
<View style={styles.listAddress}>
<FlatList
data={this.state.data}
renderItem={this.renderItem}
......@@ -232,7 +293,7 @@ const styles = StyleSheet.create({
body: {
flex: 3,
marginTop:10,
marginTop: 10,
marginRight: 20,
marginLeft: 20,
marginBottom: 20,
......@@ -240,14 +301,16 @@ const styles = StyleSheet.create({
},
btn_addreess: {
margin: 20,
margin: 10,
},
list_addrees: {
flex: 1,
margin: 20,
borderWidth: 1,
borderColor: 'grey',
borderRadius: 10,
}
})
......@@ -348,3 +411,19 @@ export default connect(mapStateToProps, mapDispatchToProps)(DeliveryAddrees)
// keyExtractor={item => item.id}
// />
// </View>
// <View style={styles.body}>
// {/* <ScrollView> */}
// <View style={styles.btn_addreess}>
// <Button title="Tambah Alamat" onPress={() => this.addAdreess()}></Button>
// </View>
// <FlatList
// data={this.state.data}
// renderItem={this.renderItem}
// keyExtractor={item => item.id}
// />
// </View>
\ No newline at end of file
......@@ -126,27 +126,6 @@ class PickupName extends React.Component {
address = dataOutlets[i]['postal_code'];
}
}
if (dataOutlets[i]['open_time']) {
if (address !== '') {
address = address + ' ' + dataOutlets[i]['open_time'];
} else {
address = dataOutlets[i]['open_time'];
}
}
if (dataOutlets[i]['close_time']) {
if (address !== '') {
address = address + ' ' + dataOutlets[i]['close_time'];
} else {
address = dataOutlets[i]['close_time'];
}
}
if (dataOutlets[i]['can_accept_order']) {
if (address !== '') {
address = address + ' ' + dataOutlets[i]['can_accept_order'];
} else {
address = dataOutlets[i]['can_accept_order'];
}
}
dataOutlets[i]['full_address'] = address;
}
this.setState({
......@@ -229,16 +208,14 @@ class PickupName extends React.Component {
<View style={{ margin: 5 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 20 }}>{item.name}</Text>
<View style={{flexDirection:'row'}}>
{item.can_accept_order == true ? (<Text style={{fontFamily: 'Gotham-Black',color:"#ccb46c",top:5}}>OPEN - </Text>)
:(<Text style={{fontFamily: 'Gotham-Black',color:"#ccb46c"}}>CLOSED - </Text>) }<Text style={{ fontFamily: 'Gotham-Light', color: '#CFB368', fontSize: 15}}>Everyday {item.open_time} - {item.close_time}</Text>
{item.can_accept_order == true ? (<Text style={{fontFamily: 'Gotham-Black',color:"#ccb46c",top:5}}>OPEN : </Text>)
:(<Text style={{fontFamily: 'Gotham-Black',color:"#ccb46c"}}>CLOSED : </Text>) }
</View>
</View>
<Text style={{ fontFamily: 'Gotham-Light', color: '#CFB368', fontSize: 15}}> Opening Hours : {item.open_time} - {item.close_time}</Text>
<Text style={{ margin: 5, color: '#b1b1b2',fontFamily: 'Gotham-Light' }}>
{item.full_address}
</Text>
<Text style={{ margin: 5, color: '#aeaead',fontFamily: 'Gotham-Light' }}>
{item.distance} KM
</Text>
</View>
<View>
<CheckBox
......@@ -249,7 +226,7 @@ class PickupName extends React.Component {
checkedColor="#ccb46c"
uncheckedColor="#ccb46c"
/>
<Text style={{textAlign:'center',color:'#ccb46c',fontFamily:'Gotham-Light' }}>PILIH</Text>
<Text style={{textAlign:'center',color:'#ccb46c',fontFamily:'Gotham-Light' }}>{item.distance} KM</Text>
</View>
</View>
</TouchableOpacity>
......
......@@ -84,9 +84,9 @@ class RewardSelect extends React.Component {
render() {
return (
<View style={styles.container}>
{/* <View style={styles.header}> */}
{/* <Text style={{ color: 'white', textAlign: 'center', fontSize: 28 }}>REWARDS E-VOUCHER</Text> */}
{/* </View> */}
<View style={styles.header}>
<Text style={{ color: 'white', textAlign: 'center', fontSize: 18, fontFamily: 'Gotham-Black' }}>REWARDS E-VOUCHER</Text>
</View>
<ScrollView style={styles.body}>
{
this.state.rewardsList.map((item, key) => (
......@@ -101,12 +101,12 @@ class RewardSelect extends React.Component {
</View>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', padding: 10 }}>
<View>
<Text style={{ color: '#CFB368', fontFamily: 'Gotham-Black', fontSize: 14, textAlign: 'center' }}>{item.reward.title}</Text>
<Text style={{ color: '#CFB368', fontFamily: 'Gotham-Black', fontSize: 14, textAlign: 'center' }}>{item.reward.subtitle}</Text>
<Text style={{textAlign:'left', fontSize: 12, fontFamily: 'Gotham-Black'}}>{item.reward.title}</Text>
<Text style={{textAlign:'left', fontSize: 12, fontFamily: 'Gotham-Light'}}>{item.reward.subtitle}</Text>
</View>
<View>
<Text style={{ color: '#CFB368', textAlign: 'right', fontFamily: 'Gotham-Black', fontSize: 12 }}>Expired</Text>
<Text style={{ color: '#CFB368', fontFamily: 'Gotham-Black', fontSize: 12, textAlign: 'center' }}>{item.expire_time}</Text>
<Text style={{textAlign:'right', fontSize: 12, fontFamily: 'Gotham-Light'}}>Expired</Text>
<Text style={{textAlign:'right', fontSize: 12, fontFamily: 'Gotham-Light'}}>{item.expire_time}</Text>
</View>
</View>
</Card>
......
......@@ -51,7 +51,7 @@ class RewardsList extends React.Component {
return (
<View style={styles.container}>
<View style={styles.header}>
<Text style={{ color: 'white', textAlign: 'center', fontSize: 28 }}>REWARDS E-VOUCHER</Text>
<Text style={{ color: 'white', textAlign: 'center', fontSize: 18, fontFamily: 'Gotham-Black' }}>REWARDS E-VOUCHER</Text>
</View>
<ScrollView style={styles.body}>
{
......@@ -67,12 +67,12 @@ class RewardsList extends React.Component {
</View>
<View style={{ flexDirection: 'row', justifyContent:'space-between', padding:10 }}>
<View>
<Text style={{ color:'#CFB368',fontFamily: 'Gotham-Black', fontSize: 14, textAlign: 'center'}}>{item.reward.title}</Text>
<Text style={{ color:'#CFB368',fontFamily: 'Gotham-Black', fontSize: 14, textAlign: 'center'}}>{item.reward.subtitle}</Text>
<Text style={{textAlign:'left', fontSize: 12, fontFamily: 'Gotham-Black'}}>{item.reward.title}</Text>
<Text style={{textAlign:'left', fontSize: 12, fontFamily: 'Gotham-Light'}}>{item.reward.subtitle}</Text>
</View>
<View>
<Text style={{color:'#CFB368', textAlign:'right',fontFamily: 'Gotham-Black', fontSize: 12}}>Expired</Text>
<Text style={{ color:'#CFB368',fontFamily: 'Gotham-Black', fontSize: 12, textAlign: 'center'}}>{item.expire_time}</Text>
<Text style={{textAlign:'right', fontSize: 12, fontFamily: 'Gotham-Light'}}>Expired</Text>
<Text style={{textAlign:'right', fontSize: 12, fontFamily: 'Gotham-Light'}}>{item.expire_time}</Text>
</View>
</View>
</Card>
......@@ -80,9 +80,10 @@ class RewardsList extends React.Component {
</TouchableOpacity>
))
}
<TouchableOpacity style={{margin:20}} onPress={()=> this.props.navigation.navigate('Reward History')}>
<Text style={{ color:'#CFB368', fontFamily: 'Gotham-Black', fontSize: 15, textAlign: 'center'}}>REDEEM E-VOUCHER HISTORY</Text>
<TouchableOpacity onPress={()=> this.props.navigation.navigate('Reward History')}>
<Text style={{ textAlign: 'center', color: '#CFB368', fontSize: 12, fontFamily: 'Gotham-Black' }}>REDEEM E-VOUCHER HISTORY</Text>
</TouchableOpacity>
<View style={{height:15}}/>
</ScrollView>
</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