Commit 398b4176 authored by Trisno's avatar Trisno

tambah gambar di menu confirmation

parent 4f26555d
import React from 'react'; import React from 'react';
import { View, Text, Alert, TouchableOpacity, StyleSheet, Button, ScrollView } from 'react-native'; import { View, Text, Alert, TouchableOpacity, StyleSheet, Button, ScrollView, Image } from 'react-native';
import Axios from 'axios' import Axios from 'axios'
import { connect } from 'react-redux' import { connect } from 'react-redux'
import ActionType from '../redux/globalActionType'; import ActionType from '../redux/globalActionType';
...@@ -245,25 +245,28 @@ class MenuConfirmation extends React.Component { ...@@ -245,25 +245,28 @@ class MenuConfirmation extends React.Component {
) )
} }
</View> </View>
<View style={{ margin: 10, paddingLeft: 10 }}> <View style={{ marginHorizontal: 10, paddingLeft: 10 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>Pesanan</Text> <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>Pesanan</Text>
</View> </View>
{ {
this.props.order_item.map((item, index) => { this.props.order_item.map((item, index) => {
total = total + item.quantity * item.price total = total + item.quantity * item.price
return ( return (
<View style={{ margin: 10 }} key={index} > <View style={{ margin: 0 }} key={index} >
<View style={{ flex: 1, margin: 10, flexDirection: 'row', justifyContent: 'space-around' }}> <View style={{ flex: 1, margin: 10, flexDirection: 'row', justifyContent: 'space-around' }}>
<View style={{ flex: 0.3, alignItems: 'center' }}> <View style={{ flex: 0.3, alignItems: 'center'}}>
<Image source={{ uri: item.image }} style={{ height: 50, width: 50, borderRadius: 5}}></Image>
</View>
<View style={{ flex: 0.1, alignItems: 'center', justifyContent:'center', }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>{item.quantity}</Text> <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>{item.quantity}</Text>
</View> </View>
<View style={{ flex: 0.1, alignItems: 'flex-start' }}> <View style={{ flex: 0.1, alignItems: 'flex-start', justifyContent:'center', }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>x</Text> <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>x</Text>
</View> </View>
<View style={{ flex: 0.3, alignItems: 'baseline' }}> <View style={{ flex: 0.3, alignItems: 'baseline', justifyContent:'center', }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>{item.name} </Text> <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>{item.name} </Text>
</View> </View>
<View style={{ flex: 0.3, alignItems: 'flex-end' }}> <View style={{ flex: 0.3, alignItems: 'flex-end', justifyContent:'center', }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>{item.quantity * item.price} </Text> <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>{item.quantity * item.price} </Text>
</View> </View>
</View> </View>
...@@ -293,26 +296,26 @@ class MenuConfirmation extends React.Component { ...@@ -293,26 +296,26 @@ class MenuConfirmation extends React.Component {
</> </>
) )
} }
<View style={{ borderTopWidth: 1, margin: 10, paddingLeft: 10, padding: 20, paddingBottom: -10 }}> <View style={{ borderTopWidth: 1, marginHorizontal: 10, paddingLeft: 10, padding: 10}}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>Payment</Text> <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>Payment</Text>
</View> </View>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', margin: 10, marginTop: -10 }}> <View style={{ flex: 1, flexDirection: 'row', justifyContent: 'space-between',marginTop: -10 }}>
<View style={{ margin: 10, paddingLeft: 10 }}> <View style={{ flex:0.5, margin: 10, paddingLeft: 20 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>Balance Used</Text> <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>Balance Used</Text>
</View> </View>
<View style={{ margin: 10, paddingRight: 5 }}> <View style={{ flex:0.5, margin: 10, alignItems:'flex-end', paddingRight:5 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>{this.props.route.params.balanceUsed}</Text> <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>{this.props.route.params.balanceUsed}</Text>
</View> </View>
</View> </View>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', margin: 10, marginTop: -10 }}> <View style={{ flex: 1, flexDirection: 'row', justifyContent: 'space-between',marginTop: -10 }}>
<View style={{ margin: 10, paddingLeft: 10 }}> <View style={{ flex:0.5, margin: 10, paddingLeft: 20 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>Point Used</Text> <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>Point Used</Text>
</View> </View>
<View style={{ margin: 10, paddingRight: 5 }}> <View style={{flex:0.5, margin: 10, alignItems:'flex-end', paddingRight:5}}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>{this.props.route.params.pointused}</Text> <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>{this.props.route.params.pointused}</Text>
</View> </View>
</View> </View>
<View style={{ borderTopWidth: 1, margin: 10, paddingLeft: 10, padding: 20, paddingBottom: -10, flexDirection: 'row', justifyContent: 'space-between', flex: 1, flexDirection: 'row' }}> <View style={{ borderTopWidth: 1, margin: 10, paddingLeft: 10, padding: 10, paddingBottom: -10, flexDirection: 'row', justifyContent: 'space-between', flex: 1}}>
<View style={{ flex: 0.6 }}> <View style={{ flex: 0.6 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>Harga</Text> <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>Harga</Text>
</View> </View>
...@@ -348,17 +351,17 @@ class MenuConfirmation extends React.Component { ...@@ -348,17 +351,17 @@ class MenuConfirmation extends React.Component {
</View> </View>
) )
} }
<View style={{ margin: 10, marginTop: -10, paddingLeft: 10, padding: 20, paddingBottom: -10, flexDirection: 'row', justifyContent: 'space-between', flex: 1, flexDirection: 'row' }}> <View style={{ marginHorizontal:7, paddingHorizontal:10, flexDirection: 'row', justifyContent: 'space-between', flex: 1 }}>
<View style={{ flex: 0.6 }}> <View style={{ flex: 0.6 }}>
<Text style={{ fontSize: 20, fontFamily: 'Gotham-Black', color: '#CFB368' }}>Total</Text> <Text style={{ fontSize: 20, fontFamily: 'Gotham-Black', color: '#CFB368' }}>Total</Text>
</View> </View>
{ {
this.props.value_voucher == '' ? ( this.props.value_voucher == '' ? (
<View style={{ flex: 0.4, marginRight: -5 }}> <View style={{ flex: 0.4, marginRight: -5, }}>
<Text style={{ fontSize: 20, fontFamily: 'Gotham-Black', textAlign: 'right', color: '#CFB368' }}>{this.props.order_total + this.props.grabamount}</Text> <Text style={{ fontSize: 20, fontFamily: 'Gotham-Black', textAlign: 'right', color: '#CFB368' }}>{this.props.order_total + this.props.grabamount}</Text>
</View> </View>
) : ( ) : (
<View style={{ flex: 0.4, marginRight: -5 }}> <View style={{ flex: 0.4, marginRight: -5, }}>
<Text style={{ fontSize: 20, fontFamily: 'Gotham-Black', textAlign: 'right', color: '#CFB368' }}>{Math.max(0, this.props.order_total - this.props.voucher.reward.value + this.props.grabamount)}</Text> <Text style={{ fontSize: 20, fontFamily: 'Gotham-Black', textAlign: 'right', color: '#CFB368' }}>{Math.max(0, this.props.order_total - this.props.voucher.reward.value + this.props.grabamount)}</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