ordering-ui-react-native 0.21.48 → 0.21.49-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 -8
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessesListing/index.tsx +1 -1
  4. package/src/components/PaymentOptionsWebView/index.tsx +1 -0
  5. package/src/components/StripeMethodForm/index.tsx +6 -4
  6. package/src/components/VerifyPhone/styles.tsx +1 -2
  7. package/src/types/index.tsx +3 -1
  8. package/src/utils/index.tsx +2 -2
  9. package/themes/business/index.tsx +6 -0
  10. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +4 -3
  11. package/themes/business/src/components/BusinessController/index.tsx +19 -17
  12. package/themes/business/src/components/BusinessProductList/AccordionDropdown.tsx +63 -0
  13. package/themes/business/src/components/BusinessProductList/IterateCategories.tsx +108 -0
  14. package/themes/business/src/components/BusinessProductList/ProductList.tsx +196 -0
  15. package/themes/business/src/components/BusinessProductList/index.tsx +196 -0
  16. package/themes/business/src/components/BusinessProductList/styles.tsx +10 -0
  17. package/themes/business/src/components/DriverMap/index.tsx +36 -23
  18. package/themes/business/src/components/GoogleMap/index.tsx +15 -8
  19. package/themes/business/src/components/Home/index.tsx +5 -1
  20. package/themes/business/src/components/LanguageSelector/index.tsx +1 -2
  21. package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
  22. package/themes/business/src/components/LogoutButton/index.tsx +1 -1
  23. package/themes/business/src/components/MapView/index.tsx +30 -15
  24. package/themes/business/src/components/MessagesOption/index.tsx +2 -1
  25. package/themes/business/src/components/NewOrderNotification/index.tsx +66 -26
  26. package/themes/business/src/components/OrderDetails/Business.tsx +52 -2
  27. package/themes/business/src/components/OrderDetails/Delivery.tsx +30 -11
  28. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +68 -61
  29. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +40 -20
  30. package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
  31. package/themes/business/src/components/OrderSummary/index.tsx +240 -76
  32. package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
  33. package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
  34. package/themes/business/src/components/OrdersOption/index.tsx +253 -135
  35. package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
  36. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +37 -40
  37. package/themes/business/src/components/PreviousOrders/OrderList.tsx +1 -1
  38. package/themes/business/src/components/PreviousOrders/index.tsx +5 -3
  39. package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
  40. package/themes/business/src/components/PrinterEdition/index.tsx +363 -0
  41. package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
  42. package/themes/business/src/components/PrinterSettings/index.tsx +267 -0
  43. package/themes/business/src/components/PrinterSettings/styles.tsx +30 -0
  44. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  45. package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
  46. package/themes/business/src/components/SearchBar/index.tsx +2 -1
  47. package/themes/business/src/components/Sessions/index.tsx +187 -0
  48. package/themes/business/src/components/Sessions/styles.tsx +20 -0
  49. package/themes/business/src/components/StoresList/index.tsx +5 -3
  50. package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
  51. package/themes/business/src/components/UserProfileForm/index.tsx +106 -54
  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/OInput.tsx +2 -0
  55. package/themes/business/src/components/shared/OTextarea.tsx +8 -9
  56. package/themes/business/src/hooks/useLocation.tsx +5 -4
  57. package/themes/business/src/types/index.tsx +21 -5
  58. package/themes/business/src/utils/index.tsx +5 -0
  59. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  60. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  61. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  62. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  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/shared/OButton.tsx +5 -18
  67. package/themes/original/index.tsx +6 -2
  68. package/themes/original/src/components/AddressDetails/index.tsx +20 -10
  69. package/themes/original/src/components/AddressForm/index.tsx +41 -15
  70. package/themes/original/src/components/AddressForm/styles.tsx +1 -1
  71. package/themes/original/src/components/AddressList/index.tsx +18 -4
  72. package/themes/original/src/components/AddressList/styles.tsx +4 -4
  73. package/themes/original/src/components/AnalyticsSegment/index.tsx +6 -6
  74. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  75. package/themes/original/src/components/BusinessBasicInformation/index.tsx +7 -10
  76. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
  77. package/themes/original/src/components/BusinessController/index.tsx +18 -10
  78. package/themes/original/src/components/BusinessController/styles.tsx +8 -7
  79. package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
  80. package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
  81. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
  82. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
  83. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
  84. package/themes/original/src/components/BusinessListingSearch/index.tsx +47 -358
  85. package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
  86. package/themes/original/src/components/BusinessPreorder/index.tsx +4 -3
  87. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
  88. package/themes/original/src/components/BusinessProductsList/index.tsx +1 -1
  89. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  90. package/themes/original/src/components/BusinessProductsListing/index.tsx +30 -18
  91. package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
  92. package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
  93. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  94. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
  95. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +1 -1
  96. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +7 -7
  97. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +2 -2
  98. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  99. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  100. package/themes/original/src/components/Cart/index.tsx +32 -9
  101. package/themes/original/src/components/CartContent/index.tsx +96 -58
  102. package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
  103. package/themes/original/src/components/Checkout/index.tsx +144 -62
  104. package/themes/original/src/components/Checkout/styles.tsx +17 -0
  105. package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
  106. package/themes/original/src/components/DatePicker/index.tsx +18 -2
  107. package/themes/original/src/components/Favorite/index.tsx +9 -9
  108. package/themes/original/src/components/Favorite/styles.tsx +0 -2
  109. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  110. package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -0
  111. package/themes/original/src/components/GPSButton/index.tsx +1 -1
  112. package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
  113. package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
  114. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
  115. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
  116. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
  117. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
  118. package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
  119. package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
  120. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +83 -0
  121. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
  122. package/themes/original/src/components/GoogleMap/index.tsx +39 -18
  123. package/themes/original/src/components/Help/index.tsx +7 -0
  124. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +5 -0
  125. package/themes/original/src/components/HelpGuide/index.tsx +5 -0
  126. package/themes/original/src/components/HelpOrder/index.tsx +5 -0
  127. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +2 -2
  128. package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
  129. package/themes/original/src/components/Home/index.tsx +3 -8
  130. package/themes/original/src/components/LoginForm/Otp/index.tsx +4 -16
  131. package/themes/original/src/components/LoginForm/index.tsx +9 -3
  132. package/themes/original/src/components/MessageListing/index.tsx +6 -0
  133. package/themes/original/src/components/Messages/index.tsx +8 -7
  134. package/themes/original/src/components/Messages/styles.tsx +1 -1
  135. package/themes/original/src/components/MomentOption/index.tsx +19 -4
  136. package/themes/original/src/components/MultiCart/index.tsx +1 -1
  137. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +7 -3
  138. package/themes/original/src/components/MultiCheckout/index.tsx +126 -61
  139. package/themes/original/src/components/MultiCheckout/styles.tsx +17 -0
  140. package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -15
  141. package/themes/original/src/components/MyOrders/index.tsx +28 -28
  142. package/themes/original/src/components/NavBar/index.tsx +5 -0
  143. package/themes/original/src/components/NetworkError/index.tsx +2 -3
  144. package/themes/original/src/components/NetworkError/styles.tsx +2 -2
  145. package/themes/original/src/components/Notifications/index.tsx +9 -8
  146. package/themes/original/src/components/Notifications/styles.tsx +0 -1
  147. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +1 -1
  148. package/themes/original/src/components/OrderDetails/index.tsx +701 -662
  149. package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
  150. package/themes/original/src/components/OrderProgress/index.tsx +22 -3
  151. package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
  152. package/themes/original/src/components/OrderSummary/index.tsx +3 -1
  153. package/themes/original/src/components/OrderTypeSelector/index.tsx +10 -6
  154. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
  155. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
  156. package/themes/original/src/components/OrdersOption/index.tsx +3 -5
  157. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  158. package/themes/original/src/components/PaymentOptionCard/index.tsx +4 -2
  159. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  160. package/themes/original/src/components/PaymentOptions/index.tsx +47 -4
  161. package/themes/original/src/components/PreviousOrders/index.tsx +2 -0
  162. package/themes/original/src/components/ProductForm/ActionButton.tsx +122 -0
  163. package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
  164. package/themes/original/src/components/ProductForm/index.tsx +170 -252
  165. package/themes/original/src/components/ProductItemAccordion/index.tsx +55 -44
  166. package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
  167. package/themes/original/src/components/ProductOptionSubOption/index.tsx +112 -91
  168. package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
  169. package/themes/original/src/components/Promotions/index.tsx +13 -11
  170. package/themes/original/src/components/Promotions/styles.tsx +0 -2
  171. package/themes/original/src/components/ReviewDriver/index.tsx +5 -0
  172. package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
  173. package/themes/original/src/components/ReviewOrder/index.tsx +5 -0
  174. package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
  175. package/themes/original/src/components/ReviewProducts/index.tsx +5 -0
  176. package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
  177. package/themes/original/src/components/ServiceForm/index.tsx +1 -1
  178. package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
  179. package/themes/original/src/components/Sessions/index.tsx +5 -0
  180. package/themes/original/src/components/SignupForm/index.tsx +67 -59
  181. package/themes/original/src/components/SingleOrderCard/index.tsx +3 -2
  182. package/themes/original/src/components/SingleProductCard/index.tsx +4 -3
  183. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
  184. package/themes/original/src/components/StripeCardsList/index.tsx +12 -35
  185. package/themes/original/src/components/StripeElementsForm/index.tsx +79 -59
  186. package/themes/original/src/components/StripeElementsForm/naked.tsx +48 -1
  187. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
  188. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +91 -0
  189. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
  190. package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
  191. package/themes/original/src/components/UserFormDetails/index.tsx +100 -86
  192. package/themes/original/src/components/UserFormDetails/styles.tsx +7 -0
  193. package/themes/original/src/components/UserProfile/index.tsx +3 -2
  194. package/themes/original/src/components/UserProfileForm/index.tsx +5 -0
  195. package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
  196. package/themes/original/src/components/Wallets/index.tsx +7 -4
  197. package/themes/original/src/components/Wallets/styles.tsx +2 -1
  198. package/themes/original/src/components/WebsocketStatus/index.tsx +172 -0
  199. package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
  200. package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
  201. package/themes/original/src/components/shared/OButton.tsx +5 -5
  202. package/themes/original/src/components/shared/OInput.tsx +1 -4
  203. package/themes/original/src/components/shared/OModal.tsx +12 -14
  204. package/themes/original/src/layouts/Container.tsx +5 -3
  205. package/themes/original/src/types/index.tsx +6 -1
  206. package/themes/original/src/utils/index.tsx +12 -1
  207. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.21.48",
3
+ "version": "0.21.49-release",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -52,13 +52,13 @@
52
52
  "@segment/analytics-react-native": "2.1.11",
53
53
  "@segment/sovran-react-native": "0.2.6",
54
54
  "@sentry/react-native": "^2.6.0",
55
- "@stripe/stripe-react-native": "^0.2.0",
55
+ "@stripe/stripe-react-native": "0.23.0",
56
56
  "@types/react-native-loading-spinner-overlay": "^0.5.2",
57
57
  "@types/react-native-snap-carousel": "^3.8.4",
58
58
  "@types/styled-components": "^5.1.3",
59
59
  "axios": "^0.21.0",
60
60
  "moment": "^2.29.1",
61
- "ordering-components": "github:Ordering-Inc/ordering-components#development",
61
+ "ordering-components": "github:Ordering-Inc/ordering-components#release",
62
62
  "patch-package": "^6.4.7",
63
63
  "postinstall-postinstall": "^2.1.0",
64
64
  "prop-types": "^15.7.2",
@@ -76,7 +76,7 @@
76
76
  "react-native-color-matrix-image-filters": "^5.2.10",
77
77
  "react-native-country-picker-modal": "^2.0.0",
78
78
  "react-native-credit-card-input": "^0.4.1",
79
- "react-native-date-picker": "^4.2.13",
79
+ "react-native-date-picker": "4.2.14",
80
80
  "react-native-device-info": "^8.7.1",
81
81
  "react-native-document-picker": "^5.2.0",
82
82
  "react-native-elements": "^3.0.0-alpha.1",
@@ -86,7 +86,7 @@
86
86
  "react-native-gesture-handler": "^1.8.0",
87
87
  "react-native-get-random-values": "1.8.0",
88
88
  "react-native-gifted-chat": "^0.16.3",
89
- "react-native-google-places-autocomplete": "^2.1.3",
89
+ "react-native-google-places-autocomplete": "2.1.3",
90
90
  "react-native-html-to-pdf": "^0.10.0",
91
91
  "react-native-image-picker": "^4.0.6",
92
92
  "react-native-intersection-observer": "^0.0.9",
@@ -116,7 +116,7 @@
116
116
  "react-native-tracking-transparency": "^0.1.1",
117
117
  "react-native-uuid": "^2.0.1",
118
118
  "react-native-vector-icons": "^7.1.0",
119
- "react-native-webview": "^11.22.7",
119
+ "react-native-webview": "^11.6.4",
120
120
  "react-native-youtube-iframe": "^2.2.2",
121
121
  "rn-placeholder": "^3.0.3",
122
122
  "styled-components": "^5.1.1",
@@ -128,8 +128,8 @@
128
128
  "@babel/core": "^7.11.6",
129
129
  "@babel/runtime": "^7.11.2",
130
130
  "@react-native-community/eslint-config": "^2.0.0",
131
- "@types/react": "^18.0.14",
132
- "@types/react-dom": "^18.0.5",
131
+ "@types/react": "^18.0.15",
132
+ "@types/react-dom": "^18.0.6",
133
133
  "@types/react-native": "^0.63.25",
134
134
  "@types/react-native-calendar-picker": "^7.0.2",
135
135
  "babel-jest": "^26.3.0",
@@ -7,7 +7,8 @@
7
7
  */
8
8
 
9
9
  import * as React from 'react';
10
- import { LogBox } from 'react-native';
10
+ import { LogBox, Platform } from 'react-native';
11
+ import * as Sentry from "@sentry/react-native";
11
12
  import { OrderingProvider } from 'ordering-components/native';
12
13
  import RNBootSplash from "react-native-bootsplash";
13
14
 
@@ -22,6 +23,47 @@ import theme from './theme.json';
22
23
  import AppContainer from './AppContainer';
23
24
  import { FacebookPixel } from './components/FacebookPixel';
24
25
 
26
+ Sentry.init({
27
+ environment: Platform.OS === 'ios' ? 'ios' : 'android',
28
+ dsn: 'https://e5e1115dc93b49109f4ab65f2098bef9@o460529.ingest.sentry.io/5722123',
29
+ release: 'ordering-ui-native@' + process.env.npm_package_version,
30
+ ignoreErrors: [
31
+ 'is not defined',
32
+ 'is not a function',
33
+ 'can\'t find variable',
34
+ 'objects are not valid',
35
+ 'element type is invalid',
36
+ 'requiring module',
37
+ 'has not been registered',
38
+ 'failed to connect to debugger!',
39
+ 'rendered more hooks than',
40
+ 'rendered fewer hooks than',
41
+ 'should have a queue',
42
+ 'the OS most likely terminated',
43
+ 'Connection timed out',
44
+ 'java.io.EOFException',
45
+ 'Abort',
46
+ 'Segfault',
47
+ 'Failed to allocate a',
48
+ 'Application Not Responding',
49
+ 'connection no longer valid',
50
+ 'IllegalInstruction',
51
+ 'React.Children.only expected to receive a single React element child.',
52
+ 'unrecognized selector sent to instance'
53
+ ],
54
+ tracesSampleRate: 0.2,
55
+ // Release health
56
+ enableAutoSessionTracking: true,
57
+ // Sessions close after app is 10 seconds in the background.
58
+ sessionTrackingIntervalMillis: 10000,
59
+
60
+ integrations: [
61
+ new Sentry.ReactNativeTracing({
62
+ routingInstrumentation: reactNavigationV5Instrumentation,
63
+ })
64
+ ]
65
+ });
66
+
25
67
  LogBox.ignoreLogs([
26
68
  'Sending \`onAnimatedValueUpdate` with no listeners registered.',
27
69
  'Non-serializable values were found in the navigation state.',
@@ -191,7 +191,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
191
191
  {isFarAway && (
192
192
  <FarAwayMessage style={styles.farAwayMsg}>
193
193
  <Ionicons name='md-warning-outline' style={styles.iconStyle} />
194
- <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</OText>
194
+ <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
195
195
  </FarAwayMessage>
196
196
  )}
197
197
  </OrderControlContainer>
@@ -156,6 +156,7 @@ export const PaymentOptionsWebView = (props: PaymentOptionsWebViewParams) => {
156
156
  user_id: user?.id,
157
157
  user_name: user?.name
158
158
  },
159
+ xappx: ordering?.appId,
159
160
  currency: configs?.stripe_currency?.value || currency,
160
161
  userToken: token,
161
162
  clientId: webviewPaymethod?.credentials?.client_id,
@@ -3,7 +3,6 @@ import { useLanguage, useConfig, useOrder } from 'ordering-components/native'
3
3
  import { useGooglePay, useApplePay } from '@stripe/stripe-react-native'
4
4
  import { Platform } from 'react-native';
5
5
  import { StripeMethodFormParams } from '../../types';
6
- import { android_app_id } from '../../config.json'
7
6
 
8
7
  export const StripeMethodForm = (props: StripeMethodFormParams) => {
9
8
  const {
@@ -17,7 +16,9 @@ export const StripeMethodForm = (props: StripeMethodFormParams) => {
17
16
  placeByMethodPay,
18
17
  methodPaySupported,
19
18
  setPlaceByMethodPay,
20
- cartTotal
19
+ cartTotal,
20
+ androidAppId,
21
+ businessNames
21
22
  } = props
22
23
  const { initGooglePay, createGooglePayPaymentMethod, loading } = useGooglePay();
23
24
  const { presentApplePay, isApplePaySupported } = useApplePay();
@@ -61,7 +62,7 @@ export const StripeMethodForm = (props: StripeMethodFormParams) => {
61
62
  })
62
63
  const { error } = await initGooglePay({
63
64
  testEnv: devMode,
64
- merchantName: android_app_id,
65
+ merchantName: androidAppId,
65
66
  countryCode: 'US',
66
67
  billingAddressConfig: {
67
68
  format: 'FULL',
@@ -152,7 +153,8 @@ export const StripeMethodForm = (props: StripeMethodFormParams) => {
152
153
 
153
154
  const { error, paymentMethod } = await presentApplePay({
154
155
  cartItems: [{
155
- label: t('CART', 'Cart'),
156
+ label: businessNames ? `${businessNames.join(', ')} ${t('VIA_CHEW_APP', 'via Chew App')}`
157
+ : `${cart?.business?.name} ${t('VIA_CHEW_APP', 'via Chew App')}`,
156
158
  amount: cartTotal?.toString?.() ?? cart?.balance?.toString() ?? cart?.total?.toString?.(),
157
159
  paymentType: 'Immediate'
158
160
  }],
@@ -2,7 +2,7 @@ import styled from 'styled-components/native';
2
2
 
3
3
  export const Container = styled.View`
4
4
  width: 100%;
5
- padding: 0 43px;
5
+ padding: 0 30px;
6
6
  `
7
7
 
8
8
  export const CountDownContainer = styled.View`
@@ -20,7 +20,6 @@ export const ResendSection = styled.View`
20
20
  display: flex;
21
21
  flex-direction: row;
22
22
  justify-content: center;
23
- flex-wrap: wrap;
24
23
  `
25
24
 
26
25
  export const WrappCountdown = styled.View`
@@ -494,5 +494,7 @@ export interface StripeMethodFormParams {
494
494
  placeByMethodPay?: any
495
495
  methodPaySupported?: any,
496
496
  setPlaceByMethodPay?: any,
497
- cartTotal?: number
497
+ cartTotal?: number,
498
+ androidAppId?: string,
499
+ businessNames?: Array<string>
498
500
  }
@@ -47,10 +47,10 @@ export const getTraduction = (key: string, t: any) => {
47
47
  */
48
48
  export const convertHoursToMinutes = (time: any) => {
49
49
  const [, t] = useLanguage()
50
- if (!time) return '0min'
50
+ if (!time) return `0 ${t('TIME_MIN', 'min')}`
51
51
  const [hour, minute] = time.split(':')
52
52
  const result = (parseInt(hour, 10) * 60) + parseInt(minute, 10)
53
- return `${result}${t('MIN', 'min')}`
53
+ return `${result}${t('TIME_MIN', 'min')}`
54
54
  }
55
55
 
56
56
  export const getIconCard = (brand: string, size: number) => {
@@ -1,6 +1,7 @@
1
1
  //Components
2
2
  import { AcceptOrRejectOrder } from './src/components/AcceptOrRejectOrder';
3
3
  import { BusinessController } from './src/components/BusinessController';
4
+ import { BusinessProductList } from './src/components/BusinessProductList';
4
5
  import { Chat } from './src/components/Chat';
5
6
  import { FloatingButton } from './src/components/FloatingButton';
6
7
  import { ForgotPasswordForm } from './src/components/ForgotPasswordForm';
@@ -28,6 +29,7 @@ import { OrderSummary } from './src/components/OrderSummary';
28
29
  import { PhoneInputNumber } from './src/components/PhoneInputNumber';
29
30
  import { PreviousMessages } from './src/components/PreviousMessages';
30
31
  import { PreviousOrders } from './src/components/PreviousOrders';
32
+ import { PrinterSettings } from './src/components/PrinterSettings';
31
33
  import { ProductItemAccordion } from './src/components/ProductItemAccordion';
32
34
  import { ReviewCustomer } from './src/components/ReviewCustomer'
33
35
  import { SearchBar } from './src/components/SearchBar';
@@ -42,6 +44,7 @@ import { NewOrderNotification } from './src/components/NewOrderNotification';
42
44
  import { DriverSchedule } from './src/components/DriverSchedule';
43
45
  import { ScheduleBlocked } from './src/components/ScheduleBlocked';
44
46
  import { OrderDetailsLogistic } from './src/components/OrderDetailsLogistic'
47
+ import { Sessions } from './src/components/Sessions';
45
48
  //OComponents
46
49
  import {
47
50
  OText,
@@ -70,6 +73,7 @@ export {
70
73
  //Components
71
74
  AcceptOrRejectOrder,
72
75
  BusinessController,
76
+ BusinessProductList,
73
77
  Chat,
74
78
  DriverMap,
75
79
  FloatingButton,
@@ -100,10 +104,12 @@ export {
100
104
  PhoneInputNumber,
101
105
  PreviousMessages,
102
106
  PreviousOrders,
107
+ PrinterSettings,
103
108
  ProductItemAccordion,
104
109
  ReviewCustomer,
105
110
  SafeAreaContainerLayout,
106
111
  SearchBar,
112
+ Sessions,
107
113
  SignupForm,
108
114
  StoresList,
109
115
  UserFormDetailsUI,
@@ -31,6 +31,7 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
31
31
  notShowCustomerPhone,
32
32
  orderTitle,
33
33
  appTitle,
34
+ isLoadingOrder
34
35
  } = props;
35
36
 
36
37
  const [, t] = useLanguage();
@@ -277,7 +278,7 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
277
278
  }
278
279
 
279
280
  bodyToSend.id = orderId;
280
- handleUpdateOrder && handleUpdateOrder(bodyToSend.status, bodyToSend);
281
+ handleUpdateOrder?.(bodyToSend.status, bodyToSend);
281
282
  };
282
283
 
283
284
  useEffect(() => {
@@ -517,7 +518,7 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
517
518
  ...styles.bottomParent,
518
519
  marginBottom: Platform.OS === 'ios'
519
520
  ? 30 : (keyboardState.height === 0)
520
- ? isPage ? 0 : 30
521
+ ? isPage ? 0 : 40
521
522
  : keyboardState.height - (isPage ? 20 : -10)
522
523
  }}
523
524
  >
@@ -529,7 +530,7 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
529
530
  style={{ borderRadius: 7, height: 45 }}
530
531
  parentStyle={{ width: '100%' }}
531
532
  textStyle={{ color: '#FFF', fontSize: 18 }}
532
- isDisabled={showTextArea && !comments}
533
+ isDisabled={(showTextArea && !comments) || isLoadingOrder}
533
534
  onClick={() => handleAcceptOrReject()}
534
535
  />
535
536
  </View>
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useEffect } from 'react';
2
- import { StyleSheet, View, ActivityIndicator } from 'react-native';
2
+ import { StyleSheet, View, ActivityIndicator, TouchableOpacity } from 'react-native';
3
3
  import ToggleSwitch from 'toggle-switch-react-native';
4
4
  import { useTheme } from 'styled-components/native';
5
5
  import {
@@ -14,7 +14,7 @@ import { OIcon, OText } from '../shared';
14
14
  import { BusinessControllerParams } from '../../types';
15
15
 
16
16
  export const BusinessControllerUI = (props: BusinessControllerParams) => {
17
- const { businessState, updateBusiness, isUpdateStore, setIsUpdateStore } =
17
+ const { businessState, updateBusiness, isUpdateStore, setIsUpdateStore, navigation } =
18
18
  props;
19
19
 
20
20
  const { loading, business, error } = businessState;
@@ -93,21 +93,18 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
93
93
  <>
94
94
  {business && (
95
95
  <Card key={business?.id}>
96
- <View style={{ flex: 1, flexDirection: 'row', alignItems: 'center' }}>
97
- <Logo style={styles.logo}>
98
- <OIcon
99
- url={optimizeImage(business?.logo, 'h_300,c_limit')}
100
- src={!business?.logo && theme?.images?.dummies?.businessLogo}
101
- style={styles.icon}
102
- />
103
- </Logo>
104
-
105
- <View
106
- style={{
107
- flex: 1,
108
- flexDirection: 'row',
109
- alignItems: 'flex-start',
110
- }}>
96
+ <View style={{ flexDirection: 'row', flex: 1 }}>
97
+ <TouchableOpacity
98
+ style={{ flex: 1, flexDirection: 'row', alignItems: 'center' }}
99
+ onPress={() => navigation && business?.slug && navigation.navigate('BusinessProductListing', { slug: business?.slug })}
100
+ >
101
+ <Logo style={styles.logo}>
102
+ <OIcon
103
+ url={optimizeImage(business?.logo, 'h_300,c_limit')}
104
+ src={!business?.logo && theme?.images?.dummies?.businessLogo}
105
+ style={styles.icon}
106
+ />
107
+ </Logo>
111
108
  <Information>
112
109
  <View style={styles.header}>
113
110
  <OText style={styles.title} numberOfLines={1}>
@@ -123,7 +120,12 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
123
120
  {business?.zipcode}
124
121
  </OText>
125
122
  </Information>
123
+ </TouchableOpacity>
126
124
 
125
+ <View
126
+ style={{
127
+ alignItems: 'flex-start',
128
+ }}>
127
129
  {loading && isUpdateStore ? (
128
130
  <ActivityIndicator size="small" color={theme.colors.primary} />
129
131
  ) : (
@@ -0,0 +1,63 @@
1
+ import { OText } from "../shared"
2
+ import React, { useState } from "react"
3
+ import { View } from "react-native"
4
+ import { TouchableOpacity } from "react-native-gesture-handler"
5
+ import AntDesignIcon from 'react-native-vector-icons/AntDesign'
6
+ import ToggleSwitch from 'toggle-switch-react-native';
7
+ import { useTheme } from 'styled-components/native';
8
+ import { CategoryTab } from './styles'
9
+
10
+ export const AccordionDropdown = (props: any) => {
11
+ const { category, IterateCategories, handlerClickCategory, updateCategory } = props
12
+
13
+ const theme = useTheme();
14
+ const [isOpen, setIsOpen] = useState(false)
15
+
16
+ const handleSwitch = (enabled: boolean, categoryId: any) => {
17
+ updateCategory && updateCategory(categoryId, { enabled })
18
+ };
19
+
20
+ return (
21
+ <View style={{ marginLeft: !!category?.parent_category_id ? 10 : 0 }}>
22
+ <CategoryTab>
23
+ <View style={{ flexDirection: 'row', alignItems: 'center', flex: 1, marginRight: 5 }}>
24
+ <TouchableOpacity onPress={() => setIsOpen(prev => !prev)} style={{ marginRight: 10 }}>
25
+ <AntDesignIcon
26
+ name={isOpen ? 'caretdown' : 'caretright'}
27
+ size={14}
28
+ />
29
+ </TouchableOpacity>
30
+ <TouchableOpacity onPress={() => handlerClickCategory(category)} style={{ flex: 1 }}>
31
+ <OText numberOfLines={1}>
32
+ {category.name}
33
+ </OText>
34
+ </TouchableOpacity>
35
+ </View>
36
+ <View>
37
+ <ToggleSwitch
38
+ isOn={category?.enabled}
39
+ onColor={theme.colors.primary}
40
+ offColor={theme.colors.offColor}
41
+ size="small"
42
+ onToggle={(value: boolean) => handleSwitch(value, category.id)}
43
+ // disabled={loading}
44
+ animationSpeed={200}
45
+ />
46
+ </View>
47
+ </CategoryTab>
48
+ {
49
+ isOpen && (
50
+ <View>
51
+ <IterateCategories
52
+ list={category.subcategories}
53
+ isSub
54
+ currentCat={category}
55
+ handlerClickCategory={handlerClickCategory}
56
+ updateCategory={updateCategory}
57
+ />
58
+ </View>
59
+ )
60
+ }
61
+ </View>
62
+ )
63
+ }
@@ -0,0 +1,108 @@
1
+ import React from "react"
2
+ import { View, TouchableOpacity } from "react-native"
3
+ import { OText } from "../shared"
4
+ import ToggleSwitch from 'toggle-switch-react-native';
5
+ import { AccordionDropdown } from './AccordionDropdown'
6
+ import { useTheme } from 'styled-components/native';
7
+ import { CategoryTab } from './styles'
8
+
9
+ export const IterateCategories = (props: any) => {
10
+ const { list, currentCat, isSub, handlerClickCategory, updateCategory } = props
11
+
12
+ const theme = useTheme();
13
+
14
+ const handleSwitch = (enabled: boolean, categoryId: any) => {
15
+ updateCategory && updateCategory(categoryId, { enabled })
16
+ };
17
+
18
+ return (
19
+ <>
20
+ {list?.length > 0 && list.map((category: any, i: number) => (
21
+ <View key={`${category?.id}_${i}`}>
22
+ {(category?.subcategories?.length > 0 || isSub) ? (
23
+ <>
24
+ {category?.subcategories?.length > 0 && (
25
+ <>
26
+ <View>
27
+ <AccordionDropdown
28
+ category={category}
29
+ IterateCategories={IterateCategories}
30
+ handlerClickCategory={handlerClickCategory}
31
+ updateCategory={updateCategory}
32
+ />
33
+ </View>
34
+ </>
35
+ )}
36
+ {isSub && !category?.subcategories?.length && (
37
+ <CategoryTab isSpace={!!category?.parent_category_id}>
38
+ <TouchableOpacity
39
+ style={{ flex: 1, marginRight: 5 }}
40
+ onPress={() => handlerClickCategory(category)}
41
+ >
42
+ <OText numberOfLines={1}>
43
+ {category.name}
44
+ </OText>
45
+ </TouchableOpacity>
46
+ <View>
47
+ <ToggleSwitch
48
+ isOn={category?.enabled}
49
+ onColor={theme.colors.primary}
50
+ offColor={theme.colors.offColor}
51
+ size="small"
52
+ onToggle={(value: boolean) => handleSwitch(value, category.id)}
53
+ // disabled={loading}
54
+ animationSpeed={200}
55
+ />
56
+ </View>
57
+ </CategoryTab>
58
+ )}
59
+ </>
60
+ ) : (
61
+ <CategoryTab
62
+ isSpace={!!category?.parent_category_id}
63
+ >
64
+ <TouchableOpacity onPress={() => handlerClickCategory(category)} style={{ flex: 1, marginRight: 5 }}>
65
+ <OText numberOfLines={1}>
66
+ {category.name}
67
+ </OText>
68
+ </TouchableOpacity>
69
+ <View>
70
+ <ToggleSwitch
71
+ isOn={category?.enabled}
72
+ onColor={theme.colors.primary}
73
+ offColor={theme.colors.offColor}
74
+ size="small"
75
+ onToggle={(value: boolean) => handleSwitch(value, category.id)}
76
+ // disabled={loading}
77
+ animationSpeed={200}
78
+ />
79
+ </View>
80
+ </CategoryTab>
81
+ )}
82
+ </View>
83
+ ))}
84
+ {list && list?.length === 0 && isSub && (
85
+ <CategoryTab
86
+ isSpace={!!currentCat?.parent_category_id}
87
+ >
88
+ <TouchableOpacity onPress={() => handlerClickCategory(currentCat)} style={{ flex: 1, marginRight: 5 }}>
89
+ <OText numberOfLines={1}>
90
+ {currentCat.name}
91
+ </OText>
92
+ </TouchableOpacity>
93
+ <View>
94
+ <ToggleSwitch
95
+ isOn={currentCat?.enabled}
96
+ onColor={theme.colors.primary}
97
+ offColor={theme.colors.offColor}
98
+ size="small"
99
+ onToggle={(value: boolean) => handleSwitch(value, currentCat.id)}
100
+ // disabled={loading}
101
+ animationSpeed={200}
102
+ />
103
+ </View>
104
+ </CategoryTab>
105
+ )}
106
+ </>
107
+ )
108
+ }