Commit df2e2f9f authored by Trisno's avatar Trisno

update design shopping cart

parent 44a3a512
...@@ -23,7 +23,7 @@ class ItemShoping extends React.Component { ...@@ -23,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
...@@ -37,20 +37,22 @@ class ItemShoping extends React.Component { ...@@ -37,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: 15, 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>
<NumberFormat decimalScale={0} value={item.price} renderText={value => <Text style={{ fontSize: 12, margin: 5, marginRight: 10, fontFamily: 'Gotham-Black', color: 'grey' }}>Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} /> <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>
...@@ -77,6 +79,7 @@ const styles = StyleSheet.create({ ...@@ -77,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,
...@@ -134,6 +137,6 @@ const mapDispatchToProps = (dispacth) => { ...@@ -134,6 +137,6 @@ const mapDispatchToProps = (dispacth) => {
} }
}), }),
} }
} }
export default connect(mapStateToProps, mapDispatchToProps)(ItemShoping) export default connect(mapStateToProps, mapDispatchToProps)(ItemShoping)
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