diff options
Diffstat (limited to 'src/screens/Checkout/CheckoutScreen.js')
-rw-r--r-- | src/screens/Checkout/CheckoutScreen.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/screens/Checkout/CheckoutScreen.js b/src/screens/Checkout/CheckoutScreen.js new file mode 100644 index 0000000..a8645d2 --- /dev/null +++ b/src/screens/Checkout/CheckoutScreen.js @@ -0,0 +1,26 @@ +import React, { useContext } from 'react'; +import { View, Text, Button } from 'react-native'; +import { CartContext } from '../../context/CartContext'; +import emailService from '../../services/emailService'; + +const CheckoutScreen = ({ navigation }) => { + const { cart } = useContext(CartContext); + + const handlePayment = async () => { + // Simulate payment processing + alert('Payment successful!'); + await emailService.sendInvoice(cart); + navigation.navigate('Invoice'); + }; + + return ( + <View> + {cart.map((item, index) => ( + <Text key={index}>{item.name} - ${item.price * item.quantity}</Text> + ))} + <Button title="Confirm and Pay" onPress={handlePayment} /> + </View> + ); +}; + +export default CheckoutScreen; |