ordering-ui-react-native 0.15.81 → 0.15.82
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/OrderDetails/Delivery.tsx +12 -5
- package/themes/business/src/types/index.tsx +2 -1
- package/themes/original/src/components/Cart/index.tsx +1 -1
- package/themes/original/src/components/Checkout/index.tsx +14 -16
- package/themes/original/src/components/Messages/index.tsx +1 -1
- package/themes/original/src/components/Promotions/index.tsx +1 -0
- package/themes/original/src/components/Promotions/styles.tsx +2 -0
package/package.json
CHANGED
|
@@ -51,7 +51,8 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
51
51
|
orderTitle,
|
|
52
52
|
appTitle,
|
|
53
53
|
handleClickLogisticOrder,
|
|
54
|
-
forceUpdate
|
|
54
|
+
forceUpdate,
|
|
55
|
+
getPermissions
|
|
55
56
|
} = props;
|
|
56
57
|
const [, { showToast }] = useToast();
|
|
57
58
|
const { order } = props.order
|
|
@@ -101,9 +102,14 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
101
102
|
};
|
|
102
103
|
|
|
103
104
|
const handleOpenMapView = async () => {
|
|
104
|
-
|
|
105
|
+
const _permissions = await getPermissions()
|
|
106
|
+
|
|
107
|
+
const isBlocked = _permissions.some((_permission: string) => permissions?.locationStatus?.[_permission] === 'blocked')
|
|
108
|
+
const isGranted = _permissions.reduce((allPermissions: boolean, _permission: string) => allPermissions && permissions?.locationStatus?.[_permission] === 'granted', true)
|
|
109
|
+
|
|
110
|
+
if (isGranted) {
|
|
105
111
|
setOpenModalForMapView(!openModalForMapView);
|
|
106
|
-
} else if (
|
|
112
|
+
} else if (isBlocked) {
|
|
107
113
|
// redirectToSettings();
|
|
108
114
|
showToast(
|
|
109
115
|
ToastType.Error,
|
|
@@ -114,8 +120,9 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
114
120
|
);
|
|
115
121
|
} else {
|
|
116
122
|
const response = await askLocationPermission();
|
|
117
|
-
|
|
118
|
-
|
|
123
|
+
const isGranted = _permissions.reduce((allPermissions: boolean, _permission: string) => allPermissions && response?.locationStatus?.[_permission] === 'granted', true)
|
|
124
|
+
if (isGranted) {
|
|
125
|
+
setOpenModalForMapView(true)
|
|
119
126
|
}
|
|
120
127
|
}
|
|
121
128
|
};
|
|
@@ -373,6 +373,7 @@ export interface OrderDetailsParams {
|
|
|
373
373
|
handleClickLogisticOrder?: (status: number, orderId: number) => void;
|
|
374
374
|
orderTitle?: any;
|
|
375
375
|
forceUpdate?: number;
|
|
376
|
+
getPermissions?: any
|
|
376
377
|
}
|
|
377
378
|
export interface ProductItemAccordionParams {
|
|
378
379
|
isCartPending?: boolean;
|
|
@@ -578,4 +579,4 @@ export interface ReviewCustomerParams {
|
|
|
578
579
|
|
|
579
580
|
export interface NoNetworkParams {
|
|
580
581
|
image?: any;
|
|
581
|
-
}
|
|
582
|
+
}
|
|
@@ -162,7 +162,7 @@ const CartUI = (props: any) => {
|
|
|
162
162
|
handleClearProducts={handleClearProducts}
|
|
163
163
|
handleCartOpen={handleCartOpen}
|
|
164
164
|
onNavigationRedirect={props.onNavigationRedirect}
|
|
165
|
-
handleChangeStore={
|
|
165
|
+
handleChangeStore={() => setOpenChangeStore(true)}
|
|
166
166
|
handleClickCheckout={() => setOpenUpselling(true)}
|
|
167
167
|
checkoutButtonDisabled={(openUpselling && !canOpenUpselling) || cart?.subtotal < cart?.minimum || !cart?.valid_address}
|
|
168
168
|
>
|
|
@@ -597,21 +597,19 @@ const CheckoutUI = (props: any) => {
|
|
|
597
597
|
</OText>
|
|
598
598
|
</TouchableOpacity>
|
|
599
599
|
</CartHeader>
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
600
|
+
<TouchableOpacity
|
|
601
|
+
onPress={() => setOpenChangeStore(true)}
|
|
602
|
+
style={{ alignSelf: 'flex-start' }}
|
|
603
|
+
>
|
|
604
|
+
<OText
|
|
605
|
+
size={12}
|
|
606
|
+
lineHeight={18}
|
|
607
|
+
color={theme.colors.textSecondary}
|
|
608
|
+
style={{ textDecorationLine: 'underline' }}
|
|
604
609
|
>
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
color={theme.colors.textSecondary}
|
|
609
|
-
style={{ textDecorationLine: 'underline' }}
|
|
610
|
-
>
|
|
611
|
-
{t('CHANGE_STORE', 'Change store')}
|
|
612
|
-
</OText>
|
|
613
|
-
</TouchableOpacity>
|
|
614
|
-
)}
|
|
610
|
+
{t('CHANGE_STORE', 'Change store')}
|
|
611
|
+
</OText>
|
|
612
|
+
</TouchableOpacity>
|
|
615
613
|
<OrderSummary
|
|
616
614
|
cart={cart}
|
|
617
615
|
isCartPending={cart?.status === 2}
|
|
@@ -664,7 +662,7 @@ const CheckoutUI = (props: any) => {
|
|
|
664
662
|
</View>
|
|
665
663
|
)}
|
|
666
664
|
<OModal
|
|
667
|
-
open={openChangeStore
|
|
665
|
+
open={openChangeStore}
|
|
668
666
|
entireModal
|
|
669
667
|
customClose
|
|
670
668
|
onClose={() => setOpenChangeStore(false)}
|
|
@@ -873,7 +871,7 @@ export const Checkout = (props: any) => {
|
|
|
873
871
|
...props,
|
|
874
872
|
UIComponent: CheckoutUI,
|
|
875
873
|
cartState,
|
|
876
|
-
|
|
874
|
+
uuid: cartUuid
|
|
877
875
|
}
|
|
878
876
|
|
|
879
877
|
return (
|
|
@@ -39,7 +39,7 @@ const ORDER_STATUS: any = {
|
|
|
39
39
|
23: 'ORDER_DRIVER_ON_WAY'
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
const filterSpecialStatus = ['prepared_in', 'delivered_in']
|
|
42
|
+
const filterSpecialStatus = ['prepared_in', 'delivered_in', 'delivery_datetime']
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
const MessagesUI = (props: MessagesParams) => {
|
|
@@ -93,6 +93,7 @@ const PromotionsUI = (props: PromotionParams) => {
|
|
|
93
93
|
titleAlign={'center'}
|
|
94
94
|
onActionLeft={() => navigation.goBack()}
|
|
95
95
|
showCall={false}
|
|
96
|
+
style={{ paddingVertical: Platform.OS === 'ios' ? 0 : 20, marginLeft: 20 }}
|
|
96
97
|
/>
|
|
97
98
|
<PromotionsContainer>
|
|
98
99
|
<SearchBarContainer>
|