Order
Order
Order
// Example cart items (you should replace this with your own data)
const exampleCartItems = [
{ id: 1, title: "Book 1", price: 10.99, quantity: 2, image:
"https://example.com/book1.jpg" },
{ id: 2, title: "Book 2", price: 15.99, quantity: 1, image:
"https://example.com/book2.jpg" },
{ id: 3, title: "Book 3", price: 9.99, quantity: 3, image:
"https://example.com/book3.jpg" },
];
return (
<ScrollView style={styles.container}>
<View style={styles.scrollViewContent}>
<View style={styles.header}>
<TouchableOpacity onPress={() => navigation.goBack()}>
<FontAwesome name="arrow-left" size={24} color="black"
mode="contained"/>
</TouchableOpacity>
<Text style={styles.headerText}>Thanh toán</Text>
</View>
<ScrollView contentContainerStyle={styles.cartItemsContainer}>
{exampleCartItems.map((item) => (
<View key={item.id} style={styles.cartItem}>
<View style={styles.productBorder}>
<Image source={{ uri: item.image }}
style={styles.itemImage} />
<View style={styles.itemDetails}>
<Text style={styles.itemTitle}>{item.title}</Text>
<Text style={styles.itemQuantity}>Quantity:
{item.quantity}</Text>
<Text style={styles.itemPrice}>${(item.price *
item.quantity).toFixed(2)}</Text>
</View>
</View>
</View>
))}
</ScrollView>
<View style={styles.customerInfoContainer}>
<Text style={styles.customerInfoTitle}>Customer Information:</Text>
<TextInput
style={styles.input}
placeholder="Name"
value={customerInfo.name}
onChangeText={(text) => setCustomerInfo({ ...customerInfo, name:
text })}
/>
<TextInput
style={styles.input}
placeholder="Email"
value={customerInfo.email}
onChangeText={(text) => setCustomerInfo({ ...customerInfo, email:
text })}
/>
<TextInput
style={styles.input}
placeholder="Address"
value={customerInfo.address}
onChangeText={(text) => setCustomerInfo({ ...customerInfo,
address: text })}
/>
</View>
<View style={styles.orderNoteContainer}>
<Text style={styles.orderNoteTitle}>Order Note:</Text>
<TextInput
style={styles.input}
placeholder="Add a note (optional)"
multiline
numberOfLines={4}
value={orderNote}
onChangeText={(text) => setOrderNote(text)}
/>
</View>
<View style={styles.totalPriceContainer}>
<Text style={styles.totalPriceText}>Total: $
{calculateTotalPrice().toFixed(2)}</Text>
</View>
<TouchableOpacity style={styles.checkoutButton}>
<Text style={styles.checkoutButtonText}>Proceed to Checkout</Text>
</TouchableOpacity>
</View>
</ScrollView>
);
};