ordering-ui-react-native 0.17.95 → 0.17.97
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/PreviousOrders/index.tsx +5 -5
- package/themes/original/src/components/Cart/index.tsx +7 -6
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +2 -2
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -1
- package/themes/original/src/components/UpsellingProducts/index.tsx +3 -3
- package/themes/original/src/types/index.tsx +1 -1
package/package.json
CHANGED
|
@@ -81,15 +81,15 @@ export const PreviousOrders = (props: any) => {
|
|
|
81
81
|
imgRightSrc={null}
|
|
82
82
|
style={{ borderRadius: 7, height: 40 }}
|
|
83
83
|
parentStyle={{ width: '100%' }}
|
|
84
|
-
textStyle={{ color: theme
|
|
84
|
+
textStyle={{ color: theme?.colors?.white }}
|
|
85
85
|
/>
|
|
86
86
|
) : (
|
|
87
87
|
<>
|
|
88
88
|
<OButton
|
|
89
89
|
text={t('REJECT', 'Reject')}
|
|
90
90
|
onClick={() => handleClickLogisticOrder(2, _order?.id)}
|
|
91
|
-
bgColor={theme.colors.
|
|
92
|
-
borderColor={theme.colors.
|
|
91
|
+
bgColor={theme.colors.red}
|
|
92
|
+
borderColor={theme.colors.red}
|
|
93
93
|
imgRightSrc={null}
|
|
94
94
|
style={{ borderRadius: 7, height: 40 }}
|
|
95
95
|
parentStyle={{ width: '45%' }}
|
|
@@ -98,8 +98,8 @@ export const PreviousOrders = (props: any) => {
|
|
|
98
98
|
<OButton
|
|
99
99
|
text={t('ACCEPT', 'Accept')}
|
|
100
100
|
onClick={() => handleClickLogisticOrder(1, _order?.id)}
|
|
101
|
-
bgColor={theme.colors.
|
|
102
|
-
borderColor={theme.colors.
|
|
101
|
+
bgColor={theme.colors.green}
|
|
102
|
+
borderColor={theme.colors.green}
|
|
103
103
|
imgRightSrc={null}
|
|
104
104
|
style={{ borderRadius: 7, height: 40 }}
|
|
105
105
|
parentStyle={{ width: '45%' }}
|
|
@@ -108,17 +108,18 @@ const CartUI = (props: any) => {
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
const handleUpsellingPage = () => {
|
|
111
|
+
const handleUpsellingPage = (individualCart : any) => {
|
|
112
112
|
setOpenUpselling(false)
|
|
113
113
|
setCanOpenUpselling(false)
|
|
114
114
|
const cartsAvailable: any = Object.values(orderState?.carts)?.filter((cart: any) => cart?.valid && cart?.status !== 2)
|
|
115
|
-
if (cartsAvailable.length === 1) {
|
|
115
|
+
if (cartsAvailable.length === 1 || !isMultiCheckout) {
|
|
116
|
+
const cart = isMultiCheckout ? cartsAvailable[0] : individualCart
|
|
116
117
|
onNavigationRedirect('CheckoutNavigator', {
|
|
117
118
|
screen: 'CheckoutPage',
|
|
118
|
-
cartUuid:
|
|
119
|
-
businessLogo:
|
|
120
|
-
businessName:
|
|
121
|
-
cartTotal:
|
|
119
|
+
cartUuid: cart?.uuid,
|
|
120
|
+
businessLogo: cart?.business?.logo,
|
|
121
|
+
businessName: cart?.business?.name,
|
|
122
|
+
cartTotal: cart?.total
|
|
122
123
|
})
|
|
123
124
|
} else {
|
|
124
125
|
const groupKeys: any = {}
|
|
@@ -68,7 +68,7 @@ export const ProductOptionSubOptionUI = (props: any) => {
|
|
|
68
68
|
|
|
69
69
|
return (
|
|
70
70
|
<View>
|
|
71
|
-
<Container>
|
|
71
|
+
<Container onPress={() => handleSuboptionClick()}>
|
|
72
72
|
<IconControl disabled={disabled} onPress={() => handleSuboptionClick()}>
|
|
73
73
|
{((option?.min === 0 && option?.max === 1) || option?.max > 1) ? (
|
|
74
74
|
state?.selected ? (
|
|
@@ -139,7 +139,7 @@ export const ProductOptionSubOptionUI = (props: any) => {
|
|
|
139
139
|
)}
|
|
140
140
|
</PositionControl>
|
|
141
141
|
{price > 0 && (
|
|
142
|
-
<OText size={12} lineHeight={18} color={theme.colors.textSecondary}>
|
|
142
|
+
<OText size={12} lineHeight={18} color={theme.colors.textSecondary} style={{ paddingRight: 10 }}>
|
|
143
143
|
+ {parsePrice(price)}
|
|
144
144
|
</OText>
|
|
145
145
|
)}
|
|
@@ -4,12 +4,12 @@ export const Container = styled.TouchableOpacity`
|
|
|
4
4
|
flex-direction: row;
|
|
5
5
|
align-items: center;
|
|
6
6
|
justify-content: space-between;
|
|
7
|
-
padding: 10px;
|
|
8
7
|
width: 100%;
|
|
9
8
|
`
|
|
10
9
|
|
|
11
10
|
export const IconControl = styled.TouchableOpacity`
|
|
12
11
|
flex-direction: row;
|
|
12
|
+
padding: 10px;
|
|
13
13
|
width: 45%;
|
|
14
14
|
align-items: center;
|
|
15
15
|
`
|
|
@@ -117,7 +117,7 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
|
|
|
117
117
|
if (upsellingProducts?.products?.length && !isFromCart) {
|
|
118
118
|
setCanOpenUpselling && setCanOpenUpselling(true)
|
|
119
119
|
} else {
|
|
120
|
-
handleUpsellingPage && handleUpsellingPage()
|
|
120
|
+
handleUpsellingPage && handleUpsellingPage(cart)
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
}
|
|
@@ -225,7 +225,7 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
|
|
|
225
225
|
style={{ ...styles.closeUpsellingButton }}
|
|
226
226
|
textStyle={{ color: theme.colors.white, fontSize: 14 }}
|
|
227
227
|
onClick={() => {
|
|
228
|
-
handleUpsellingPage()
|
|
228
|
+
handleUpsellingPage(cart)
|
|
229
229
|
setIsCheckout(true)
|
|
230
230
|
}}
|
|
231
231
|
/>
|
|
@@ -247,7 +247,7 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
|
|
|
247
247
|
<OBottomPopup
|
|
248
248
|
title={''}
|
|
249
249
|
open={openUpselling}
|
|
250
|
-
onClose={() => handleUpsellingPage()}
|
|
250
|
+
onClose={() => handleUpsellingPage(cart)}
|
|
251
251
|
isStatusBar
|
|
252
252
|
>
|
|
253
253
|
<UpsellingContent />
|
|
@@ -593,7 +593,7 @@ export interface UpsellingProductsParams {
|
|
|
593
593
|
business?: any;
|
|
594
594
|
businessId?: number;
|
|
595
595
|
cartProducts?: Array<any>;
|
|
596
|
-
handleUpsellingPage: () => void;
|
|
596
|
+
handleUpsellingPage: (cart ?: any) => void;
|
|
597
597
|
openUpselling: boolean;
|
|
598
598
|
canOpenUpselling?: boolean;
|
|
599
599
|
setCanOpenUpselling?: (value: any) => void;
|