ordering-ui-react-native 0.17.89 → 0.17.90-release
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 +8 -7
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessInformation/index.tsx +10 -9
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/OrderCreating/index.tsx +1 -21
- package/src/components/PaymentOptionsWebView/index.tsx +29 -8
- package/src/components/PhoneInputNumber/index.tsx +6 -2
- package/src/components/StripeMethodForm/index.tsx +136 -102
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +3 -2
- package/src/types/index.tsx +5 -0
- package/src/utils/index.tsx +5 -0
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +37 -27
- package/themes/business/src/components/BusinessController/index.tsx +0 -1
- package/themes/business/src/components/Chat/index.tsx +163 -123
- package/themes/business/src/components/DriverMap/index.tsx +17 -6
- package/themes/business/src/components/DriverSchedule/index.tsx +45 -8
- package/themes/business/src/components/FloatingButton/index.tsx +34 -31
- package/themes/business/src/components/GoogleMap/index.tsx +58 -57
- package/themes/business/src/components/LoginForm/Otp/index.tsx +31 -3
- package/themes/business/src/components/LoginForm/index.tsx +15 -22
- package/themes/business/src/components/MapView/index.tsx +14 -10
- package/themes/business/src/components/MessagesOption/index.tsx +20 -93
- package/themes/business/src/components/NewOrderNotification/index.tsx +123 -96
- package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
- package/themes/business/src/components/OrderDetails/Delivery.tsx +202 -12
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +84 -37
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +81 -66
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +200 -0
- package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
- package/themes/business/src/components/OrderMessage/index.tsx +19 -18
- package/themes/business/src/components/OrderSummary/index.tsx +114 -123
- package/themes/business/src/components/OrdersOption/index.tsx +22 -22
- package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
- package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +17 -12
- package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
- package/themes/business/src/components/PreviousOrders/index.tsx +198 -221
- package/themes/business/src/components/ProductItemAccordion/index.tsx +7 -1
- package/themes/business/src/components/ReviewCustomer/index.tsx +18 -13
- package/themes/business/src/components/StoresList/index.tsx +3 -4
- package/themes/business/src/components/UserProfileForm/index.tsx +14 -15
- package/themes/business/src/components/shared/OModal.tsx +16 -9
- package/themes/business/src/types/index.tsx +25 -10
- package/themes/business/src/utils/index.tsx +29 -2
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/Intro/index.tsx +16 -1
- package/themes/kiosk/src/components/LoginForm/index.tsx +7 -9
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
- package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +2 -2
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/original/index.tsx +1 -1
- package/themes/original/src/components/AddressDetails/index.tsx +19 -3
- package/themes/original/src/components/AddressForm/index.tsx +35 -17
- package/themes/original/src/components/AddressList/index.tsx +5 -8
- package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +73 -37
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +10 -12
- package/themes/original/src/components/BusinessController/index.tsx +35 -44
- package/themes/original/src/components/BusinessController/styles.tsx +12 -5
- package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
- package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
- package/themes/original/src/components/BusinessInformation/index.tsx +140 -85
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +15 -20
- package/themes/original/src/components/BusinessListingSearch/index.tsx +347 -336
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +0 -18
- package/themes/original/src/components/BusinessPreorder/index.tsx +103 -19
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -2
- package/themes/original/src/components/BusinessProductsList/index.tsx +15 -7
- package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
- package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
- package/themes/original/src/components/BusinessProductsListing/index.tsx +663 -556
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -3
- package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +38 -405
- package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
- package/themes/original/src/components/Cart/index.tsx +60 -51
- package/themes/original/src/components/CartContent/index.tsx +102 -58
- package/themes/original/src/components/CartContent/styles.tsx +6 -6
- package/themes/original/src/components/Checkout/index.tsx +280 -35
- package/themes/original/src/components/CitiesControl/index.tsx +1 -1
- package/themes/original/src/components/CouponControl/index.tsx +10 -3
- package/themes/original/src/components/DriverTips/index.tsx +52 -34
- package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
- package/themes/original/src/components/Favorite/index.tsx +1 -5
- package/themes/original/src/components/GPSButton/index.tsx +6 -4
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +42 -5
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +2 -0
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +86 -10
- package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
- package/themes/original/src/components/GoogleMap/index.tsx +63 -7
- package/themes/original/src/components/Home/index.tsx +13 -4
- package/themes/original/src/components/LastOrder/index.tsx +2 -1
- package/themes/original/src/components/LastOrders/index.tsx +2 -1
- package/themes/original/src/components/LoginForm/Otp/index.tsx +91 -25
- package/themes/original/src/components/LoginForm/index.tsx +64 -34
- package/themes/original/src/components/LottieAnimation/index.tsx +88 -63
- package/themes/original/src/components/MessageListing/index.tsx +9 -2
- package/themes/original/src/components/Messages/index.tsx +15 -4
- package/themes/original/src/components/MomentOption/index.tsx +193 -92
- package/themes/original/src/components/MomentSelector/index.tsx +1 -1
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +162 -50
- package/themes/original/src/components/MultiCheckout/index.tsx +385 -46
- package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +23 -19
- package/themes/original/src/components/MyOrders/index.tsx +25 -16
- package/themes/original/src/components/NavBar/index.tsx +20 -13
- package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +21 -5
- package/themes/original/src/components/OrderDetails/index.tsx +50 -38
- package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
- package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
- package/themes/original/src/components/OrderProgress/index.tsx +34 -25
- package/themes/original/src/components/OrderSummary/index.tsx +83 -57
- package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -6
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +14 -14
- package/themes/original/src/components/OrdersOption/index.tsx +59 -48
- package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
- package/themes/original/src/components/PageBanner/index.tsx +65 -29
- package/themes/original/src/components/PageBanner/styles.tsx +0 -3
- package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +100 -34
- package/themes/original/src/components/PhoneInputNumber/index.tsx +18 -4
- package/themes/original/src/components/ProductForm/index.tsx +87 -31
- package/themes/original/src/components/ProductForm/styles.tsx +3 -3
- package/themes/original/src/components/ProductItemAccordion/index.tsx +8 -6
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +49 -20
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +10 -9
- package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
- package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
- package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
- package/themes/original/src/components/Promotions/index.tsx +2 -2
- package/themes/original/src/components/Promotions/styles.tsx +3 -1
- package/themes/original/src/components/ReviewProducts/index.tsx +16 -7
- package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
- package/themes/original/src/components/ServiceForm/index.tsx +63 -20
- package/themes/original/src/components/Sessions/styles.tsx +1 -0
- package/themes/original/src/components/SignupForm/index.tsx +43 -27
- package/themes/original/src/components/SingleOrderCard/index.tsx +42 -19
- package/themes/original/src/components/SingleOrderCard/styles.tsx +1 -1
- package/themes/original/src/components/SingleProductCard/index.tsx +14 -11
- package/themes/original/src/components/SingleProductCard/styles.tsx +8 -3
- package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
- package/themes/original/src/components/StripeCardsList/index.tsx +61 -5
- package/themes/original/src/components/StripeElementsForm/index.tsx +48 -34
- package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
- package/themes/original/src/components/UpsellingProducts/index.tsx +5 -10
- package/themes/original/src/components/UserDetails/index.tsx +3 -1
- package/themes/original/src/components/UserFormDetails/index.tsx +78 -9
- package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
- package/themes/original/src/components/UserProfile/index.tsx +8 -26
- package/themes/original/src/components/UserProfileForm/index.tsx +30 -31
- package/themes/original/src/components/UserVerification/index.tsx +55 -50
- package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
- package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
- package/themes/original/src/components/Wallets/index.tsx +52 -62
- package/themes/original/src/components/Wallets/styles.tsx +2 -4
- package/themes/original/src/components/shared/OButton.tsx +3 -3
- package/themes/original/src/components/shared/OInput.tsx +4 -5
- package/themes/original/src/components/shared/OModal.tsx +3 -3
- package/themes/original/src/types/index.tsx +37 -10
- package/themes/original/src/utils/index.tsx +185 -13
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
- package/src/navigators/BottomNavigator.tsx +0 -117
- package/src/navigators/CheckoutNavigator.tsx +0 -66
- package/src/navigators/HomeNavigator.tsx +0 -202
- package/src/navigators/NavigationRef.tsx +0 -7
- package/src/navigators/RootNavigator.tsx +0 -269
- package/src/pages/Account.tsx +0 -34
- package/src/pages/AddressForm.tsx +0 -62
- package/src/pages/AddressList.tsx +0 -24
- package/src/pages/BusinessProductsList.tsx +0 -81
- package/src/pages/BusinessesListing.tsx +0 -43
- package/src/pages/CartList.tsx +0 -49
- package/src/pages/Checkout.tsx +0 -101
- package/src/pages/ForgotPassword.tsx +0 -24
- package/src/pages/Help.tsx +0 -23
- package/src/pages/HelpAccountAndPayment.tsx +0 -23
- package/src/pages/HelpGuide.tsx +0 -23
- package/src/pages/HelpOrder.tsx +0 -23
- package/src/pages/Home.tsx +0 -36
- package/src/pages/IntroductoryTutorial.tsx +0 -170
- package/src/pages/Login.tsx +0 -47
- package/src/pages/MomentOption.tsx +0 -30
- package/src/pages/MultiCheckout.tsx +0 -31
- package/src/pages/MultiOrdersDetails.tsx +0 -27
- package/src/pages/MyOrders.tsx +0 -40
- package/src/pages/NetworkError.tsx +0 -24
- package/src/pages/NotFound.tsx +0 -22
- package/src/pages/OrderDetails.tsx +0 -25
- package/src/pages/ProductDetails.tsx +0 -55
- package/src/pages/Profile.tsx +0 -36
- package/src/pages/ReviewDriver.tsx +0 -30
- package/src/pages/ReviewOrder.tsx +0 -32
- package/src/pages/ReviewProducts.tsx +0 -30
- package/src/pages/Sessions.tsx +0 -22
- package/src/pages/Signup.tsx +0 -53
- package/src/pages/SpinnerLoader.tsx +0 -10
- package/src/pages/Splash.tsx +0 -21
|
@@ -23,7 +23,7 @@ import { useTheme } from 'styled-components/native';
|
|
|
23
23
|
|
|
24
24
|
import { ProductItemAccordion } from '../ProductItemAccordion';
|
|
25
25
|
|
|
26
|
-
export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
26
|
+
export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermission, getPermissions, isGrantedPermissions, checkBluetoothPermission }: any) => {
|
|
27
27
|
const handleArrowBack: any = () => {
|
|
28
28
|
navigation?.canGoBack() && navigation.goBack();
|
|
29
29
|
};
|
|
@@ -48,10 +48,10 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
48
48
|
const getSuboptions = (suboptions: any) => {
|
|
49
49
|
const array: any = []
|
|
50
50
|
suboptions?.length > 0 &&
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
suboptions?.map((suboption: any) => {
|
|
52
|
+
const string = ` ${getFormattedSubOptionName(suboption)}<br/>`
|
|
53
|
+
array.push(string)
|
|
54
|
+
})
|
|
55
55
|
|
|
56
56
|
return array.join('')
|
|
57
57
|
}
|
|
@@ -60,12 +60,12 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
60
60
|
const array: any = [];
|
|
61
61
|
|
|
62
62
|
options?.length &&
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
options?.map((option: any) => {
|
|
64
|
+
const string =
|
|
65
|
+
` ${option.name}<br/>${getSuboptions(option.suboptions)}`;
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
array.push(string)
|
|
68
|
+
})
|
|
69
69
|
|
|
70
70
|
if (productComment) {
|
|
71
71
|
array.push(`${t('COMMENT', 'Comment')}<br/> ${productComment}`)
|
|
@@ -80,6 +80,9 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
80
80
|
!parseInt(configs?.driver_tip_use_custom?.value, 10) &&
|
|
81
81
|
verifyDecimals(order?.summary?.driver_tip, parseNumber);
|
|
82
82
|
|
|
83
|
+
const customerName = `${order?.customer?.name ?? ''} ${order?.customer?.middle_name ?? ''} ${order?.customer?.lastname ?? ''} ${order?.customer?.second_lastname ?? ''
|
|
84
|
+
}`?.replace(' ', ' ')?.trim() ?? ''
|
|
85
|
+
|
|
83
86
|
const orderSummary = () => {
|
|
84
87
|
return `
|
|
85
88
|
<div>
|
|
@@ -88,46 +91,36 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
88
91
|
|
|
89
92
|
${orderStatus} </br>
|
|
90
93
|
|
|
91
|
-
${t('DELIVERY_TYPE', 'Delivery Type')}: ${
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
+
${t('DELIVERY_TYPE', 'Delivery Type')}: ${deliveryStatus[order?.delivery_type]
|
|
95
|
+
}
|
|
94
96
|
</br>
|
|
95
|
-
${t('DELIVERY_DATE', 'Delivery Date')}: ${
|
|
96
|
-
order?.delivery_datetime_utc
|
|
97
|
+
${t('DELIVERY_DATE', 'Delivery Date')}: ${order?.delivery_datetime_utc
|
|
97
98
|
? parseDate(order?.delivery_datetime_utc)
|
|
98
99
|
: parseDate(order?.delivery_datetime, { utc: false })
|
|
99
|
-
|
|
100
|
+
}
|
|
100
101
|
</br>
|
|
101
102
|
${t('PAYMENT_METHOD')}: ${order?.paymethod?.name}
|
|
102
103
|
</p>
|
|
103
104
|
|
|
104
105
|
<h1>${t('CUSTOMER_DETAILS', 'Customer details')}</h1>
|
|
105
|
-
<p style="font-size: 27px"> ${t('FULL_NAME', 'Full Name')}: ${
|
|
106
|
-
order?.customer?.name
|
|
107
|
-
} ${order?.customer?.middle_name} ${order?.customer?.lastname} ${
|
|
108
|
-
order?.customer?.second_lastname
|
|
109
|
-
}
|
|
106
|
+
<p style="font-size: 27px"> ${t('FULL_NAME', 'Full Name')}: ${customerName}
|
|
110
107
|
</br>
|
|
111
108
|
${t('EMAIL', 'Email')}: ${order?.customer?.email}
|
|
112
109
|
</br>
|
|
113
110
|
${t('MOBILE_PHONE', 'Mobile Phone')}: ${order?.customer?.cellphone}
|
|
114
111
|
</br>
|
|
115
|
-
${
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
: ''
|
|
121
|
-
}
|
|
112
|
+
${!!order?.customer?.phone
|
|
113
|
+
? `${t('MOBILE_PHONE', 'Mobile Phone')}: ${order?.customer?.phone
|
|
114
|
+
} </br>`
|
|
115
|
+
: ''
|
|
116
|
+
}
|
|
122
117
|
${t('FULL_ADDRESS', 'Full Addres')}: ${order?.customer?.address}
|
|
123
118
|
</br>
|
|
124
|
-
${
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
: ''
|
|
130
|
-
}
|
|
119
|
+
${!!order?.customer?.internal_number
|
|
120
|
+
? `${t('INTERNAL_NUMBER', 'Internal Number')}: ${order?.customer?.internal_number
|
|
121
|
+
} </br>`
|
|
122
|
+
: ''
|
|
123
|
+
}
|
|
131
124
|
${t('ZIPCODE', 'Zipcode')}: ${order?.customer.zipcode}
|
|
132
125
|
</p>
|
|
133
126
|
|
|
@@ -139,30 +132,26 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
139
132
|
</br>
|
|
140
133
|
${t('BUSINESS_PHONE', 'Business Phone')}: ${order?.business?.cellphone}
|
|
141
134
|
</br>
|
|
142
|
-
${
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
: ''
|
|
148
|
-
}
|
|
135
|
+
${!!order?.business?.phone
|
|
136
|
+
? `${t('BUSINESS_PHONE', 'Business Phone')}: ${order?.business?.phone
|
|
137
|
+
} </br>`
|
|
138
|
+
: ''
|
|
139
|
+
}
|
|
149
140
|
|
|
150
141
|
${t('ADDRESS', 'Address')}: ${order?.business?.address}
|
|
151
142
|
</br>
|
|
152
|
-
${
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
: ''
|
|
158
|
-
}
|
|
143
|
+
${!!order?.business?.address_notes
|
|
144
|
+
? `${t('SPECIAL_ADDRESS', 'Special Address')}: ${order?.business?.address_notes
|
|
145
|
+
} `
|
|
146
|
+
: ''
|
|
147
|
+
}
|
|
159
148
|
</p>
|
|
160
149
|
<h1> ${t('ORDER_DETAILS', 'Order Details')}</h1>
|
|
161
150
|
|
|
162
151
|
${order?.products.length &&
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
152
|
+
order?.products.map(
|
|
153
|
+
(product: any, i: number) =>
|
|
154
|
+
`<div style="display: flex;flexDirection:row;flex-wrap:wrap">
|
|
166
155
|
<div style="display:flex;width:100%">
|
|
167
156
|
<div style="display:flex; justify-content: flex-start; font-size: 26px; width: 70%">
|
|
168
157
|
${product?.quantity} ${product?.name}
|
|
@@ -179,8 +168,8 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
179
168
|
</div>
|
|
180
169
|
</div>
|
|
181
170
|
</div>`
|
|
182
|
-
|
|
183
|
-
|
|
171
|
+
)
|
|
172
|
+
}
|
|
184
173
|
<div style="display: flex;">
|
|
185
174
|
|
|
186
175
|
<div style="display:flex; justify-content: flex-start; font-size: 26px; width: 70%">
|
|
@@ -189,62 +178,58 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
189
178
|
|
|
190
179
|
<div style="display:flex; justify-content: flex-end; font-size: 26px; width: 30%">
|
|
191
180
|
${parsePrice(
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
181
|
+
order.tax_type === 1
|
|
182
|
+
? order?.summary?.subtotal + order?.summary?.tax ?? 0
|
|
183
|
+
: order?.summary?.subtotal ?? 0,
|
|
184
|
+
)}
|
|
196
185
|
</div>
|
|
197
186
|
|
|
198
187
|
</div>
|
|
199
188
|
|
|
200
189
|
<div style="display: flex">
|
|
201
|
-
${
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
? `<div style="display:flex; justify-content: flex-start; font-size: 26px; width: 70%">
|
|
190
|
+
${order?.summary?.discount > 0
|
|
191
|
+
? order?.offer_type === 1
|
|
192
|
+
? `<div style="display:flex; justify-content: flex-start; font-size: 26px; width: 70%">
|
|
205
193
|
${t('DISCOUNT', 'Discount')} (${verifyDecimals(
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
194
|
+
order?.offer_rate,
|
|
195
|
+
parsePrice,
|
|
196
|
+
)}%)
|
|
209
197
|
</div>`
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
198
|
+
: `<div style="display:flex; justify-content: flex-start; font-size: 26px; width: 70%"> ${t(
|
|
199
|
+
'DISCOUNT',
|
|
200
|
+
'Discount',
|
|
201
|
+
)}
|
|
214
202
|
</div>`
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
${
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
)}
|
|
203
|
+
: ''
|
|
204
|
+
}
|
|
205
|
+
${order?.summary?.discount > 0
|
|
206
|
+
? `<div style="display:flex; justify-content: flex-end; font-size: 26px; width: 30%">- ${parsePrice(
|
|
207
|
+
order?.summary?.discount,
|
|
208
|
+
)}
|
|
222
209
|
</div>`
|
|
223
|
-
|
|
224
|
-
|
|
210
|
+
: ''
|
|
211
|
+
}
|
|
225
212
|
</div>
|
|
226
213
|
|
|
227
|
-
${
|
|
228
|
-
|
|
229
|
-
? `<div style="font-size: 25px">
|
|
214
|
+
${order?.tax_type !== 1
|
|
215
|
+
? `<div style="font-size: 25px">
|
|
230
216
|
${t('TAX', 'Tax')}
|
|
231
217
|
${verifyDecimals(order?.summary?.tax_rate, parseNumber)}%
|
|
232
218
|
${parsePrice(order?.summary?.tax ?? 0)}
|
|
233
219
|
${t('TAX', 'Tax')}
|
|
234
220
|
${verifyDecimals(order?.summary?.tax_rate, parseNumber)}%
|
|
235
221
|
</div>`
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
${
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
)}
|
|
222
|
+
: ''
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
${order?.summary?.delivery_price > 0
|
|
226
|
+
? `<div style="font-size: 25px;"> ${t(
|
|
227
|
+
'DELIVERY_FEE',
|
|
228
|
+
'Delivery Fee',
|
|
229
|
+
)}
|
|
245
230
|
</div>`
|
|
246
|
-
|
|
247
|
-
|
|
231
|
+
: ''
|
|
232
|
+
}
|
|
248
233
|
|
|
249
234
|
<div style="display: flex">
|
|
250
235
|
|
|
@@ -336,6 +321,25 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
336
321
|
},
|
|
337
322
|
});
|
|
338
323
|
|
|
324
|
+
const handlePrint = async () => {
|
|
325
|
+
if (Platform.OS === 'ios') {
|
|
326
|
+
silentPrint()
|
|
327
|
+
return
|
|
328
|
+
}
|
|
329
|
+
const _permissions = await getPermissions()
|
|
330
|
+
|
|
331
|
+
if (!isGrantedPermissions) {
|
|
332
|
+
checkBluetoothPermission()
|
|
333
|
+
}
|
|
334
|
+
if (isGrantedPermissions) {
|
|
335
|
+
const response = await askBluetoothPermission();
|
|
336
|
+
const isGranted = _permissions.reduce((allPermissions: boolean, _permission: string) => allPermissions && response?.[_permission] === 'granted', true)
|
|
337
|
+
if (isGranted) {
|
|
338
|
+
printPDF()
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
|
|
339
343
|
return (
|
|
340
344
|
<>
|
|
341
345
|
<Content>
|
|
@@ -364,17 +368,15 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
364
368
|
</OText>
|
|
365
369
|
|
|
366
370
|
<OText style={{ marginBottom: 5 }}>
|
|
367
|
-
{`${t('DELIVERY_TYPE', 'Delivery Type')}: ${
|
|
368
|
-
|
|
369
|
-
}`}
|
|
371
|
+
{`${t('DELIVERY_TYPE', 'Delivery Type')}: ${deliveryStatus[order?.delivery_type]
|
|
372
|
+
}`}
|
|
370
373
|
</OText>
|
|
371
374
|
|
|
372
375
|
<OText style={{ marginBottom: 5 }}>
|
|
373
|
-
{`${t('DELIVERY_DATE', 'Delivery Date')}: ${
|
|
374
|
-
order?.delivery_datetime_utc
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
}`}
|
|
376
|
+
{`${t('DELIVERY_DATE', 'Delivery Date')}: ${order?.delivery_datetime_utc
|
|
377
|
+
? parseDate(order?.delivery_datetime_utc)
|
|
378
|
+
: parseDate(order?.delivery_datetime, { utc: false })
|
|
379
|
+
}`}
|
|
378
380
|
</OText>
|
|
379
381
|
|
|
380
382
|
<OText style={{ marginBottom: 5 }}>{`${t('PAYMENT_METHOD')}: ${t(
|
|
@@ -399,11 +401,7 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
399
401
|
adjustsFontSizeToFit
|
|
400
402
|
ellipsizeMode="tail"
|
|
401
403
|
color={theme.colors.textGray}>
|
|
402
|
-
{`${t('FULL_NAME', 'Full Name')}: ${
|
|
403
|
-
order?.customer?.middle_name
|
|
404
|
-
} ${order?.customer?.lastname} ${
|
|
405
|
-
order?.customer?.second_lastname
|
|
406
|
-
}`}
|
|
404
|
+
{`${t('FULL_NAME', 'Full Name')}: ${customerName}`}
|
|
407
405
|
</OText>
|
|
408
406
|
|
|
409
407
|
<OText
|
|
@@ -423,9 +421,8 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
423
421
|
adjustsFontSizeToFit
|
|
424
422
|
ellipsizeMode="tail"
|
|
425
423
|
color={theme.colors.textGray}>
|
|
426
|
-
{`${t('MOBILE_PHONE', 'Mobile Phone')}: ${
|
|
427
|
-
|
|
428
|
-
}`}
|
|
424
|
+
{`${t('MOBILE_PHONE', 'Mobile Phone')}: ${order?.customer?.cellphone
|
|
425
|
+
}`}
|
|
429
426
|
</OText>
|
|
430
427
|
|
|
431
428
|
{!!order?.customer?.phone && (
|
|
@@ -436,9 +433,8 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
436
433
|
adjustsFontSizeToFit
|
|
437
434
|
ellipsizeMode="tail"
|
|
438
435
|
color={theme.colors.textGray}>
|
|
439
|
-
{`${t('MOBILE_PHONE', 'Mobile Phone')}: ${
|
|
440
|
-
|
|
441
|
-
}`}
|
|
436
|
+
{`${t('MOBILE_PHONE', 'Mobile Phone')}: ${order?.customer?.phone
|
|
437
|
+
}`}
|
|
442
438
|
</OText>
|
|
443
439
|
)}
|
|
444
440
|
|
|
@@ -508,9 +504,8 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
508
504
|
numberOfLines={2}
|
|
509
505
|
ellipsizeMode="tail"
|
|
510
506
|
color={theme.colors.textGray}>
|
|
511
|
-
{`${t('BUSINESS_PHONE', 'Business Phone')}: ${
|
|
512
|
-
|
|
513
|
-
}`}
|
|
507
|
+
{`${t('BUSINESS_PHONE', 'Business Phone')}: ${order?.business?.cellphone
|
|
508
|
+
}`}
|
|
514
509
|
</OText>
|
|
515
510
|
)}
|
|
516
511
|
|
|
@@ -521,9 +516,8 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
521
516
|
numberOfLines={2}
|
|
522
517
|
ellipsizeMode="tail"
|
|
523
518
|
color={theme.colors.textGray}>
|
|
524
|
-
{`${t('BUSINESS_PHONE', 'Business Phone')}: ${
|
|
525
|
-
|
|
526
|
-
}`}
|
|
519
|
+
{`${t('BUSINESS_PHONE', 'Business Phone')}: ${order?.business?.phone
|
|
520
|
+
}`}
|
|
527
521
|
</OText>
|
|
528
522
|
)}
|
|
529
523
|
|
|
@@ -545,9 +539,8 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
545
539
|
adjustsFontSizeToFit
|
|
546
540
|
ellipsizeMode="tail"
|
|
547
541
|
color={theme.colors.textGray}>
|
|
548
|
-
{`${t('SPECIAL_ADDRESS', 'Special Address')}: ${
|
|
549
|
-
|
|
550
|
-
}`}
|
|
542
|
+
{`${t('SPECIAL_ADDRESS', 'Special Address')}: ${order?.business?.address_notes
|
|
543
|
+
}`}
|
|
551
544
|
</OText>
|
|
552
545
|
)}
|
|
553
546
|
</OrderBusiness>
|
|
@@ -686,9 +679,7 @@ export const OrderSummary = ({ order, navigation, orderStatus }: any) => {
|
|
|
686
679
|
|
|
687
680
|
<View style={{ marginBottom: 0 }}>
|
|
688
681
|
<FloatingButton
|
|
689
|
-
firstButtonClick={() =>
|
|
690
|
-
Platform.OS === 'ios' ? silentPrint() : printPDF()
|
|
691
|
-
}
|
|
682
|
+
firstButtonClick={() => handlePrint()}
|
|
692
683
|
btnText={t('PRINT', 'Print')}
|
|
693
684
|
color={theme.colors.green}
|
|
694
685
|
widthButton={'100%'}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import React, { useEffect, useState, useRef } from 'react';
|
|
2
|
-
import { View, Pressable, StyleSheet, ScrollView, RefreshControl, Platform } from 'react-native';
|
|
2
|
+
import { View, Pressable, StyleSheet, ScrollView, RefreshControl, Platform, TouchableOpacity } from 'react-native';
|
|
3
3
|
import { useLanguage, useUtils, useToast, OrderListGroups, useConfig } from 'ordering-components/native';
|
|
4
4
|
import SelectDropdown from 'react-native-select-dropdown'
|
|
5
5
|
import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
|
|
6
6
|
import FeatherIcon from 'react-native-vector-icons/Feather';
|
|
7
7
|
import FontistoIcon from 'react-native-vector-icons/Fontisto'
|
|
8
8
|
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
9
|
+
|
|
9
10
|
import { useTheme } from 'styled-components/native';
|
|
10
11
|
import { DeviceOrientationMethods } from '../../../../../src/hooks/DeviceOrientation'
|
|
11
12
|
import { NotificationSetting } from '../../../../../src/components/NotificationSetting'
|
|
12
13
|
import { NewOrderNotification } from '../NewOrderNotification';
|
|
13
14
|
|
|
14
|
-
import { OText, OButton, OModal,
|
|
15
|
+
import { OText, OButton, OModal, OInput, OIcon } from '../shared';
|
|
15
16
|
import { NotFoundSource } from '../NotFoundSource';
|
|
16
17
|
import {
|
|
17
18
|
FiltersTab,
|
|
@@ -92,17 +93,14 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
92
93
|
const [{ parseDate }] = useUtils()
|
|
93
94
|
const [configState] = useConfig()
|
|
94
95
|
const [orientationState] = useDeviceOrientation();
|
|
95
|
-
const [, { showToast }] = useToast();
|
|
96
96
|
const [openSearchModal, setOpenSearchModal] = useState(false)
|
|
97
97
|
const [openSLASettingModal, setOpenSLASettingModal] = useState(false)
|
|
98
98
|
const [slaSettingTime, setSlaSettingTime] = useState(6000)
|
|
99
99
|
const [currentDeliveryType, setCurrentDeliveryType] = useState('Delivery')
|
|
100
100
|
const [search, setSearch] = useState(defaultSearchList)
|
|
101
101
|
const [selectedTabStatus, setSelectedTabStatus] = useState<any>([])
|
|
102
|
-
const [hour, setHour] = useState(0)
|
|
103
|
-
const [minute, setMinute] = useState(0)
|
|
104
102
|
const [openedSelect, setOpenedSelect] = useState('')
|
|
105
|
-
|
|
103
|
+
|
|
106
104
|
const HEIGHT_SCREEN = orientationState?.dimensions?.height
|
|
107
105
|
const IS_PORTRAIT = orientationState.orientation === PORTRAIT
|
|
108
106
|
|
|
@@ -239,6 +237,19 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
239
237
|
overflow: 'hidden',
|
|
240
238
|
minHeight: 155
|
|
241
239
|
},
|
|
240
|
+
btnBackArrow: {
|
|
241
|
+
borderWidth: 0,
|
|
242
|
+
width: 32,
|
|
243
|
+
height: 32,
|
|
244
|
+
tintColor: theme.colors.textGray,
|
|
245
|
+
backgroundColor: theme.colors.clear,
|
|
246
|
+
borderColor: theme.colors.clear,
|
|
247
|
+
shadowColor: theme.colors.clear,
|
|
248
|
+
paddingLeft: 0,
|
|
249
|
+
paddingRight: 0,
|
|
250
|
+
marginBottom: 30,
|
|
251
|
+
marginTop: 30
|
|
252
|
+
},
|
|
242
253
|
rowStyle: {
|
|
243
254
|
display: 'flex',
|
|
244
255
|
borderBottomWidth: 0,
|
|
@@ -597,6 +608,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
597
608
|
orderTitle={props.orderDetailsProps?.orderTitle}
|
|
598
609
|
handleChangeOrderStatus={handleChangeOrderStatus}
|
|
599
610
|
handleSendCustomerReview={handleSendCustomerReview}
|
|
611
|
+
isBusinessApp={isBusinessApp}
|
|
600
612
|
/>
|
|
601
613
|
)}
|
|
602
614
|
{!logisticOrders?.error?.length &&
|
|
@@ -607,6 +619,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
607
619
|
onNavigationRedirect={onNavigationRedirect}
|
|
608
620
|
getOrderStatus={getOrderStatus}
|
|
609
621
|
handleClickLogisticOrder={handleClickLogisticOrder}
|
|
622
|
+
isBusinessApp={isBusinessApp}
|
|
610
623
|
isLogisticOrder
|
|
611
624
|
/>
|
|
612
625
|
)
|
|
@@ -696,20 +709,9 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
696
709
|
<ModalContainer
|
|
697
710
|
nestedScrollEnabled={true}
|
|
698
711
|
>
|
|
699
|
-
<
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
iconColor={theme.colors.backArrow}
|
|
703
|
-
iconStyle={{ width: 20, height: 13 }}
|
|
704
|
-
style={{
|
|
705
|
-
maxWidth: 40,
|
|
706
|
-
height: 35,
|
|
707
|
-
justifyContent: 'flex-end',
|
|
708
|
-
marginBottom: 30,
|
|
709
|
-
marginTop: 30
|
|
710
|
-
}}
|
|
711
|
-
onClick={() => handleClose()}
|
|
712
|
-
/>
|
|
712
|
+
<TouchableOpacity onPress={() => handleClose()} style={styles.btnBackArrow}>
|
|
713
|
+
<OIcon src={theme.images.general.arrow_left} color={theme.colors.textGray} />
|
|
714
|
+
</TouchableOpacity>
|
|
713
715
|
{openSearchModal && (
|
|
714
716
|
<SearchModalContent>
|
|
715
717
|
<ModalTitle>{t('SEARCH_ORDERS', 'Search orders')}</ModalTitle>
|
|
@@ -924,8 +926,6 @@ export const Timer = () => {
|
|
|
924
926
|
|
|
925
927
|
export const OrdersOption = (props: OrdersOptionParams) => {
|
|
926
928
|
const [, t] = useLanguage();
|
|
927
|
-
const [configState] = useConfig()
|
|
928
|
-
const theme = useTheme()
|
|
929
929
|
const [checkNotificationStatus, setCheckNotificationStatus] = useState({ open: false, checked: false })
|
|
930
930
|
const ordersProps = {
|
|
931
931
|
...props,
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { Dimensions, View, StyleSheet } from 'react-native'
|
|
3
|
+
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder'
|
|
4
|
+
import { OButton } from '../shared'
|
|
5
|
+
import { useTheme } from 'styled-components/native'
|
|
6
|
+
import { useLanguage } from 'ordering-components/native'
|
|
7
|
+
|
|
8
|
+
export const FooterComponent = (props : any) => {
|
|
9
|
+
const {
|
|
10
|
+
loading,
|
|
11
|
+
reload,
|
|
12
|
+
pagination,
|
|
13
|
+
tabsFilter,
|
|
14
|
+
tabs,
|
|
15
|
+
loadMore
|
|
16
|
+
} = props
|
|
17
|
+
|
|
18
|
+
const theme = useTheme()
|
|
19
|
+
const [, t] = useLanguage()
|
|
20
|
+
|
|
21
|
+
const [orientation, setOrientation] = useState(
|
|
22
|
+
Dimensions.get('window').width < Dimensions.get('window').height
|
|
23
|
+
? 'Portrait'
|
|
24
|
+
: 'Landscape',
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
Dimensions.addEventListener('change', ({ window: { width, height } }) => {
|
|
28
|
+
if (width < height) {
|
|
29
|
+
setOrientation('Portrait');
|
|
30
|
+
} else {
|
|
31
|
+
setOrientation('Landscape');
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const styles = StyleSheet.create({
|
|
36
|
+
loadButton: {
|
|
37
|
+
borderRadius: 7.6,
|
|
38
|
+
height: 44,
|
|
39
|
+
marginRight: 10,
|
|
40
|
+
marginBottom: 10,
|
|
41
|
+
marginTop: 5,
|
|
42
|
+
},
|
|
43
|
+
loadButtonText: {
|
|
44
|
+
color: theme.colors.white,
|
|
45
|
+
fontFamily: 'Poppins',
|
|
46
|
+
fontStyle: 'normal',
|
|
47
|
+
fontWeight: 'normal',
|
|
48
|
+
fontSize: 18,
|
|
49
|
+
},
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<>
|
|
54
|
+
{(loading || reload) && (
|
|
55
|
+
<>
|
|
56
|
+
<View>
|
|
57
|
+
{[...Array(5)].map((item, i) => (
|
|
58
|
+
<Placeholder key={i} Animation={Fade}>
|
|
59
|
+
<View
|
|
60
|
+
style={{
|
|
61
|
+
width: '100%',
|
|
62
|
+
flexDirection: 'row',
|
|
63
|
+
marginBottom: 10,
|
|
64
|
+
}}>
|
|
65
|
+
<PlaceholderLine
|
|
66
|
+
width={orientation === 'Portrait' ? 22 : 11}
|
|
67
|
+
height={74}
|
|
68
|
+
style={{
|
|
69
|
+
marginRight: 20,
|
|
70
|
+
marginBottom: 20,
|
|
71
|
+
borderRadius: 7.6,
|
|
72
|
+
}}
|
|
73
|
+
/>
|
|
74
|
+
<Placeholder>
|
|
75
|
+
<PlaceholderLine width={30} style={{ marginTop: 5 }} />
|
|
76
|
+
<PlaceholderLine width={50} />
|
|
77
|
+
<PlaceholderLine width={20} />
|
|
78
|
+
</Placeholder>
|
|
79
|
+
</View>
|
|
80
|
+
</Placeholder>
|
|
81
|
+
))}
|
|
82
|
+
</View>
|
|
83
|
+
</>
|
|
84
|
+
)}
|
|
85
|
+
|
|
86
|
+
{pagination?.totalPages &&
|
|
87
|
+
!loading &&
|
|
88
|
+
!reload &&
|
|
89
|
+
JSON.stringify(tabsFilter) === JSON.stringify(tabs[0].tags) &&
|
|
90
|
+
pagination?.currentPage < pagination?.totalPages && (
|
|
91
|
+
<OButton
|
|
92
|
+
onClick={() => loadMore && loadMore()}
|
|
93
|
+
text={t('LOAD_MORE_ORDERS', 'Load more orders')}
|
|
94
|
+
imgRightSrc={null}
|
|
95
|
+
textStyle={styles.loadButtonText}
|
|
96
|
+
style={styles.loadButton}
|
|
97
|
+
bgColor={theme.colors.primary}
|
|
98
|
+
borderColor={theme.colors.primary}
|
|
99
|
+
/>
|
|
100
|
+
)}
|
|
101
|
+
</>
|
|
102
|
+
)
|
|
103
|
+
}
|