ordering-ui-react-native 0.17.87 → 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 +1 -1
- package/themes/original/src/components/MultiCheckout/index.tsx +1 -7
- package/themes/original/src/components/OrdersOption/index.tsx +16 -14
- package/themes/original/src/components/SingleProductCard/index.tsx +24 -16
- package/themes/original/src/components/SingleProductCard/styles.tsx +1 -0
package/package.json
CHANGED
|
@@ -78,8 +78,7 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
78
78
|
|
|
79
79
|
const configTypes = configs?.order_types_allowed?.value.split('|').map((value: any) => Number(value)) || []
|
|
80
80
|
const isPreOrder = configs?.preorder_status_enabled?.value === '1'
|
|
81
|
-
const
|
|
82
|
-
const isDisablePlaceOrderButton = !(paymethodSelected?.paymethod_id || paymethodSelected?.wallet_id) || openCarts.length > maximumCarts || (paymethodSelected?.paymethod?.gateway === 'stripe' && !paymethodSelected?.paymethod_data)
|
|
81
|
+
const isDisablePlaceOrderButton = !(paymethodSelected?.paymethod_id || paymethodSelected?.wallet_id) || (paymethodSelected?.paymethod?.gateway === 'stripe' && !paymethodSelected?.paymethod_data)
|
|
83
82
|
const walletCarts = (Object.values(carts)?.filter((cart: any) => cart?.products && cart?.products?.length && cart?.status !== 2 && cart?.valid_schedule && cart?.valid_products && cart?.valid_address && cart?.valid_maximum && cart?.valid_minimum && cart?.wallets) || null) || []
|
|
84
83
|
|
|
85
84
|
const [isUserDetailsEdit, setIsUserDetailsEdit] = useState(false);
|
|
@@ -292,11 +291,6 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
292
291
|
</OText>
|
|
293
292
|
</ChCartsTotal>
|
|
294
293
|
)}
|
|
295
|
-
{openCarts.length > maximumCarts && (
|
|
296
|
-
<OText size={14} color={theme.colors.danger5} style={{ marginVertical: 20 }}>
|
|
297
|
-
{t('WARNING_MAXIMUM_CARTS', 'You can only pay for a maximum of 5 carts, please discard one or more to continue.')}
|
|
298
|
-
</OText>
|
|
299
|
-
)}
|
|
300
294
|
</ChCarts>
|
|
301
295
|
</ChSection>
|
|
302
296
|
</ChContainer>
|
|
@@ -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 && (
|