ordering-ui-react-native 0.23.12 → 0.23.14
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/business/src/components/NewOrderNotification/index.tsx +1 -1
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +9 -2
- package/themes/original/src/components/Cart/index.tsx +5 -4
- package/themes/original/src/components/OrderDetails/index.tsx +7 -4
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +15 -14
package/package.json
CHANGED
|
@@ -156,7 +156,7 @@ const NewOrderNotificationUI = (props: any) => {
|
|
|
156
156
|
setCurrentEvent({ evt: 2, orderId: value?.id ?? value?.order_id })
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
if ((!orderStatus.includes(value.status) && evtType !== 1 && isBusinessApp) || value?.author_id === user.id) return
|
|
159
|
+
if ((!orderStatus.includes(value.status) && evtType !== 1 && isBusinessApp && orderStatus?.length > 0) || value?.author_id === user.id) return
|
|
160
160
|
setCurrentEvent({
|
|
161
161
|
evt: evtType,
|
|
162
162
|
orderId: value?.driver
|
|
@@ -65,6 +65,7 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
65
65
|
const messagesReadIds = messagesReadList?.map((message: any) => message?.order_message_id)
|
|
66
66
|
|
|
67
67
|
const filteredMessages = messagesReadList?.length > 0 ? messages?.messages?.filter((message: any) => !messagesReadIds?.includes(message?.id)) : messages?.messages
|
|
68
|
+
const cateringTypes = [7, 8]
|
|
68
69
|
|
|
69
70
|
const styles = StyleSheet.create({
|
|
70
71
|
icons: {
|
|
@@ -228,12 +229,18 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
228
229
|
<OrderHeader>
|
|
229
230
|
{!props.isCustomView ? (
|
|
230
231
|
<OText size={13} style={{ marginBottom: 5 }}>
|
|
231
|
-
|
|
232
|
+
<>
|
|
233
|
+
{cateringTypes.includes(order?.delivery_type) ? `${t('CREATED_AT', 'Created at')}: ${parseDate(order?.created_at)}\n` : ''}
|
|
234
|
+
{cateringTypes.includes(order?.delivery_type) ? `${t('PLACED_TO', 'Placed to')}: ` : ''}{deliveryDate()}
|
|
235
|
+
</>
|
|
232
236
|
</OText>
|
|
233
237
|
) : (
|
|
234
238
|
<Header style={{ alignItems: 'center' }}>
|
|
235
239
|
<OText size={13} style={{ marginBottom: 5 }}>
|
|
236
|
-
|
|
240
|
+
<>
|
|
241
|
+
{cateringTypes.includes(order?.delivery_type) ? `${t('CREATED_AT', 'Created at')}: ${parseDate(order?.created_at)}\n` : ''}
|
|
242
|
+
{cateringTypes.includes(order?.delivery_type) ? `${t('PLACED_TO', 'Placed to')}: ` : ''}{deliveryDate()}
|
|
243
|
+
</>
|
|
237
244
|
</OText>
|
|
238
245
|
|
|
239
246
|
{(!order?.isLogistic || (!logisticOrderStatus?.includes(order?.status) && !order?.order_group)) && (
|
|
@@ -129,8 +129,9 @@ const CartUI = (props: any) => {
|
|
|
129
129
|
cartUuid: cart?.uuid,
|
|
130
130
|
businessLogo: cart?.business?.logo,
|
|
131
131
|
businessName: cart?.business?.name,
|
|
132
|
-
cartTotal: cart?.total
|
|
133
|
-
|
|
132
|
+
cartTotal: cart?.total,
|
|
133
|
+
fromProductsList: isFromUpselling
|
|
134
|
+
})
|
|
134
135
|
} else {
|
|
135
136
|
const groupKeys: any = {}
|
|
136
137
|
cartsAvailable.forEach((_cart: any) => {
|
|
@@ -146,12 +147,12 @@ const CartUI = (props: any) => {
|
|
|
146
147
|
onNavigationRedirect('CheckoutNavigator', {
|
|
147
148
|
screen: 'MultiCheckout',
|
|
148
149
|
checkCarts: true
|
|
149
|
-
}
|
|
150
|
+
})
|
|
150
151
|
} else {
|
|
151
152
|
onNavigationRedirect('CheckoutNavigator', {
|
|
152
153
|
screen: 'MultiCheckout',
|
|
153
154
|
cartUuid: cartsAvailable[0]?.group?.uuid
|
|
154
|
-
}
|
|
155
|
+
})
|
|
155
156
|
}
|
|
156
157
|
}
|
|
157
158
|
}
|
|
@@ -134,6 +134,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
134
134
|
const directionTypes = [2, 3, 4, 5]
|
|
135
135
|
const activeStatus = [0, 3, 4, 7, 8, 9, 13, 14, 18, 19, 20, 21, 22, 23, 24, 25, 26]
|
|
136
136
|
const reorderStatus = [1, 2, 5, 6, 10, 11, 12]
|
|
137
|
+
const cateringTypes = [7, 8]
|
|
137
138
|
const [isPickup, setIsPickup] = useState(order?.delivery_type === 2)
|
|
138
139
|
const enabledPoweredByOrdering = configs?.powered_by_ordering_module?.value
|
|
139
140
|
const isGiftCardOrder = !order?.business_id
|
|
@@ -361,7 +362,6 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
361
362
|
}
|
|
362
363
|
}, [props?.order?.error, props?.order?.loading])
|
|
363
364
|
|
|
364
|
-
|
|
365
365
|
useEffect(() => {
|
|
366
366
|
if (!order?.delivery_type) return
|
|
367
367
|
setIsPickup(order?.delivery_type === 2)
|
|
@@ -461,15 +461,18 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
461
461
|
<NavBar
|
|
462
462
|
hideArrowLeft
|
|
463
463
|
title={`${t('ORDER', 'Order')} #${order?.id}`}
|
|
464
|
-
titleAlign={'
|
|
464
|
+
titleAlign={'left'}
|
|
465
465
|
showCall={false}
|
|
466
466
|
btnStyle={{ paddingLeft: 0 }}
|
|
467
467
|
style={{ marginTop: Platform.OS === 'ios' ? 0 : 20 }}
|
|
468
468
|
titleWrapStyle={{ paddingHorizontal: 0 }}
|
|
469
|
-
titleStyle={{ marginRight: 0, marginLeft: 0 }}
|
|
469
|
+
titleStyle={{ marginRight: 0, marginLeft: 0, paddingHorizontal: 0 }}
|
|
470
470
|
subTitle={!hideDeliveryDate && <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
|
|
471
471
|
{activeStatus.includes(order?.status) ? (
|
|
472
|
-
|
|
472
|
+
<>
|
|
473
|
+
{cateringTypes.includes(order?.delivery_type) ? `${t('CREATED_AT', 'Created at')}: ${parseDate(order?.created_at)}\n` : ''}
|
|
474
|
+
{cateringTypes.includes(order?.delivery_type) ? `${t('PLACED_TO', 'Placed to')}:` : ''} <OrderEta order={order} />
|
|
475
|
+
</>
|
|
473
476
|
) : (
|
|
474
477
|
parseDate(order?.reporting_data?.at[`status:${order.status}`])
|
|
475
478
|
)}
|
|
@@ -36,10 +36,16 @@ export const ProductOptionSubOptionUI = (props: any) => {
|
|
|
36
36
|
setIsScrollAvailable,
|
|
37
37
|
image,
|
|
38
38
|
enableIntersection,
|
|
39
|
-
|
|
39
|
+
usePizzaValidation,
|
|
40
|
+
pizzaState
|
|
40
41
|
} = props
|
|
41
42
|
|
|
42
|
-
const disableIncrement =
|
|
43
|
+
const disableIncrement =
|
|
44
|
+
option?.with_half_option
|
|
45
|
+
? pizzaState?.[`option:${option?.id}`]?.value === option?.max
|
|
46
|
+
: option?.limit_suboptions_by_max
|
|
47
|
+
? (balance === option?.max || state.quantity === suboption.max)
|
|
48
|
+
: state.quantity === suboption?.max || (!state.selected && balance === option?.max)
|
|
43
49
|
const price = option?.with_half_option && suboption?.half_price && state.position !== 'whole' ? suboption?.half_price : suboption?.price
|
|
44
50
|
|
|
45
51
|
const theme = useTheme();
|
|
@@ -66,8 +72,9 @@ export const ProductOptionSubOptionUI = (props: any) => {
|
|
|
66
72
|
const handleSuboptionClick = () => {
|
|
67
73
|
toggleSelect()
|
|
68
74
|
setIsDirty(true)
|
|
75
|
+
const minMaxValidation = option?.with_half_option ? usePizzaValidation : (balance === option?.max && option?.suboptions?.length > balance && !(option?.min === 1 && option?.max === 1))
|
|
69
76
|
|
|
70
|
-
if (
|
|
77
|
+
if (!state.selected && minMaxValidation) {
|
|
71
78
|
setShowMessage(true)
|
|
72
79
|
}
|
|
73
80
|
}
|
|
@@ -87,13 +94,7 @@ export const ProductOptionSubOptionUI = (props: any) => {
|
|
|
87
94
|
if (!(balance === option?.max && option?.suboptions?.length > balance && !(option?.min === 1 && option?.max === 1))) {
|
|
88
95
|
setShowMessage(false)
|
|
89
96
|
}
|
|
90
|
-
}, [balance])
|
|
91
|
-
|
|
92
|
-
useEffect(() => {
|
|
93
|
-
if (!suboption?.preselected || !option?.respect_to) return
|
|
94
|
-
const newState = { ...state, selected: suboption?.preselected, quantity: state.selected ? 0 : 1 }
|
|
95
|
-
onChange(newState, suboption, option)
|
|
96
|
-
}, [suboption, option])
|
|
97
|
+
}, [balance, pizzaState?.[`option:${option?.id}`]?.value])
|
|
97
98
|
|
|
98
99
|
return (
|
|
99
100
|
<InView onChange={(inView: boolean) => handleChangeInterSection(inView)} triggerOnce={true}>
|
|
@@ -129,7 +130,7 @@ export const ProductOptionSubOptionUI = (props: any) => {
|
|
|
129
130
|
{suboption?.name}
|
|
130
131
|
</OText>
|
|
131
132
|
</IconControl>
|
|
132
|
-
{option?.allow_suboption_quantity && state?.selected && (
|
|
133
|
+
{!(option?.max === 1 && option?.min === 1) && option?.allow_suboption_quantity && state?.selected && (
|
|
133
134
|
<QuantityControl>
|
|
134
135
|
<>
|
|
135
136
|
<Checkbox disabled={disabled || state.quantity === 0} onPress={decrement}>
|
|
@@ -142,11 +143,11 @@ export const ProductOptionSubOptionUI = (props: any) => {
|
|
|
142
143
|
<OText size={12}>
|
|
143
144
|
{state.quantity}
|
|
144
145
|
</OText>
|
|
145
|
-
<Checkbox disabled={disabled || disableIncrement} onPress={increment}>
|
|
146
|
+
<Checkbox disabled={disabled || disableIncrement || usePizzaValidation} onPress={increment}>
|
|
146
147
|
<IconAntDesign
|
|
147
148
|
name='pluscircleo'
|
|
148
149
|
size={iconsSize}
|
|
149
|
-
color={disableIncrement || disabled ? theme.colors.disabled : theme.colors.primary}
|
|
150
|
+
color={disableIncrement || disabled || usePizzaValidation ? theme.colors.disabled : theme.colors.primary}
|
|
150
151
|
/>
|
|
151
152
|
</Checkbox>
|
|
152
153
|
</>
|
|
@@ -164,7 +165,7 @@ export const ProductOptionSubOptionUI = (props: any) => {
|
|
|
164
165
|
style={styles.inverse}
|
|
165
166
|
/>
|
|
166
167
|
</Circle>
|
|
167
|
-
<Circle disabled={disabled} onPress={() => changePosition('whole')}>
|
|
168
|
+
<Circle disabled={disabled || (pizzaState?.[`option:${option?.id}`]?.value === option?.max)} onPress={() => changePosition('whole')}>
|
|
168
169
|
<OIcon
|
|
169
170
|
src={theme.images.general.half_f}
|
|
170
171
|
color={state.selected && state.position === 'whole' ? theme.colors.primary : '#cbcbcb'}
|