added notification

This commit is contained in:
Samandar Turgunboyev
2025-09-04 10:06:46 +05:00
parent e51ff4f502
commit f55a3a50ed
54 changed files with 2502 additions and 643 deletions

View File

@@ -1,8 +1,9 @@
import { useQuery } from '@tanstack/react-query';
import exchanges_api from 'api/exchanges';
import * as React from 'react';
import { useTranslation } from 'react-i18next';
import { Dimensions, ScrollView, Text, View } from 'react-native';
import Svg, { Circle, Path } from 'react-native-svg';
import { fakePayments } from 'screens/wallet/payment/lib/data';
import Plane from 'svg/Plane';
import { PaymentStyle } from '../../payment/ui/style';
@@ -16,6 +17,11 @@ const PaymentProduct = ({ packet }: PaymentProductProps) => {
const isSmallScreen = screenWidth < 380;
const svgWidth = screenWidth * 0.8;
const { data } = useQuery({
queryKey: ['exchanges'],
queryFn: () => exchanges_api.getExchanges(),
});
return (
<ScrollView
style={PaymentStyle.containerMethod}
@@ -53,8 +59,12 @@ const PaymentProduct = ({ packet }: PaymentProductProps) => {
: { flexBasis: '48%', alignItems: 'flex-start' },
]}
>
<Text style={PaymentStyle.titleMethod}>USD</Text>
<Text style={PaymentStyle.textMethod}>12.267 UZS</Text>
{data && (
<>
<Text style={PaymentStyle.titleMethod}>{data[0].code}</Text>
<Text style={PaymentStyle.textMethod}>{data[0].rate} UZS</Text>
</>
)}
</View>
<View
@@ -69,7 +79,7 @@ const PaymentProduct = ({ packet }: PaymentProductProps) => {
<Text style={PaymentStyle.textMethod}>12.267 UZS/ kg</Text>
</View>
<View
{/* <View
style={[
PaymentStyle.info,
isSmallScreen
@@ -79,18 +89,18 @@ const PaymentProduct = ({ packet }: PaymentProductProps) => {
>
<Text style={PaymentStyle.titleMethod}>{t('Yetkazish vaqti')}</Text>
<Text style={PaymentStyle.textMethod}>08.25.2025</Text>
</View>
</View> */}
<View
style={[
PaymentStyle.info,
isSmallScreen
? { flexBasis: '48%', alignItems: 'flex-end' }
: { flexBasis: '48%', alignItems: 'flex-end' },
? { flexBasis: '48%', alignItems: 'flex-start' }
: { flexBasis: '48%', alignItems: 'flex-start' },
]}
>
<Text style={PaymentStyle.titleMethod}>Reys</Text>
<Text style={[PaymentStyle.textMethod, { textAlign: 'right' }]}>
<Text style={[PaymentStyle.textMethod, { textAlign: 'left' }]}>
{packet.packetName}
</Text>
</View>
@@ -133,14 +143,14 @@ const PaymentProduct = ({ packet }: PaymentProductProps) => {
}}
/>
</View>
{fakePayments.map((item: any, index: number) => {
{packet.items.map((item: any, index: number) => {
const price = Number(item.price);
const weight = Number(item.weight);
// const total = price * weight;
const total = price * weight;
// formatlash: 0 decimal, som bilan
const formattedPrice = price.toFixed(0);
// const formattedTotal = total.toFixed(0);
const formattedTotal = total.toFixed(0);
return (
<View key={index} style={{ marginBottom: 15 }}>
<View style={PaymentStyle.receiptCard}>
@@ -160,7 +170,7 @@ const PaymentProduct = ({ packet }: PaymentProductProps) => {
</View>
<View style={PaymentStyle.rowRight}>
<Text style={PaymentStyle.total}>
{/* {t('Umumiy narxi')}: {formattedTotal} {t('som')} */}
{t('Umumiy narxi')}: {formattedTotal} {t('som')}
</Text>
</View>
</View>