ordering-ui-react-native 0.17.64 → 0.17.65-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.
Files changed (207) hide show
  1. package/package.json +8 -7
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessesListing/index.tsx +1 -1
  4. package/src/components/OrderCreating/index.tsx +1 -21
  5. package/src/components/PaymentOptionsWebView/index.tsx +29 -8
  6. package/src/components/PhoneInputNumber/index.tsx +6 -2
  7. package/src/components/StripeMethodForm/index.tsx +136 -102
  8. package/src/components/VerifyPhone/styles.tsx +1 -2
  9. package/src/components/shared/OToast.tsx +2 -1
  10. package/src/types/index.tsx +5 -0
  11. package/src/utils/index.tsx +5 -0
  12. package/themes/business/index.tsx +2 -0
  13. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +270 -245
  14. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  15. package/themes/business/src/components/BusinessController/index.tsx +0 -1
  16. package/themes/business/src/components/Chat/index.tsx +123 -111
  17. package/themes/business/src/components/DriverMap/index.tsx +17 -6
  18. package/themes/business/src/components/DriverSchedule/index.tsx +42 -5
  19. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  20. package/themes/business/src/components/LoginForm/Otp/index.tsx +31 -3
  21. package/themes/business/src/components/LoginForm/index.tsx +15 -22
  22. package/themes/business/src/components/MapView/index.tsx +10 -10
  23. package/themes/business/src/components/NewOrderNotification/index.tsx +35 -21
  24. package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
  25. package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
  26. package/themes/business/src/components/OrderDetails/Delivery.tsx +191 -6
  27. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +133 -65
  28. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +64 -63
  29. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
  30. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  31. package/themes/business/src/components/OrderMessage/index.tsx +19 -18
  32. package/themes/business/src/components/OrderSummary/index.tsx +114 -123
  33. package/themes/business/src/components/OrdersOption/index.tsx +32 -75
  34. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +249 -0
  35. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  36. package/themes/business/src/components/PreviousOrders/index.tsx +444 -242
  37. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  38. package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
  39. package/themes/business/src/components/ReviewCustomer/index.tsx +30 -15
  40. package/themes/business/src/components/StoresList/index.tsx +3 -4
  41. package/themes/business/src/components/UserProfileForm/index.tsx +11 -13
  42. package/themes/business/src/components/shared/OLink.tsx +33 -13
  43. package/themes/business/src/components/shared/OModal.tsx +16 -9
  44. package/themes/business/src/components/shared/OText.tsx +8 -2
  45. package/themes/business/src/types/index.tsx +28 -12
  46. package/themes/business/src/utils/index.tsx +29 -2
  47. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  48. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  49. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  50. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  51. package/themes/kiosk/src/components/Intro/index.tsx +16 -1
  52. package/themes/kiosk/src/components/LoginForm/index.tsx +7 -9
  53. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  54. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  55. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  56. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +2 -2
  57. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  58. package/themes/original/index.tsx +4 -0
  59. package/themes/original/src/components/AddressDetails/index.tsx +19 -3
  60. package/themes/original/src/components/AddressForm/index.tsx +61 -39
  61. package/themes/original/src/components/AddressList/index.tsx +27 -22
  62. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  63. package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
  64. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  65. package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
  66. package/themes/original/src/components/BusinessBasicInformation/index.tsx +153 -96
  67. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +10 -12
  68. package/themes/original/src/components/BusinessController/index.tsx +94 -66
  69. package/themes/original/src/components/BusinessController/styles.tsx +22 -3
  70. package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
  71. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
  72. package/themes/original/src/components/BusinessInformation/index.tsx +142 -109
  73. package/themes/original/src/components/BusinessItemAccordion/index.tsx +15 -20
  74. package/themes/original/src/components/BusinessListingSearch/index.tsx +349 -339
  75. package/themes/original/src/components/BusinessListingSearch/styles.tsx +0 -18
  76. package/themes/original/src/components/BusinessPreorder/index.tsx +103 -19
  77. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -2
  78. package/themes/original/src/components/BusinessProductsList/index.tsx +15 -7
  79. package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
  80. package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
  81. package/themes/original/src/components/BusinessProductsListing/index.tsx +684 -555
  82. package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
  83. package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
  84. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  85. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +83 -48
  86. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +0 -1
  87. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  88. package/themes/original/src/components/Cart/index.tsx +77 -50
  89. package/themes/original/src/components/CartContent/index.tsx +117 -20
  90. package/themes/original/src/components/CartContent/styles.tsx +17 -7
  91. package/themes/original/src/components/Checkout/index.tsx +356 -124
  92. package/themes/original/src/components/CitiesControl/index.tsx +1 -1
  93. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  94. package/themes/original/src/components/DriverTips/index.tsx +52 -34
  95. package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
  96. package/themes/original/src/components/Favorite/index.tsx +8 -9
  97. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  98. package/themes/original/src/components/FavoriteList/index.tsx +1 -35
  99. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  100. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  101. package/themes/original/src/components/GPSButton/index.tsx +6 -4
  102. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +96 -0
  103. package/themes/original/src/components/GiftCard/GiftCardUI/styles.tsx +5 -0
  104. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +100 -0
  105. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +8 -0
  106. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +191 -0
  107. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +8 -0
  108. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +165 -0
  109. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +9 -0
  110. package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
  111. package/themes/original/src/components/GoogleMap/index.tsx +60 -5
  112. package/themes/original/src/components/Help/index.tsx +8 -8
  113. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +10 -31
  114. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +5 -3
  115. package/themes/original/src/components/HelpGuide/index.tsx +6 -6
  116. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  117. package/themes/original/src/components/HelpOrder/index.tsx +6 -15
  118. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  119. package/themes/original/src/components/Home/index.tsx +13 -4
  120. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  121. package/themes/original/src/components/LoginForm/Otp/index.tsx +54 -15
  122. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  123. package/themes/original/src/components/LoginForm/index.tsx +59 -34
  124. package/themes/original/src/components/LottieAnimation/index.tsx +89 -55
  125. package/themes/original/src/components/MessageListing/index.tsx +16 -42
  126. package/themes/original/src/components/Messages/index.tsx +29 -7
  127. package/themes/original/src/components/MomentOption/index.tsx +195 -90
  128. package/themes/original/src/components/MomentSelector/index.tsx +1 -1
  129. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  130. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +162 -51
  131. package/themes/original/src/components/MultiCheckout/index.tsx +308 -88
  132. package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
  133. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  134. package/themes/original/src/components/MultiOrdersDetails/index.tsx +68 -21
  135. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  136. package/themes/original/src/components/MyOrders/index.tsx +40 -29
  137. package/themes/original/src/components/NavBar/index.tsx +20 -17
  138. package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
  139. package/themes/original/src/components/Notifications/index.tsx +46 -50
  140. package/themes/original/src/components/Notifications/styles.tsx +6 -3
  141. package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
  142. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +15 -3
  143. package/themes/original/src/components/OrderDetails/index.tsx +190 -363
  144. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  145. package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
  146. package/themes/original/src/components/OrderProgress/index.tsx +33 -56
  147. package/themes/original/src/components/OrderSummary/index.tsx +88 -59
  148. package/themes/original/src/components/OrderTypeSelector/index.tsx +2 -1
  149. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +24 -19
  150. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +14 -14
  151. package/themes/original/src/components/OrdersOption/index.tsx +78 -67
  152. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  153. package/themes/original/src/components/PageBanner/index.tsx +106 -31
  154. package/themes/original/src/components/PageBanner/styles.tsx +4 -4
  155. package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
  156. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  157. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  158. package/themes/original/src/components/PaymentOptions/index.tsx +78 -35
  159. package/themes/original/src/components/PhoneInputNumber/index.tsx +3 -3
  160. package/themes/original/src/components/ProductForm/index.tsx +105 -30
  161. package/themes/original/src/components/ProductForm/styles.tsx +5 -5
  162. package/themes/original/src/components/ProductItemAccordion/index.tsx +14 -11
  163. package/themes/original/src/components/ProductOptionSubOption/index.tsx +20 -18
  164. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +5 -9
  165. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  166. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
  167. package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
  168. package/themes/original/src/components/Promotions/index.tsx +5 -4
  169. package/themes/original/src/components/Promotions/styles.tsx +3 -1
  170. package/themes/original/src/components/ReviewOrder/index.tsx +26 -9
  171. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  172. package/themes/original/src/components/ReviewProducts/index.tsx +16 -7
  173. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  174. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  175. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  176. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  177. package/themes/original/src/components/ServiceForm/index.tsx +66 -17
  178. package/themes/original/src/components/Sessions/index.tsx +11 -8
  179. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  180. package/themes/original/src/components/SignupForm/index.tsx +43 -27
  181. package/themes/original/src/components/SingleOrderCard/index.tsx +130 -56
  182. package/themes/original/src/components/SingleOrderCard/styles.tsx +11 -2
  183. package/themes/original/src/components/SingleProductCard/index.tsx +72 -31
  184. package/themes/original/src/components/SingleProductCard/styles.tsx +20 -4
  185. package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
  186. package/themes/original/src/components/StripeCardsList/index.tsx +49 -5
  187. package/themes/original/src/components/StripeElementsForm/index.tsx +48 -34
  188. package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
  189. package/themes/original/src/components/UpsellingProducts/index.tsx +238 -224
  190. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  191. package/themes/original/src/components/UserDetails/index.tsx +3 -1
  192. package/themes/original/src/components/UserFormDetails/index.tsx +76 -7
  193. package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
  194. package/themes/original/src/components/UserProfile/index.tsx +88 -79
  195. package/themes/original/src/components/UserProfileForm/index.tsx +27 -29
  196. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  197. package/themes/original/src/components/UserVerification/index.tsx +52 -49
  198. package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
  199. package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
  200. package/themes/original/src/components/Wallets/index.tsx +66 -30
  201. package/themes/original/src/components/Wallets/styles.tsx +3 -4
  202. package/themes/original/src/components/shared/OButton.tsx +6 -2
  203. package/themes/original/src/components/shared/OInput.tsx +6 -1
  204. package/themes/original/src/components/shared/OModal.tsx +3 -3
  205. package/themes/original/src/types/index.tsx +36 -10
  206. package/themes/original/src/utils/index.tsx +273 -1
  207. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -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
- suboptions?.map((suboption: any) => {
52
- const string = `&nbsp;&nbsp;&nbsp;${getFormattedSubOptionName(suboption)}<br/>`
53
- array.push(string)
54
- })
51
+ suboptions?.map((suboption: any) => {
52
+ const string = `&nbsp;&nbsp;&nbsp;${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
- options?.map((option: any) => {
64
- const string =
65
- ` ${option.name}<br/>${getSuboptions(option.suboptions)}`;
63
+ options?.map((option: any) => {
64
+ const string =
65
+ ` ${option.name}<br/>${getSuboptions(option.suboptions)}`;
66
66
 
67
- array.push(string)
68
- })
67
+ array.push(string)
68
+ })
69
69
 
70
70
  if (productComment) {
71
71
  array.push(`${t('COMMENT', 'Comment')}<br/>&nbsp;&nbsp;&nbsp;&nbsp;${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
- deliveryStatus[order?.delivery_type]
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
- !!order?.customer?.phone
117
- ? `${t('MOBILE_PHONE', 'Mobile Phone')}: ${
118
- order?.customer?.phone
119
- } </br>`
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
- !!order?.customer?.internal_number
126
- ? `${t('INTERNAL_NUMBER', 'Internal Number')}: ${
127
- order?.customer?.internal_number
128
- } </br>`
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
- !!order?.business?.phone
144
- ? `${t('BUSINESS_PHONE', 'Business Phone')}: ${
145
- order?.business?.phone
146
- } </br>`
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
- !!order?.business?.address_notes
154
- ? `${t('SPECIAL_ADDRESS', 'Special Address')}: ${
155
- order?.business?.address_notes
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
- order?.products.map(
164
- (product: any, i: number) =>
165
- `<div style="display: flex;flexDirection:row;flex-wrap:wrap">
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
- order.tax_type === 1
193
- ? order?.summary?.subtotal + order?.summary?.tax ?? 0
194
- : order?.summary?.subtotal ?? 0,
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
- order?.summary?.discount > 0
203
- ? order?.offer_type === 1
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
- order?.offer_rate,
207
- parsePrice,
208
- )}%)
194
+ order?.offer_rate,
195
+ parsePrice,
196
+ )}%)
209
197
  </div>`
210
- : `<div style="display:flex; justify-content: flex-start; font-size: 26px; width: 70%"> ${t(
211
- 'DISCOUNT',
212
- 'Discount',
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
- order?.summary?.discount > 0
219
- ? `<div style="display:flex; justify-content: flex-end; font-size: 26px; width: 30%">- ${parsePrice(
220
- order?.summary?.discount,
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
- order?.tax_type !== 1
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
- order?.summary?.delivery_price > 0
241
- ? `<div style="font-size: 25px;"> ${t(
242
- 'DELIVERY_FEE',
243
- 'Delivery Fee',
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
- deliveryStatus[order?.delivery_type]
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
- ? parseDate(order?.delivery_datetime_utc)
376
- : parseDate(order?.delivery_datetime, { utc: false })
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')}: ${order?.customer?.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
- order?.customer?.cellphone
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
- order?.customer?.phone
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
- order?.business?.cellphone
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
- order?.business?.phone
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
- order?.business?.address_notes
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,6 +1,6 @@
1
1
  import React, { useEffect, useState, useRef } from 'react';
2
- import { View, Pressable, StyleSheet, ScrollView, RefreshControl, Linking, Platform, TextInput } from 'react-native';
3
- import { useLanguage, useUtils, useToast, ToastType, OrderListGroups, useConfig } from 'ordering-components/native';
2
+ import { View, Pressable, StyleSheet, ScrollView, RefreshControl, Platform, TouchableOpacity } from 'react-native';
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';
@@ -20,7 +20,6 @@ import {
20
20
  IconWrapper,
21
21
  ModalContainer,
22
22
  ModalTitle,
23
- FilterBtnWrapper,
24
23
  TabPressable,
25
24
  OrderStatus,
26
25
  SlaOption,
@@ -34,42 +33,17 @@ import {
34
33
  ItemContent,
35
34
  TimerInputWrapper,
36
35
  OverLine,
37
- Actions,
38
36
  InputContainer
39
37
  } from './styles';
40
38
  import { PreviousOrders } from '../PreviousOrders';
41
39
  import { OrdersOptionParams } from '../../types';
42
40
 
43
- import { TouchableOpacity } from 'react-native-gesture-handler';
44
- import GestureRecognizer from 'react-native-swipe-gestures';
45
- import ODropDown from '../shared/ODropDown';
46
- import { OrdersOptionStatus } from '../OrdersOptionStatus'
47
41
  import { OrdersOptionCity } from '../OrdersOptionCity';
48
42
  import { OrdersOptionBusiness } from '../OrdersOptionBusiness';
49
43
  import { OrdersOptionDelivery } from '../OrdersOptionDelivery';
50
44
  import { OrdersOptionPaymethod } from '../OrdersOptionPaymethod';
51
45
  import { OrdersOptionDriver } from '../OrdersOptionDriver';
52
46
  import { OrdersOptionDate } from '../OrdersOptionDate';
53
- import { GestureEvent, GestureDetector } from 'react-native-gesture-handler'
54
- const tabsList: any = {
55
- pending: 1,
56
- inProgress: 2,
57
- completed: 3,
58
- cancelled: 4
59
- };
60
-
61
- const tabsListText: any = {
62
- 1: 'pending',
63
- 2: 'inProgress',
64
- 3: 'completed',
65
- 4: 'cancelled'
66
- };
67
-
68
- const swipeConfig = {
69
- velocityThreshold: 0.3,
70
- directionalOffsetThreshold: 80
71
- };
72
-
73
47
  const { useDeviceOrientation, PORTRAIT } = DeviceOrientationMethods
74
48
 
75
49
  const OrdersOptionUI = (props: OrdersOptionParams) => {
@@ -81,10 +55,10 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
81
55
  ordersGroup,
82
56
  setOrdersGroup,
83
57
  orderStatus,
58
+ ordersFormatted,
84
59
  loadOrders,
85
60
  loadMoreOrders,
86
61
  onNavigationRedirect,
87
- filtered,
88
62
  onFiltered,
89
63
  handleClickOrder,
90
64
  isBusinessApp,
@@ -92,7 +66,9 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
92
66
  logisticOrders,
93
67
  loadLogisticOrders,
94
68
  isLogisticActivated,
95
- isAlsea
69
+ isAlsea,
70
+ handleChangeOrderStatus,
71
+ handleSendCustomerReview
96
72
  } = props;
97
73
 
98
74
  const defaultSearchList = {
@@ -122,7 +98,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
122
98
  const [slaSettingTime, setSlaSettingTime] = useState(6000)
123
99
  const [currentDeliveryType, setCurrentDeliveryType] = useState('Delivery')
124
100
  const [search, setSearch] = useState(defaultSearchList)
125
- const [selectedTabStatus, setSelectedTabStatus] = useState([])
101
+ const [selectedTabStatus, setSelectedTabStatus] = useState<any>([])
126
102
  const [hour, setHour] = useState(0)
127
103
  const [minute, setMinute] = useState(0)
128
104
  const [openedSelect, setOpenedSelect] = useState('')
@@ -263,6 +239,19 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
263
239
  overflow: 'hidden',
264
240
  minHeight: 155
265
241
  },
242
+ btnBackArrow: {
243
+ borderWidth: 0,
244
+ width: 32,
245
+ height: 32,
246
+ tintColor: theme.colors.textGray,
247
+ backgroundColor: theme.colors.clear,
248
+ borderColor: theme.colors.clear,
249
+ shadowColor: theme.colors.clear,
250
+ paddingLeft: 0,
251
+ paddingRight: 0,
252
+ marginBottom: 30,
253
+ marginTop: 30
254
+ },
266
255
  rowStyle: {
267
256
  display: 'flex',
268
257
  borderBottomWidth: 0,
@@ -346,26 +335,6 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
346
335
  })
347
336
  }
348
337
 
349
- const onSwipeLeft = () => {
350
- let currentTab = tabsList[currentTabSelected]
351
- currentTab = currentTab >= 4 ? null : currentTab + 1
352
-
353
- if (!currentTab) return
354
-
355
- const nextTab = tabsListText[currentTab]
356
- nextTab && setCurrentTabSelected(nextTab)
357
- }
358
-
359
- const onSwipeRight = () => {
360
- let currentTab = tabsList[currentTabSelected]
361
- currentTab = currentTab <= 1 ? null : currentTab - 1
362
-
363
- if (!currentTab) return
364
-
365
- const nextTab = tabsListText[currentTab]
366
- nextTab && setCurrentTabSelected(nextTab)
367
- }
368
-
369
338
  const calculateDate = (type: any, from: any, to: any) => {
370
339
  switch (type) {
371
340
  case 'today':
@@ -419,14 +388,8 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
419
388
  useEffect(() => {
420
389
  setSelectedTabStatus(deliveryStatus)
421
390
  }, [])
422
-
391
+
423
392
  return (
424
- // <GestureRecognizer
425
- // onSwipeLeft={onSwipeLeft}
426
- // onSwipeRight={onSwipeRight}
427
- // config={swipeConfig}
428
- // style={{ flex: 1 }}
429
- // >
430
393
  <>
431
394
  <View style={styles.header}>
432
395
  <OText style={styles.title}>{t('MY_ORDERS', 'My orders')}</OText>
@@ -635,12 +598,18 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
635
598
  currentTabSelected !== 'logisticOrders' &&
636
599
  (
637
600
  <PreviousOrders
638
- orders={currentOrdersGroup?.orders}
601
+ orders={ordersFormatted}
602
+ navigation={props.navigation}
639
603
  onNavigationRedirect={onNavigationRedirect}
640
604
  getOrderStatus={getOrderStatus}
641
605
  handleClickOrder={handleClickOrder}
642
606
  slaSettingTime={slaSettingTime}
643
607
  currentTabSelected={currentTabSelected}
608
+ appTitle={props.orderDetailsProps?.appTitle}
609
+ actions={props.orderDetailsProps?.actions}
610
+ orderTitle={props.orderDetailsProps?.orderTitle}
611
+ handleChangeOrderStatus={handleChangeOrderStatus}
612
+ handleSendCustomerReview={handleSendCustomerReview}
644
613
  />
645
614
  )}
646
615
  {!logisticOrders?.error?.length &&
@@ -730,7 +699,6 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
730
699
  )}
731
700
  </ScrollView>
732
701
  </View>
733
- {/* </GestureRecognizer> */}
734
702
 
735
703
  {isBusinessApp && (
736
704
  <NewOrderNotification isBusinessApp={isBusinessApp} />
@@ -741,20 +709,9 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
741
709
  <ModalContainer
742
710
  nestedScrollEnabled={true}
743
711
  >
744
- <OIconButton
745
- icon={theme.images.general.arrow_left}
746
- borderColor={theme.colors.clear}
747
- iconColor={theme.colors.backArrow}
748
- iconStyle={{ width: 20, height: 13 }}
749
- style={{
750
- maxWidth: 40,
751
- height: 35,
752
- justifyContent: 'flex-end',
753
- marginBottom: 30,
754
- marginTop: 30
755
- }}
756
- onClick={() => handleClose()}
757
- />
712
+ <TouchableOpacity onPress={() => handleClose()} style={styles.btnBackArrow}>
713
+ <OIcon src={theme.images.general.arrow_left} color={theme.colors.textGray} />
714
+ </TouchableOpacity>
758
715
  {openSearchModal && (
759
716
  <SearchModalContent>
760
717
  <ModalTitle>{t('SEARCH_ORDERS', 'Search orders')}</ModalTitle>
@@ -884,7 +841,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
884
841
  </ScrollView>
885
842
  </FiltersTab>
886
843
  <DeliveryStatusWrapper>
887
- {selectedTabStatus && selectedTabStatus.length > 0 && selectedTabStatus.map((item, i) => (
844
+ {selectedTabStatus && selectedTabStatus.length > 0 && selectedTabStatus.map((item: any, i: number) => (
888
845
  <StatusBlock
889
846
  key={i}
890
847
  item={item}