ordering-ui-react-native 0.18.2 → 0.18.3-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 (263) hide show
  1. package/package.json +9 -7
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessInformation/index.tsx +10 -9
  4. package/src/components/BusinessesListing/index.tsx +1 -1
  5. package/src/components/OrderCreating/index.tsx +0 -20
  6. package/src/components/PaymentOptionsWebView/index.tsx +29 -8
  7. package/src/components/PhoneInputNumber/index.tsx +6 -2
  8. package/src/components/StripeMethodForm/index.tsx +136 -102
  9. package/src/components/VerifyPhone/styles.tsx +1 -2
  10. package/src/components/shared/OToast.tsx +3 -2
  11. package/src/types/index.tsx +5 -0
  12. package/src/utils/index.tsx +7 -2
  13. package/themes/business/index.tsx +2 -0
  14. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +36 -26
  15. package/themes/business/src/components/BusinessController/index.tsx +19 -17
  16. package/themes/business/src/components/BusinessProductList/AccordionDropdown.tsx +63 -0
  17. package/themes/business/src/components/BusinessProductList/IterateCategories.tsx +108 -0
  18. package/themes/business/src/components/BusinessProductList/ProductList.tsx +196 -0
  19. package/themes/business/src/components/BusinessProductList/index.tsx +196 -0
  20. package/themes/business/src/components/BusinessProductList/styles.tsx +10 -0
  21. package/themes/business/src/components/Chat/index.tsx +163 -123
  22. package/themes/business/src/components/DriverMap/index.tsx +17 -6
  23. package/themes/business/src/components/DriverSchedule/index.tsx +45 -8
  24. package/themes/business/src/components/FloatingButton/index.tsx +34 -31
  25. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  26. package/themes/business/src/components/LoginForm/index.tsx +5 -2
  27. package/themes/business/src/components/MapView/index.tsx +14 -10
  28. package/themes/business/src/components/MessagesOption/index.tsx +22 -94
  29. package/themes/business/src/components/NewOrderNotification/index.tsx +123 -96
  30. package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
  31. package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
  32. package/themes/business/src/components/OrderDetails/Delivery.tsx +205 -12
  33. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +67 -39
  34. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +47 -23
  35. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +9 -4
  36. package/themes/business/src/components/OrderMessage/index.tsx +1 -1
  37. package/themes/business/src/components/OrderSummary/index.tsx +114 -123
  38. package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
  39. package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
  40. package/themes/business/src/components/OrdersOption/index.tsx +43 -32
  41. package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
  42. package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
  43. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +21 -29
  44. package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
  45. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
  46. package/themes/business/src/components/PreviousOrders/index.tsx +193 -221
  47. package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
  48. package/themes/business/src/components/ReviewCustomer/index.tsx +3 -1
  49. package/themes/business/src/components/SearchBar/index.tsx +2 -1
  50. package/themes/business/src/components/StoresList/index.tsx +6 -5
  51. package/themes/business/src/components/UserProfileForm/index.tsx +14 -15
  52. package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
  53. package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
  54. package/themes/business/src/components/shared/OModal.tsx +16 -9
  55. package/themes/business/src/types/index.tsx +8 -0
  56. package/themes/business/src/utils/index.tsx +4 -4
  57. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  58. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  59. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  60. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  61. package/themes/kiosk/src/components/Intro/index.tsx +16 -1
  62. package/themes/kiosk/src/components/LoginForm/index.tsx +7 -5
  63. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  64. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  65. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  66. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +2 -2
  67. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  68. package/themes/original/index.tsx +7 -3
  69. package/themes/original/src/components/AddressDetails/index.tsx +19 -3
  70. package/themes/original/src/components/AddressForm/index.tsx +33 -15
  71. package/themes/original/src/components/AddressForm/styles.tsx +1 -1
  72. package/themes/original/src/components/AddressList/index.tsx +5 -8
  73. package/themes/original/src/components/AddressList/styles.tsx +4 -4
  74. package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
  75. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  76. package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
  77. package/themes/original/src/components/BusinessBasicInformation/index.tsx +74 -38
  78. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +11 -13
  79. package/themes/original/src/components/BusinessController/index.tsx +35 -44
  80. package/themes/original/src/components/BusinessController/styles.tsx +12 -5
  81. package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
  82. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
  83. package/themes/original/src/components/BusinessInformation/index.tsx +140 -85
  84. package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
  85. package/themes/original/src/components/BusinessItemAccordion/index.tsx +25 -26
  86. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
  87. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
  88. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
  89. package/themes/original/src/components/BusinessListingSearch/index.tsx +133 -438
  90. package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -19
  91. package/themes/original/src/components/BusinessPreorder/index.tsx +105 -22
  92. package/themes/original/src/components/BusinessPreorder/styles.tsx +14 -0
  93. package/themes/original/src/components/BusinessProductsCategories/index.tsx +2 -3
  94. package/themes/original/src/components/BusinessProductsList/index.tsx +15 -7
  95. package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
  96. package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
  97. package/themes/original/src/components/BusinessProductsListing/index.tsx +162 -39
  98. package/themes/original/src/components/BusinessProductsListing/styles.tsx +4 -5
  99. package/themes/original/src/components/BusinessReviews/index.tsx +4 -2
  100. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  101. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
  102. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
  103. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
  104. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
  105. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +37 -404
  106. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  107. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  108. package/themes/original/src/components/Cart/index.tsx +49 -47
  109. package/themes/original/src/components/CartContent/index.tsx +99 -38
  110. package/themes/original/src/components/CartContent/styles.tsx +6 -6
  111. package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
  112. package/themes/original/src/components/Checkout/index.tsx +324 -43
  113. package/themes/original/src/components/Checkout/styles.tsx +17 -0
  114. package/themes/original/src/components/CitiesControl/index.tsx +1 -1
  115. package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
  116. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  117. package/themes/original/src/components/DatePicker/index.tsx +17 -0
  118. package/themes/original/src/components/DatePicker/styles.tsx +20 -0
  119. package/themes/original/src/components/DriverTips/index.tsx +6 -3
  120. package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
  121. package/themes/original/src/components/Favorite/index.tsx +4 -9
  122. package/themes/original/src/components/Favorite/styles.tsx +0 -2
  123. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  124. package/themes/original/src/components/GPSButton/index.tsx +7 -5
  125. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
  126. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +42 -5
  127. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +3 -1
  128. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +84 -8
  129. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
  130. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
  131. package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
  132. package/themes/original/src/components/GoogleMap/index.tsx +63 -7
  133. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
  134. package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
  135. package/themes/original/src/components/Home/index.tsx +14 -5
  136. package/themes/original/src/components/LastOrder/index.tsx +2 -1
  137. package/themes/original/src/components/LastOrders/index.tsx +2 -1
  138. package/themes/original/src/components/LoginForm/Otp/index.tsx +91 -25
  139. package/themes/original/src/components/LoginForm/index.tsx +64 -34
  140. package/themes/original/src/components/LottieAnimation/index.tsx +88 -63
  141. package/themes/original/src/components/MessageListing/index.tsx +9 -2
  142. package/themes/original/src/components/Messages/index.tsx +15 -4
  143. package/themes/original/src/components/Messages/styles.tsx +1 -1
  144. package/themes/original/src/components/MomentOption/index.tsx +9 -10
  145. package/themes/original/src/components/MomentSelector/index.tsx +1 -1
  146. package/themes/original/src/components/MultiCart/index.tsx +1 -1
  147. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +161 -49
  148. package/themes/original/src/components/MultiCheckout/index.tsx +348 -70
  149. package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
  150. package/themes/original/src/components/MultiOrdersDetails/index.tsx +2 -2
  151. package/themes/original/src/components/MyOrders/index.tsx +16 -5
  152. package/themes/original/src/components/NavBar/index.tsx +20 -13
  153. package/themes/original/src/components/NetworkError/index.tsx +2 -3
  154. package/themes/original/src/components/NetworkError/styles.tsx +2 -2
  155. package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
  156. package/themes/original/src/components/Notifications/index.tsx +4 -8
  157. package/themes/original/src/components/Notifications/styles.tsx +0 -1
  158. package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
  159. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +22 -6
  160. package/themes/original/src/components/OrderDetails/index.tsx +721 -670
  161. package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
  162. package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
  163. package/themes/original/src/components/OrderProgress/index.tsx +34 -25
  164. package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
  165. package/themes/original/src/components/OrderSummary/index.tsx +62 -57
  166. package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -6
  167. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
  168. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +13 -13
  169. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
  170. package/themes/original/src/components/OrdersOption/index.tsx +44 -21
  171. package/themes/original/src/components/OrdersOption/styles.tsx +2 -2
  172. package/themes/original/src/components/PageBanner/index.tsx +65 -29
  173. package/themes/original/src/components/PageBanner/styles.tsx +0 -3
  174. package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
  175. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
  176. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  177. package/themes/original/src/components/PaymentOptions/index.tsx +100 -34
  178. package/themes/original/src/components/PhoneInputNumber/index.tsx +18 -4
  179. package/themes/original/src/components/ProductForm/ActionButton.tsx +120 -0
  180. package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
  181. package/themes/original/src/components/ProductForm/index.tsx +106 -170
  182. package/themes/original/src/components/ProductForm/styles.tsx +3 -3
  183. package/themes/original/src/components/ProductItemAccordion/index.tsx +13 -6
  184. package/themes/original/src/components/ProductOptionSubOption/index.tsx +49 -20
  185. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +10 -9
  186. package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
  187. package/themes/original/src/components/Promotions/index.tsx +6 -6
  188. package/themes/original/src/components/Promotions/styles.tsx +3 -3
  189. package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
  190. package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
  191. package/themes/original/src/components/ReviewProducts/index.tsx +16 -7
  192. package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
  193. package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
  194. package/themes/original/src/components/ServiceForm/index.tsx +2 -2
  195. package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
  196. package/themes/original/src/components/SignupForm/index.tsx +27 -16
  197. package/themes/original/src/components/SingleOrderCard/index.tsx +44 -20
  198. package/themes/original/src/components/SingleOrderCard/styles.tsx +1 -1
  199. package/themes/original/src/components/SingleProductCard/index.tsx +13 -10
  200. package/themes/original/src/components/SingleProductCard/styles.tsx +8 -3
  201. package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
  202. package/themes/original/src/components/StripeCardsList/index.tsx +61 -5
  203. package/themes/original/src/components/StripeElementsForm/index.tsx +48 -34
  204. package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
  205. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
  206. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +86 -0
  207. package/themes/original/src/components/UpsellingProducts/index.tsx +16 -205
  208. package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
  209. package/themes/original/src/components/UserDetails/index.tsx +3 -1
  210. package/themes/original/src/components/UserFormDetails/index.tsx +100 -22
  211. package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
  212. package/themes/original/src/components/UserProfile/index.tsx +8 -26
  213. package/themes/original/src/components/UserProfileForm/index.tsx +30 -31
  214. package/themes/original/src/components/UserVerification/index.tsx +55 -50
  215. package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
  216. package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
  217. package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
  218. package/themes/original/src/components/Wallets/index.tsx +48 -60
  219. package/themes/original/src/components/Wallets/styles.tsx +3 -4
  220. package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
  221. package/themes/original/src/components/shared/OButton.tsx +3 -3
  222. package/themes/original/src/components/shared/OInput.tsx +4 -5
  223. package/themes/original/src/components/shared/OModal.tsx +15 -17
  224. package/themes/original/src/layouts/Container.tsx +5 -3
  225. package/themes/original/src/types/index.tsx +28 -6
  226. package/themes/original/src/utils/index.tsx +180 -13
  227. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  228. package/src/navigators/BottomNavigator.tsx +0 -117
  229. package/src/navigators/CheckoutNavigator.tsx +0 -66
  230. package/src/navigators/HomeNavigator.tsx +0 -202
  231. package/src/navigators/NavigationRef.tsx +0 -7
  232. package/src/navigators/RootNavigator.tsx +0 -269
  233. package/src/pages/Account.tsx +0 -34
  234. package/src/pages/AddressForm.tsx +0 -62
  235. package/src/pages/AddressList.tsx +0 -24
  236. package/src/pages/BusinessProductsList.tsx +0 -81
  237. package/src/pages/BusinessesListing.tsx +0 -43
  238. package/src/pages/CartList.tsx +0 -49
  239. package/src/pages/Checkout.tsx +0 -101
  240. package/src/pages/ForgotPassword.tsx +0 -24
  241. package/src/pages/Help.tsx +0 -23
  242. package/src/pages/HelpAccountAndPayment.tsx +0 -23
  243. package/src/pages/HelpGuide.tsx +0 -23
  244. package/src/pages/HelpOrder.tsx +0 -23
  245. package/src/pages/Home.tsx +0 -36
  246. package/src/pages/IntroductoryTutorial.tsx +0 -170
  247. package/src/pages/Login.tsx +0 -47
  248. package/src/pages/MomentOption.tsx +0 -30
  249. package/src/pages/MultiCheckout.tsx +0 -31
  250. package/src/pages/MultiOrdersDetails.tsx +0 -27
  251. package/src/pages/MyOrders.tsx +0 -40
  252. package/src/pages/NetworkError.tsx +0 -24
  253. package/src/pages/NotFound.tsx +0 -22
  254. package/src/pages/OrderDetails.tsx +0 -25
  255. package/src/pages/ProductDetails.tsx +0 -55
  256. package/src/pages/Profile.tsx +0 -36
  257. package/src/pages/ReviewDriver.tsx +0 -30
  258. package/src/pages/ReviewOrder.tsx +0 -32
  259. package/src/pages/ReviewProducts.tsx +0 -30
  260. package/src/pages/Sessions.tsx +0 -22
  261. package/src/pages/Signup.tsx +0 -53
  262. package/src/pages/SpinnerLoader.tsx +0 -10
  263. 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
- 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%'}
@@ -40,6 +40,7 @@ import { OrdersOptionPaymethod } from '../OrdersOptionPaymethod';
40
40
  import { OrdersOptionDriver } from '../OrdersOptionDriver';
41
41
  import { OrdersOptionDate } from '../OrdersOptionDate';
42
42
  import { OrderDetailsBusiness } from '../OrderDetails/Business';
43
+ import { WebsocketStatus } from '../WebsocketStatus'
43
44
 
44
45
  const { useDeviceOrientation, PORTRAIT } = DeviceOrientationMethods
45
46
 
@@ -314,7 +315,11 @@ const OrdersListManagerUI = (props: OrdersOptionParams) => {
314
315
  </View>
315
316
  {configState?.configs?.order_deadlines_enabled?.value === '1' && (
316
317
  <View style={styles.SLAwrapper}>
317
- <View style={{ flex: 0.5 }}>
318
+ <View style={{ flex: 1 }}>
319
+ <WebsocketStatus />
320
+ </View>
321
+ <View style={{ width: 10, height: '100%' }} />
322
+ <View style={{ flex: 1 }}>
318
323
  <OButton
319
324
  text={t('SLA_SETTING', 'SLA’s Settings')}
320
325
  textStyle={{ color: theme.colors.backArrow }}
@@ -330,7 +335,7 @@ const OrdersListManagerUI = (props: OrdersOptionParams) => {
330
335
  />
331
336
  </View>
332
337
  <View style={{ width: 10, height: '100%' }} />
333
- <View style={{ flex: 0.5, justifyContent: 'center' }}>
338
+ <View style={{ flex: 1, justifyContent: 'center' }}>
334
339
  <SelectDropdown
335
340
  defaultButtonText={t('SLA', 'SLA\'s')}
336
341
  data={preorderTypeList}
@@ -209,7 +209,7 @@ export const Timer = () => {
209
209
  return (
210
210
  <TimerInputWrapper>
211
211
  <OText style={styles.settingTime} color={theme.colors.disabled}>{configs?.order_deadlines_delayed_time?.value}</OText>
212
- <OText>{t('MIN', 'min')}</OText>
212
+ <OText>{t('TIME_MIN', 'min')}</OText>
213
213
  </TimerInputWrapper>
214
214
  )
215
215
  }
@@ -6,12 +6,14 @@ 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';
14
+ import { WebsocketStatus } from '../WebsocketStatus'
13
15
 
14
- import { OText, OButton, OModal, OIconButton, OInput, OIcon } from '../shared';
16
+ import { OText, OButton, OModal, OInput, OIcon } from '../shared';
15
17
  import { NotFoundSource } from '../NotFoundSource';
16
18
  import {
17
19
  FiltersTab,
@@ -73,6 +75,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
73
75
 
74
76
  const defaultSearchList = {
75
77
  id: '',
78
+ external_id: '',
76
79
  state: '',
77
80
  city: '',
78
81
  business: '',
@@ -92,35 +95,11 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
92
95
  const [{ parseDate }] = useUtils()
93
96
  const [configState] = useConfig()
94
97
  const [orientationState] = useDeviceOrientation();
95
- const [, { showToast }] = useToast();
96
98
  const [openSearchModal, setOpenSearchModal] = useState(false)
97
99
  const [openSLASettingModal, setOpenSLASettingModal] = useState(false)
98
100
  const [slaSettingTime, setSlaSettingTime] = useState(6000)
99
101
  const [currentDeliveryType, setCurrentDeliveryType] = useState('Delivery')
100
102
  const [search, setSearch] = useState(defaultSearchList)
101
- const [selectedTabStatus, setSelectedTabStatus] = useState<any>([])
102
- const [hour, setHour] = useState(0)
103
- const [minute, setMinute] = useState(0)
104
- const [openedSelect, setOpenedSelect] = useState('')
105
- const WIDTH_SCREEN = orientationState?.dimensions?.width
106
- const HEIGHT_SCREEN = orientationState?.dimensions?.height
107
- const IS_PORTRAIT = orientationState.orientation === PORTRAIT
108
-
109
- const preorderTypeList = [
110
- { key: null, name: t('SLA', 'SLA\'s') },
111
- { key: 'in_time', name: t('OK', 'Ok') },
112
- { key: 'at_risk', name: t('AT_RISK', 'At Risk') },
113
- { key: 'delayed', name: t('DELAYED', 'Delayed') }
114
- ]
115
-
116
- const defaultOrderTypes = [
117
- { key: 1, name: t('DELIVERY', 'Delivery') },
118
- { key: 2, name: t('PICKUP', 'Pickup') },
119
- { key: 3, name: t('EAT_IN', 'Eat in') },
120
- { key: 4, name: t('CURBSIDE', 'Curbside') },
121
- { key: 5, name: t('DRIVE_THRU', 'Drive thru') }
122
- ]
123
-
124
103
  const deliveryStatus = [
125
104
  {
126
105
  key: t('OK', 'Ok'),
@@ -144,6 +123,26 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
144
123
  backColor: '#E63757'
145
124
  }
146
125
  ]
126
+ const [selectedTabStatus, setSelectedTabStatus] = useState<any>(deliveryStatus)
127
+ const [openedSelect, setOpenedSelect] = useState('')
128
+
129
+ const HEIGHT_SCREEN = orientationState?.dimensions?.height
130
+ const IS_PORTRAIT = orientationState.orientation === PORTRAIT
131
+
132
+ const preorderTypeList = [
133
+ { key: null, name: t('SLA', 'SLA\'s') },
134
+ { key: 'in_time', name: t('OK', 'Ok') },
135
+ { key: 'at_risk', name: t('AT_RISK', 'At Risk') },
136
+ { key: 'delayed', name: t('DELAYED', 'Delayed') }
137
+ ]
138
+
139
+ const defaultOrderTypes = [
140
+ { key: 1, name: t('DELIVERY', 'Delivery') },
141
+ { key: 2, name: t('PICKUP', 'Pickup') },
142
+ { key: 3, name: t('EAT_IN', 'Eat in') },
143
+ { key: 4, name: t('CURBSIDE', 'Curbside') },
144
+ { key: 5, name: t('DRIVE_THRU', 'Drive thru') }
145
+ ]
147
146
 
148
147
  const styles = StyleSheet.create({
149
148
  header: {
@@ -385,10 +384,6 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
385
384
  setTags({ values: [] })
386
385
  }, [currentTabSelected])
387
386
 
388
- useEffect(() => {
389
- setSelectedTabStatus(deliveryStatus)
390
- }, [])
391
-
392
387
  return (
393
388
  <>
394
389
  <View style={styles.header}>
@@ -409,6 +404,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
409
404
  />
410
405
  </IconWrapper>
411
406
  </View>
407
+ <WebsocketStatus />
412
408
  {configState?.configs?.order_deadlines_enabled?.value === '1' && (
413
409
  <View style={styles.SLAwrapper}>
414
410
  <View style={{ flex: 0.5 }}>
@@ -610,6 +606,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
610
606
  orderTitle={props.orderDetailsProps?.orderTitle}
611
607
  handleChangeOrderStatus={handleChangeOrderStatus}
612
608
  handleSendCustomerReview={handleSendCustomerReview}
609
+ isBusinessApp={isBusinessApp}
613
610
  />
614
611
  )}
615
612
  {!logisticOrders?.error?.length &&
@@ -620,6 +617,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
620
617
  onNavigationRedirect={onNavigationRedirect}
621
618
  getOrderStatus={getOrderStatus}
622
619
  handleClickLogisticOrder={handleClickLogisticOrder}
620
+ isBusinessApp={isBusinessApp}
623
621
  isLogisticOrder
624
622
  />
625
623
  )
@@ -730,6 +728,21 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
730
728
  onPress={() => setSearch({ ...search, id: '' })}
731
729
  />
732
730
  </InputContainer>
731
+ <InputContainer>
732
+ <OInput
733
+ value={search.external_id}
734
+ onChange={(value: any) => setSearch({ ...search, external_id: value })}
735
+ style={styles.inputStyle}
736
+ placeholder={t('EXTERNAL_ID', 'External id')}
737
+ autoCorrect={false}
738
+ />
739
+ <AntDesignIcon
740
+ name='close'
741
+ size={20}
742
+ style={{ position: 'absolute', right: 12, top: 13 }}
743
+ onPress={() => setSearch({ ...search, external_id: '' })}
744
+ />
745
+ </InputContainer>
733
746
  <OrdersOptionDate
734
747
  {...props}
735
748
  search={search}
@@ -919,15 +932,13 @@ export const Timer = () => {
919
932
  return (
920
933
  <TimerInputWrapper>
921
934
  <OText style={styles.settingTime} color={theme.colors.disabled}>{configs?.order_deadlines_delayed_time?.value}</OText>
922
- <OText>{t('MIN', 'min')}</OText>
935
+ <OText>{t('TIME_MIN', 'min')}</OText>
923
936
  </TimerInputWrapper>
924
937
  )
925
938
  }
926
939
 
927
940
  export const OrdersOption = (props: OrdersOptionParams) => {
928
941
  const [, t] = useLanguage();
929
- const [configState] = useConfig()
930
- const theme = useTheme()
931
942
  const [checkNotificationStatus, setCheckNotificationStatus] = useState({ open: false, checked: false })
932
943
  const ordersProps = {
933
944
  ...props,