ebanutsya
This commit is contained in:
@@ -4,10 +4,11 @@ import {RFPercentage} from "react-native-responsive-fontsize";
|
||||
import DText from "../DText/DText";
|
||||
import {responsiveHeight, responsiveWidth} from "react-native-responsive-dimensions";
|
||||
import DTitle from "../DTitle/DTitle";
|
||||
import {Order} from "../../types/order";
|
||||
import {BaseMarketplace, Order} from "../../types/order";
|
||||
import OrderProductsList from "./OrderProductsList";
|
||||
import {useDispatch} from "react-redux";
|
||||
import {setOrder} from "../../features/assembly/assemblySlice";
|
||||
import {OrderStatus, OrderStatusDictionary} from "../../features/ordersFilter/ordersFilterSlice";
|
||||
|
||||
type Props = {
|
||||
onPress?: (event: GestureResponderEvent) => void
|
||||
@@ -15,9 +16,17 @@ type Props = {
|
||||
onSelect: (order: Order) => void
|
||||
|
||||
}
|
||||
|
||||
|
||||
const BaseMarketplaceIconDict = {
|
||||
[BaseMarketplace.Wildberries]: require('assets/icons/marketplaces/wildberries.png'),
|
||||
[BaseMarketplace.Ozon]: require('assets/icons/marketplaces/ozon.png'),
|
||||
[BaseMarketplace.YandexMarket]: require('assets/icons/marketplaces/yandex_market.png'),
|
||||
};
|
||||
const OrderCard: FC<Props> = ({onPress, onSelect, order}) => {
|
||||
|
||||
return (
|
||||
<TouchableOpacity onPress={()=>{
|
||||
<TouchableOpacity onPress={() => {
|
||||
if (onSelect) onSelect(order);
|
||||
|
||||
}}>
|
||||
@@ -26,7 +35,7 @@ const OrderCard: FC<Props> = ({onPress, onSelect, order}) => {
|
||||
<View style={styles.title}>
|
||||
|
||||
<DTitle>{order.orderNumber}</DTitle>
|
||||
<Image source={require('assets/icons/marketplaces/ozon.png')} style={styles.titleImage}/>
|
||||
<Image source={BaseMarketplaceIconDict[order.baseMarketplace]} style={styles.titleImage}/>
|
||||
</View>
|
||||
<DText>Селлер: {order.sellerName}</DText>
|
||||
<DText>Маркетплейс: {order.marketplaceName}</DText>
|
||||
@@ -34,7 +43,7 @@ const OrderCard: FC<Props> = ({onPress, onSelect, order}) => {
|
||||
</View>
|
||||
<View style={styles.descriptionStatus}>
|
||||
<DText>
|
||||
Ожидает сборки
|
||||
{OrderStatusDictionary[order.status as OrderStatus]}
|
||||
</DText>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
@@ -9,16 +9,16 @@ import {background} from "../../css/colors";
|
||||
|
||||
type ListProps = {
|
||||
products: OrderProduct[];
|
||||
onSelected: (product: OrderProduct) => void;
|
||||
onSelected: (product: number) => void;
|
||||
}
|
||||
type CardProps = {
|
||||
product: OrderProduct;
|
||||
onPress: (product: OrderProduct) => void;
|
||||
onPress: (product: number) => void;
|
||||
id: number;
|
||||
}
|
||||
const OrderProductCard: FC<CardProps> = ({product, onPress, id}) => {
|
||||
return (
|
||||
<TouchableOpacity onPress={() => onPress(product)}>
|
||||
<TouchableOpacity onPress={() => onPress(id)}>
|
||||
<View style={cardStyles.container}>
|
||||
<View style={cardStyles.content}>
|
||||
<DText>{id + 1}) {product.productName}</DText>
|
||||
|
||||
Reference in New Issue
Block a user