diff options
author | Biswakalyan Bhuyan <biswa@surgot.in> | 2024-10-16 16:18:13 +0530 |
---|---|---|
committer | Biswakalyan Bhuyan <biswa@surgot.in> | 2024-10-16 16:18:13 +0530 |
commit | 5d6b82fd07ad6ef34e26443d0e363d8401cb489f (patch) | |
tree | c6adb671bb39df3e567b3797d01343edb5d026d6 /src | |
parent | 035d1e036359e8e590f2e17c0390e5d3ffec1728 (diff) | |
download | mall-app-5d6b82fd07ad6ef34e26443d0e363d8401cb489f.tar.gz mall-app-5d6b82fd07ad6ef34e26443d0e363d8401cb489f.tar.bz2 mall-app-5d6b82fd07ad6ef34e26443d0e363d8401cb489f.zip |
Add CheckoutScreen with payment and invoice email
Diffstat (limited to 'src')
-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; |