screen bug fix
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import AppText from 'components/AppText';
|
||||
import { formatPrice } from 'helpers/formatPrice';
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
@@ -22,14 +23,6 @@ const OrderDetailModal = ({ visible, setVisible, selectedOrder }: Props) => {
|
||||
const translateY = useRef(new Animated.Value(50)).current;
|
||||
const { t } = useTranslation();
|
||||
|
||||
const parsePrice = (priceStr: string) => {
|
||||
return Number(priceStr.replace(/[^\d]/g, ''));
|
||||
};
|
||||
|
||||
const parseWeight = (weightStr: string) => {
|
||||
return Number(weightStr.replace(/[^\d.]/g, ''));
|
||||
};
|
||||
|
||||
const closeModal = () => {
|
||||
Animated.timing(opacity, {
|
||||
toValue: 0,
|
||||
@@ -82,10 +75,6 @@ const OrderDetailModal = ({ visible, setVisible, selectedOrder }: Props) => {
|
||||
style={{ maxHeight: 250 }}
|
||||
>
|
||||
{selectedOrder.items.map((product, index) => {
|
||||
const totalPrice = product.totalPrice;
|
||||
const weight = product.weight;
|
||||
const pricePerKg = Math.ceil(weight ? totalPrice / weight : 0);
|
||||
|
||||
return (
|
||||
<View key={product.trekId + index} style={styles.productItem}>
|
||||
<View style={styles.row}>
|
||||
@@ -100,13 +89,12 @@ const OrderDetailModal = ({ visible, setVisible, selectedOrder }: Props) => {
|
||||
{t('Og’irligi')}: {product.weight}
|
||||
</AppText>
|
||||
<AppText style={styles.detail}>
|
||||
{t('Narxi')}: 1kg * {pricePerKg.toLocaleString('uz-UZ')}{' '}
|
||||
{t("so'm")}
|
||||
{t('Narxi')}: {product.price}$
|
||||
</AppText>
|
||||
</View>
|
||||
<View style={styles.rowRight}>
|
||||
<AppText style={styles.total}>
|
||||
{t('Umumiy narxi')}: {product.totalPrice} {t('so‘m')}
|
||||
{t('Umumiy narxi')}: {product.totalPrice}$
|
||||
</AppText>
|
||||
</View>
|
||||
</View>
|
||||
@@ -117,7 +105,7 @@ const OrderDetailModal = ({ visible, setVisible, selectedOrder }: Props) => {
|
||||
<View style={styles.totalRow}>
|
||||
<AppText style={styles.totalLabel}>{t('Umumiy narx')}:</AppText>
|
||||
<AppText style={styles.totalValue}>
|
||||
{selectedOrder.totalPrice}
|
||||
{formatPrice(selectedOrder.totalPrice)} {t('so‘m')}
|
||||
</AppText>
|
||||
</View>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user