import { RouteProp, useRoute } from '@react-navigation/native'; import { useQuery } from '@tanstack/react-query'; import exchanges_api from 'api/exchanges'; import LayoutTwo from 'components/LayoutTwo'; import * as React from 'react'; import { useTranslation } from 'react-i18next'; import { Dimensions, Image, ScrollView, StyleSheet, Text, TouchableOpacity, View, } from 'react-native'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import Svg, { Circle, Path } from 'react-native-svg'; import { PaymentStyle } from 'screens/wallet/payment/ui/style'; import ModalCard from 'screens/wallet/paymentMethod/ui/ModalCard'; import ModalPay from 'screens/wallet/paymentMethod/ui/ModalPay'; import ModalSuccess from 'screens/wallet/paymentMethod/ui/ModalSuccess'; import Plane from 'svg/Plane'; const PaymentQrCode = () => { const { t } = useTranslation(); const [selectedId, setSelectedId] = React.useState<'card' | 'pay' | null>( null, ); const route = useRoute>(); const packets = route.params?.packets; const [selectedCard, setSelectedCard] = React.useState< 'click' | 'payme' | null >(null); const { data } = useQuery({ queryKey: ['exchanges'], queryFn: () => exchanges_api.getExchanges(), }); const { bottom } = useSafeAreaInsets(); const [isModalVisible, setModalVisible] = React.useState(false); const toggleModal = () => setModalVisible(true); const [cardModal, setCardModal] = React.useState(false); const [payModal, setPayModal] = React.useState(false); const [success, setSuccess] = React.useState(false); const screenWidth = Dimensions.get('window').width; const isSmallScreen = screenWidth < 380; const svgWidth = screenWidth * 0.8; const svgWidthProduct = screenWidth * 1; const qrUrl = `https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=${encodeURIComponent( packets.qrCode, )}`; return ( {data && ( <> {data[0].code} {data[0].rate} UZS )} Cargo 12.267 UZS/ kg {/* {t('Yetkazish vaqti')} {} */} Reys {packets.packetName} {packets.items.map((item: any, index: number) => ( {item.name} {t('Trek ID')}: {item.trackId} {t('Og’irligi')}: {item.weight} 1kg * {item.unitPrice} {t('Umumiy narxi')}: {item.total} {t('so‘m')} ))} {t('Umumiy narxi')} 100.000.000 {/* Top-left */} {/* Top-right */} {/* Bottom-left */} {/* Bottom-right */} {cardModal && ( )} {success && ( )} {packets.paymentStatus !== 'PAYED' && ( {t("To'lash")} )} ); }; export default PaymentQrCode; const styles = StyleSheet.create({ cornerStyle: { position: 'absolute' as const, width: 40, height: 40, borderTopWidth: 6, borderLeftWidth: 6, borderColor: '#007AFF', }, });