Commit a3d9dec7 authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo
parents 94174c65 6755d13a
...@@ -326,7 +326,8 @@ class Auth extends React.Component { ...@@ -326,7 +326,8 @@ class Auth extends React.Component {
}, title: 'Tambah Alamat' }, title: 'Tambah Alamat'
}} /> }} />
<Stack.Screen name="Menu Detail" component={MenuDetail} <Stack.Screen name="Menu Detail" component={MenuDetail}
options={({ route }) => ({ headerStyle: { backgroundColor: '#CFB368' }, options={({ route }) => ({
headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle: { alignContent: 'center' }, headerTitleContainerStyle: { alignContent: 'center' },
headerTitleAlign: 'center', headerTitleAlign: 'center',
headerTintColor: '#fff', headerTintColor: '#fff',
...@@ -335,7 +336,8 @@ class Auth extends React.Component { ...@@ -335,7 +336,8 @@ class Auth extends React.Component {
fontFamily: 'Gotham-Black', fontFamily: 'Gotham-Black',
color: 'white', color: 'white',
textAlign: 'center' textAlign: 'center'
}, title: route.params.nameMenu })} }, title: route.params.nameMenu
})}
/> />
<Stack.Screen name="Pickup Name" component={PickupName} options={{ <Stack.Screen name="Pickup Name" component={PickupName} options={{
headerStyle: { backgroundColor: '#CFB368' }, headerStyle: { backgroundColor: '#CFB368' },
...@@ -352,7 +354,20 @@ class Auth extends React.Component { ...@@ -352,7 +354,20 @@ class Auth extends React.Component {
<Stack.Screen name="Outlet Detail" component={OutletDetail} /> <Stack.Screen name="Outlet Detail" component={OutletDetail} />
<Stack.Screen name="Menu Select" component={MenuSelection} options={{ headerShown: false }} /> <Stack.Screen name="Menu Select" component={MenuSelection} options={{ headerShown: false }} />
<Stack.Screen name="Card Info" component={CardInfo} /> <Stack.Screen name="Card Info" component={CardInfo} />
<Stack.Screen name="Shopping Cart" component={ShoppingCart} /> <Stack.Screen name="Shopping Cart" component={ShoppingCart}
options={{
headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle: { alignContent: 'center' },
headerTitleAlign: 'center',
headerTintColor: '#fff',
headerTitleStyle: {
alignSelf: 'center',
fontFamily: 'Gotham-Black',
fontSize: 18,
color: 'white',
textAlign: 'center'
}, title: 'Shopping Cart'
}} />
<Stack.Screen name="Order History" component={OrderHistory} /> <Stack.Screen name="Order History" component={OrderHistory} />
<Stack.Screen name="Reward History" component={RewardHistory} <Stack.Screen name="Reward History" component={RewardHistory}
options={{ options={{
...@@ -472,7 +487,19 @@ class Auth extends React.Component { ...@@ -472,7 +487,19 @@ class Auth extends React.Component {
{/* <Stack.Screen name="Email Confirmation" component={EmailConfirmation} /> */} {/* <Stack.Screen name="Email Confirmation" component={EmailConfirmation} /> */}
<Stack.Screen name="News Detail" component={NewsDetail} options={{ headerShown: false }} /> <Stack.Screen name="News Detail" component={NewsDetail} options={{ headerShown: false }} />
<Stack.Screen name="Confirm Your Order" component={MenuConfirmation} /> <Stack.Screen name="Confirm Your Order" component={MenuConfirmation}
options={{
headerStyle: { backgroundColor: "#CFB368" },
headerBackTitleStyle: { color: 'white' },
headerTintColor: '#fff',
headerTitleAlign: 'center',
headerTitleStyle: {
fontFamily: 'Gotham-Black',
color: 'white',
fontSize: 18,
},
title: 'Confirm Your Order'
}} />
<Stack.Screen name="Date Time" component={DateTime} /> <Stack.Screen name="Date Time" component={DateTime} />
<Stack.Screen name="New Register" component={NewRegister} <Stack.Screen name="New Register" component={NewRegister}
options={{ options={{
......
...@@ -2,6 +2,7 @@ import React from 'react'; ...@@ -2,6 +2,7 @@ import React from 'react';
import { View, Text, StyleSheet, ScrollView, TouchableOpacity, Image, TextInput } from 'react-native'; import { View, Text, StyleSheet, ScrollView, TouchableOpacity, Image, TextInput } from 'react-native';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import ActionType from '../redux/globalActionType'; import ActionType from '../redux/globalActionType';
import NumberFormat from 'react-number-format';
class ItemShoping extends React.Component { class ItemShoping extends React.Component {
...@@ -22,7 +23,7 @@ class ItemShoping extends React.Component { ...@@ -22,7 +23,7 @@ class ItemShoping extends React.Component {
image: item.image, image: item.image,
price: parseInt(item.price), price: parseInt(item.price),
} }
this.props.changeQuantity({item: order_item, quantity: quantity}) this.props.changeQuantity({ item: order_item, quantity: quantity })
} }
render() { render() {
const { item } = this.props const { item } = this.props
...@@ -36,20 +37,22 @@ class ItemShoping extends React.Component { ...@@ -36,20 +37,22 @@ class ItemShoping extends React.Component {
<Image source={{ uri: item.image }} style={{ height: 100, width: 100, borderRadius: 5, top: 5 }}></Image> <Image source={{ uri: item.image }} style={{ height: 100, width: 100, borderRadius: 5, top: 5 }}></Image>
</View> </View>
<View > <View >
<Text style={{ fontSize: 20, margin: 5, marginRight: 10, fontFamily: 'Gotham-Black' }}>{item.name}</Text> <Text style={{ fontSize: 15, margin: 5, marginRight: 10, fontFamily: 'Gotham-Black', color: 'grey' }}>{item.name}</Text>
<Text style={{ fontSize: 15, margin: 5, marginRight: 10, fontFamily: 'Gotham-Light'}}>Rp. {item.price}</Text> <NumberFormat decimalScale={0} value={item.price} renderText={value => <Text style={{ fontSize: 12, margin: 5, marginRight: 10, fontFamily: 'Gotham-Light', color: 'grey' }}>Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
<View style={{ flexDirection: 'row', flex: 1 }}> <View style={{ flexDirection: 'row', flex: 1 }}>
<View style={styles.shadowEdit}></View> <View style={styles.shadowEdit}>
<Image source={(require('../assets/icon/icon-pencil.png'))} style={{ height: 25, width: 25, marginLeft: 5}}></Image>
</View>
<View style={styles.shadowAdd}> <View style={styles.shadowAdd}>
<TouchableOpacity onPress={() => this.props.handleMin()}> <TouchableOpacity onPress={() => this.props.handleMin()}>
<Text style={{ fontSize: 20, margin: 2, color:'#CFB368' }}> - </Text> <Text style={{ fontSize: 20, margin: 2, color: '#CFB368' }}> - </Text>
</TouchableOpacity> </TouchableOpacity>
<TextInput <TextInput
style={{ height: 25, padding: 2, textAlign: 'center', margin: 2 }} style={{ height: 25, padding: 2, textAlign: 'center', margin: 2 }}
keyboardType={'numeric'} keyboardType={'numeric'}
onChangeText={(quantity) => this.handleChangeQuantity(item, quantity)}>{item.quantity}</TextInput> onChangeText={(quantity) => this.handleChangeQuantity(item, quantity)}>{item.quantity}</TextInput>
<TouchableOpacity onPress={() => this.props.handleAdd()}> <TouchableOpacity onPress={() => this.props.handleAdd()}>
<Text style={{ fontSize: 20, margin: 2, color:'#CFB368'}}> + </Text> <Text style={{ fontSize: 20, margin: 2, color: '#CFB368' }}> + </Text>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
</View> </View>
...@@ -76,6 +79,7 @@ const styles = StyleSheet.create({ ...@@ -76,6 +79,7 @@ const styles = StyleSheet.create({
marginLeft: 5, marginLeft: 5,
marginRight: 5, marginRight: 5,
marginTop: 10, marginTop: 10,
alignItems:'center'
}, },
shadowAdd: { shadowAdd: {
height: 30, height: 30,
...@@ -133,6 +137,6 @@ const mapDispatchToProps = (dispacth) => { ...@@ -133,6 +137,6 @@ const mapDispatchToProps = (dispacth) => {
} }
}), }),
} }
} }
export default connect(mapStateToProps, mapDispatchToProps)(ItemShoping) export default connect(mapStateToProps, mapDispatchToProps)(ItemShoping)
This diff is collapsed.
...@@ -89,6 +89,7 @@ class RewardSelect extends React.Component { ...@@ -89,6 +89,7 @@ class RewardSelect extends React.Component {
</View> */} </View> */}
<ScrollView style={styles.body}> <ScrollView style={styles.body}>
{ {
this.state.rewardsList.length ? (
this.state.rewardsList.map((item, key) => ( this.state.rewardsList.map((item, key) => (
<TouchableOpacity key={key} onPress={() => this.handleSelect(item)}> <TouchableOpacity key={key} onPress={() => this.handleSelect(item)}>
<View style={{ alignItems: 'center' }}> <View style={{ alignItems: 'center' }}>
...@@ -101,18 +102,23 @@ class RewardSelect extends React.Component { ...@@ -101,18 +102,23 @@ class RewardSelect extends React.Component {
</View> </View>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', padding: 10 }}> <View style={{ flexDirection: 'row', justifyContent: 'space-between', padding: 10 }}>
<View> <View>
<Text style={{textAlign:'left', fontSize: 12, fontFamily: 'Gotham-Black'}}>{item.reward.title}</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> <Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Light' }}>{item.reward.subtitle}</Text>
</View> </View>
<View> <View>
<Text style={{textAlign:'right', fontSize: 12, fontFamily: 'Gotham-Light'}}>Expired</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> <Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light' }}>{item.expire_time}</Text>
</View> </View>
</View> </View>
</Card> </Card>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
)) ))
) : (
<View style={{justifyContent:'center', alignItems:'center', height:100}}>
<Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Light', color:'grey' }}>No E-Voucher Available</Text>
</View>
)
} }
{/* <TouchableOpacity> {/* <TouchableOpacity>
<Text style={{ textAlign: 'right', color: '#ccb46c' }}>REDEEM E-VOUCHER HISTORY</Text> <Text style={{ textAlign: 'right', color: '#ccb46c' }}>REDEEM E-VOUCHER HISTORY</Text>
......
...@@ -32,7 +32,7 @@ class RewardsList extends React.Component { ...@@ -32,7 +32,7 @@ class RewardsList extends React.Component {
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/reward/get_list', params).then(res => { Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/reward/get_list', params).then(res => {
let data = res.data.rewards let data = res.data.rewards
// console.log(data) // console.log(data)
data.map((item,key) => { data.map((item, key) => {
// console.log(item.expire_time) // console.log(item.expire_time)
item.expire_time = moment(item.expire_time).format("DD MMMM YYYY") item.expire_time = moment(item.expire_time).format("DD MMMM YYYY")
}) })
...@@ -55,6 +55,7 @@ class RewardsList extends React.Component { ...@@ -55,6 +55,7 @@ class RewardsList extends React.Component {
</View> </View>
<ScrollView style={styles.body}> <ScrollView style={styles.body}>
{ {
this.state.rewardsList.length ? (
this.state.rewardsList.map((item, key) => ( this.state.rewardsList.map((item, key) => (
<TouchableOpacity key={key} onPress={() => this.props.navigation.navigate('Reward Detail', { rewardId: item.id })}> <TouchableOpacity key={key} onPress={() => this.props.navigation.navigate('Reward Detail', { rewardId: item.id })}>
<View style={{ alignItems: 'center' }}> <View style={{ alignItems: 'center' }}>
...@@ -65,25 +66,30 @@ class RewardsList extends React.Component { ...@@ -65,25 +66,30 @@ class RewardsList extends React.Component {
resizeMode='cover' resizeMode='cover'
style={{ height: 100, width: '100%' }} /> style={{ height: 100, width: '100%' }} />
</View> </View>
<View style={{ flexDirection: 'row', justifyContent:'space-between', padding:10 }}> <View style={{ flexDirection: 'row', justifyContent: 'space-between', padding: 10 }}>
<View> <View>
<Text style={{textAlign:'left', fontSize: 12, fontFamily: 'Gotham-Black'}}>{item.reward.title}</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> <Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Light' }}>{item.reward.subtitle}</Text>
</View> </View>
<View> <View>
<Text style={{textAlign:'right', fontSize: 12, fontFamily: 'Gotham-Light'}}>Expired</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> <Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light' }}>{item.expire_time}</Text>
</View> </View>
</View> </View>
</Card> </Card>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
)) ))
) : (
<View style={{ justifyContent: 'center', alignItems: 'center', height: 100 }}>
<Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Light', color:'grey' }}>No E-Voucher Available</Text>
</View>
)
} }
<TouchableOpacity onPress={()=> this.props.navigation.navigate('Reward History')}> <TouchableOpacity onPress={() => this.props.navigation.navigate('Reward History')}>
<Text style={{ textAlign: 'center', color: '#CFB368', fontSize: 12, fontFamily: 'Gotham-Black' }}>REDEEM E-VOUCHER HISTORY</Text> <Text style={{ textAlign: 'center', color: '#CFB368', fontSize: 12, fontFamily: 'Gotham-Black' }}>REDEEM E-VOUCHER HISTORY</Text>
</TouchableOpacity> </TouchableOpacity>
<View style={{height:15}}/> <View style={{ height: 15 }} />
</ScrollView> </ScrollView>
</View> </View>
) )
......
This diff is collapsed.
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