ordering-ui-react-native 0.17.88 → 0.17.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -70,23 +70,25 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
70
70
|
const _orders = customArray || values || []
|
|
71
71
|
const uniqueOrders: any = []
|
|
72
72
|
|
|
73
|
-
|
|
74
73
|
useEffect(() => {
|
|
75
74
|
if (loading || error) return
|
|
76
75
|
const ordersReduced = _orders.map((order: any) => order?.cart_group_id
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
76
|
+
? _orders
|
|
77
|
+
.filter((_order: any) => _order?.cart_group_id === order?.cart_group_id)
|
|
78
|
+
.map((_o: any, _: any, _ordersList: any) => {
|
|
79
|
+
const obj = {
|
|
80
|
+
..._o,
|
|
81
|
+
id: _ordersList.map(o => o.id),
|
|
82
|
+
review: _o.review,
|
|
83
|
+
user_review: _o.user_review,
|
|
84
|
+
total: _ordersList.reduce((acc: any, o: any) => acc + o.summary.total, 0),
|
|
85
|
+
business: _ordersList.map((o: any) => o.business),
|
|
86
|
+
business_id: _ordersList.map((o: any) => o.business_id),
|
|
87
|
+
products: _ordersList.map((o: any) => o.products)
|
|
88
|
+
}
|
|
89
|
+
return obj
|
|
90
|
+
}).find((o: any) => o)
|
|
91
|
+
: order)
|
|
90
92
|
const orders = ordersReduced?.filter((order: any) => {
|
|
91
93
|
if (!order?.cart_group_id) return true
|
|
92
94
|
const isDuplicate = uniqueOrders.includes(order?.cart_group_id)
|
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
} from 'ordering-components/native';
|
|
12
12
|
import { useTheme } from 'styled-components/native';
|
|
13
13
|
import { SingleProductCardParams } from '../../types';
|
|
14
|
-
import { CardInfo, SoldOut, QuantityContainer, PricesContainer, RibbonBox, LogoWrapper,
|
|
15
|
-
import { StyleSheet, View } from 'react-native';
|
|
14
|
+
import { CardInfo, SoldOut, QuantityContainer, PricesContainer, RibbonBox, LogoWrapper, TagsContainer } from './styles';
|
|
15
|
+
import { ScrollView, StyleSheet, TouchableWithoutFeedback, View } from 'react-native';
|
|
16
16
|
import { InView } from 'react-native-intersection-observer'
|
|
17
17
|
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
|
|
18
18
|
import { OButton, OIcon, OText } from '../shared';
|
|
@@ -104,7 +104,7 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
|
|
|
104
104
|
color: '#808080',
|
|
105
105
|
textDecorationLine: 'line-through',
|
|
106
106
|
marginLeft: 7,
|
|
107
|
-
marginRight:
|
|
107
|
+
marginRight: 0
|
|
108
108
|
},
|
|
109
109
|
productTagsStyle: {
|
|
110
110
|
width: 30,
|
|
@@ -215,21 +215,29 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
|
|
|
215
215
|
{product?.offer_price !== null && !!product?.in_offer && (
|
|
216
216
|
<OText style={styles.regularPriceStyle}>{product?.offer_price ? parsePrice(product?.offer_price) : ''}</OText>
|
|
217
217
|
)}
|
|
218
|
-
{product?.tags && product?.tags.length > 0 && (
|
|
219
|
-
<
|
|
218
|
+
{!isPreviously && product?.tags && product?.tags.length > 0 && (
|
|
219
|
+
<ScrollView
|
|
220
|
+
showsVerticalScrollIndicator={false}
|
|
221
|
+
showsHorizontalScrollIndicator={false}
|
|
222
|
+
horizontal
|
|
223
|
+
style={{ marginLeft: 10 }}
|
|
224
|
+
contentContainerStyle={{flexGrow: 1}}
|
|
225
|
+
>
|
|
220
226
|
{product?.tags.map((tag: any, i: any) => (
|
|
221
|
-
<
|
|
222
|
-
<
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
227
|
+
<TouchableWithoutFeedback key={i}>
|
|
228
|
+
<TagsContainer>
|
|
229
|
+
<FastImage
|
|
230
|
+
style={styles.productTagsStyle}
|
|
231
|
+
source={tag.image ? {
|
|
232
|
+
uri: optimizeImage(tag.image, 'h_250,c_limit'),
|
|
233
|
+
priority: FastImage.priority.normal,
|
|
234
|
+
} : theme?.images?.dummies?.product}
|
|
235
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
236
|
+
/>
|
|
237
|
+
</TagsContainer>
|
|
238
|
+
</TouchableWithoutFeedback>
|
|
231
239
|
))}
|
|
232
|
-
</
|
|
240
|
+
</ScrollView>
|
|
233
241
|
)}
|
|
234
242
|
</PricesContainer>
|
|
235
243
|
{!hideProductDescription && (
|