import { View, Text, ScrollView, Pressable, StyleSheet, Image } from 'react-native' import React, { useState } from 'react' import { Ionicons } from '@expo/vector-icons'; import PaymentOption from "../components/PaymentOption"; import PaymentFooter from "../components/PaymentFooter"; import { LinearGradient } from 'expo-linear-gradient'; import { useStore } from '../store/store'; const PaymentOptionList = [ { id: 1, name: 'Debit/Credit ', icon: require('../../assets/images/payment/debit_credit.png'), iconStatus: true, }, { id: 2, name: 'Apple Pay', icon: require('../../assets/images/payment/apple_pay.png'), iconStatus: false, }, { id: 3, name: 'Google Pay', icon: require('../../assets/images/payment/google_pay.png'), iconStatus: false, }, ] const Payment = ({navigation, route}: any) => { const calculateCartPrice = useStore((state: any) => state.calculateCartPrice); const addToReceiptList = useStore(((state: any) => state.addToReceiptList)); const [paymentMethod, setPaymentMenthod] = useState('Credit card'); const [showApprove, setShowApprove] = useState(false); const buttonPressHandler = () => { setShowApprove(true); addToReceiptList(); calculateCartPrice(); setTimeout(() => { setShowApprove(false); navigation.navigate('receipt') }, 3000) }; return ( {showApprove ? ( Approved! Thank you for your order! ) : ( <> )} {navigation.pop()}}> Payments {setPaymentMenthod('Credit Card')}}> Fakey McFaker {PaymentOptionList.map((data: any) => ( {setPaymentMenthod(data.name);}}> ))} ) } export default Payment const styles = StyleSheet.create({})