blob: da56fbc5e7bb8e28bafdd71b4ab4bd3c267688bd (
plain) (
tree)
|
|
import React from 'react';
import { View, Text, Button, StyleSheet } from 'react-native';
import QuantityAdjuster from './QuantityAdjuster';
const CartItem = ({ item, onUpdateQuantity }) => (
<View style={styles.container}>
<Text style={styles.name}>{item.name}</Text>
<Text style={styles.price}>${item.price.toFixed(2)}</Text>
<QuantityAdjuster quantity={item.quantity} onChange={(newQuantity) => onUpdateQuantity(item.id, newQuantity)} />
</View>
);
const styles = StyleSheet.create({
container: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
padding: 10,
borderBottomWidth: 1,
borderColor: '#ccc'
},
name: { fontSize: 18 },
price: { fontSize: 16, color: '#888' },
});
export default CartItem;
|