ebanutsya

This commit is contained in:
2023-10-29 06:54:42 +03:00
parent 0bc1835405
commit cd89a70b17
15 changed files with 346 additions and 88 deletions

View File

@@ -6,18 +6,20 @@ import {responsiveHeight, responsiveWidth} from "react-native-responsive-dimensi
import DTitle from "../DTitle/DTitle";
import {Order} from "../../types/order";
import OrderProductsList from "./OrderProductsList";
import {useDispatch} from "react-redux";
import {setOrder} from "../../features/assembly/assemblySlice";
type Props = {
onPress?: (event: GestureResponderEvent) => void
onSelect: (order: Order) => void
order: Order
onSelect: (order: Order) => void
}
const OrderCard: FC<Props> = React.memo(({onPress, onSelect, order}) => {
const OrderCard: FC<Props> = ({onPress, onSelect, order}) => {
return (
<TouchableOpacity onPress={() => {
onSelect(order);
<TouchableOpacity onPress={()=>{
if (onSelect) onSelect(order);
}}>
<View style={styles.container}><View style={styles.description}>
<View style={styles.descriptionContent}>
@@ -28,6 +30,7 @@ const OrderCard: FC<Props> = React.memo(({onPress, onSelect, order}) => {
</View>
<DText>Селлер: {order.sellerName}</DText>
<DText>Маркетплейс: {order.marketplaceName}</DText>
<DText>Товаров в заказе: {order.products.length}</DText>
</View>
<View style={styles.descriptionStatus}>
<DText>
@@ -40,13 +43,12 @@ const OrderCard: FC<Props> = React.memo(({onPress, onSelect, order}) => {
</TouchableOpacity>
)
})
}
const styles = StyleSheet.create({
container: {
backgroundColor: "white",
display: "flex",
borderRadius: RFPercentage(3),
height: responsiveHeight(15),
flexDirection: "row",
padding: RFPercentage(2),
flex: 1
@@ -80,7 +82,6 @@ const styles = StyleSheet.create({
marginLeft: responsiveHeight(1)
},
descriptionContent: {
// backgroundColor: "green",
flex: 1
},
descriptionStatus: {