ordering-ui-react-native 0.21.33-test → 0.21.34-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 (215) hide show
  1. package/package.json +7 -6
  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 +4 -0
  10. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -2
  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/Chat/index.tsx +23 -14
  18. package/themes/business/src/components/DriverMap/index.tsx +36 -23
  19. package/themes/business/src/components/FloatingButton/index.tsx +34 -31
  20. package/themes/business/src/components/GoogleMap/index.tsx +15 -8
  21. package/themes/business/src/components/Home/index.tsx +5 -1
  22. package/themes/business/src/components/LanguageSelector/index.tsx +1 -2
  23. package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
  24. package/themes/business/src/components/MapView/index.tsx +16 -9
  25. package/themes/business/src/components/MessagesOption/index.tsx +2 -1
  26. package/themes/business/src/components/NewOrderNotification/index.tsx +55 -23
  27. package/themes/business/src/components/OrderDetails/Business.tsx +50 -2
  28. package/themes/business/src/components/OrderDetails/Delivery.tsx +23 -11
  29. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +61 -54
  30. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +52 -20
  31. package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
  32. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +6 -1
  33. package/themes/business/src/components/OrderSummary/index.tsx +240 -76
  34. package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
  35. package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
  36. package/themes/business/src/components/OrdersOption/index.tsx +124 -48
  37. package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
  38. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +36 -38
  39. package/themes/business/src/components/PreviousOrders/OrderList.tsx +18 -13
  40. package/themes/business/src/components/PreviousOrders/index.tsx +80 -66
  41. package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
  42. package/themes/business/src/components/PrinterSettings/index.tsx +279 -0
  43. package/themes/business/src/components/PrinterSettings/styles.tsx +17 -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 +107 -53
  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/hooks/useLocation.tsx +5 -4
  56. package/themes/business/src/types/index.tsx +15 -2
  57. package/themes/business/src/utils/index.tsx +5 -0
  58. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  59. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  60. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  61. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  62. package/themes/kiosk/src/components/LoginForm/index.tsx +7 -4
  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 +9 -4
  68. package/themes/original/src/components/AddressDetails/index.tsx +20 -10
  69. package/themes/original/src/components/AddressForm/index.tsx +27 -12
  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 +3 -3
  89. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  90. package/themes/original/src/components/BusinessProductsListing/index.tsx +35 -19
  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 +69 -0
  96. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
  97. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
  98. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +24 -404
  99. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  100. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  101. package/themes/original/src/components/Cart/index.tsx +32 -9
  102. package/themes/original/src/components/CartContent/index.tsx +96 -58
  103. package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
  104. package/themes/original/src/components/Checkout/index.tsx +160 -63
  105. package/themes/original/src/components/Checkout/styles.tsx +17 -0
  106. package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
  107. package/themes/original/src/components/DatePicker/index.tsx +33 -0
  108. package/themes/original/src/components/DatePicker/styles.tsx +20 -0
  109. package/themes/original/src/components/Favorite/index.tsx +9 -9
  110. package/themes/original/src/components/Favorite/styles.tsx +0 -2
  111. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  112. package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -0
  113. package/themes/original/src/components/GPSButton/index.tsx +1 -1
  114. package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
  115. package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
  116. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
  117. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
  118. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
  119. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +67 -4
  120. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
  121. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
  122. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
  123. package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
  124. package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
  125. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +83 -0
  126. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
  127. package/themes/original/src/components/GoogleMap/index.tsx +6 -5
  128. package/themes/original/src/components/Help/index.tsx +7 -0
  129. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +5 -0
  130. package/themes/original/src/components/HelpGuide/index.tsx +5 -0
  131. package/themes/original/src/components/HelpOrder/index.tsx +5 -0
  132. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +2 -2
  133. package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
  134. package/themes/original/src/components/Home/index.tsx +2 -1
  135. package/themes/original/src/components/LastOrder/index.tsx +2 -1
  136. package/themes/original/src/components/LastOrders/index.tsx +2 -1
  137. package/themes/original/src/components/LoginForm/Otp/index.tsx +4 -16
  138. package/themes/original/src/components/LoginForm/index.tsx +8 -3
  139. package/themes/original/src/components/MessageListing/index.tsx +6 -0
  140. package/themes/original/src/components/Messages/index.tsx +9 -7
  141. package/themes/original/src/components/Messages/styles.tsx +1 -1
  142. package/themes/original/src/components/MomentOption/index.tsx +19 -4
  143. package/themes/original/src/components/MultiCart/index.tsx +1 -1
  144. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +1 -0
  145. package/themes/original/src/components/MultiCheckout/index.tsx +208 -21
  146. package/themes/original/src/components/MultiCheckout/styles.tsx +17 -0
  147. package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -15
  148. package/themes/original/src/components/MyOrders/index.tsx +28 -28
  149. package/themes/original/src/components/NavBar/index.tsx +5 -1
  150. package/themes/original/src/components/NetworkError/index.tsx +2 -3
  151. package/themes/original/src/components/NetworkError/styles.tsx +2 -2
  152. package/themes/original/src/components/Notifications/index.tsx +9 -8
  153. package/themes/original/src/components/Notifications/styles.tsx +0 -1
  154. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +1 -1
  155. package/themes/original/src/components/OrderDetails/index.tsx +709 -665
  156. package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
  157. package/themes/original/src/components/OrderProgress/index.tsx +24 -4
  158. package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
  159. package/themes/original/src/components/OrderSummary/index.tsx +3 -1
  160. package/themes/original/src/components/OrderTypeSelector/index.tsx +10 -6
  161. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
  162. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
  163. package/themes/original/src/components/OrdersOption/index.tsx +3 -5
  164. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  165. package/themes/original/src/components/PaymentOptionCard/index.tsx +4 -2
  166. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
  167. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  168. package/themes/original/src/components/PaymentOptions/index.tsx +53 -6
  169. package/themes/original/src/components/PreviousOrders/index.tsx +2 -0
  170. package/themes/original/src/components/ProductForm/ActionButton.tsx +122 -0
  171. package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
  172. package/themes/original/src/components/ProductForm/index.tsx +67 -155
  173. package/themes/original/src/components/ProductItemAccordion/index.tsx +54 -44
  174. package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
  175. package/themes/original/src/components/ProductOptionSubOption/index.tsx +105 -91
  176. package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
  177. package/themes/original/src/components/Promotions/index.tsx +13 -11
  178. package/themes/original/src/components/Promotions/styles.tsx +0 -2
  179. package/themes/original/src/components/ReviewDriver/index.tsx +5 -0
  180. package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
  181. package/themes/original/src/components/ReviewOrder/index.tsx +5 -0
  182. package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
  183. package/themes/original/src/components/ReviewProducts/index.tsx +5 -0
  184. package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
  185. package/themes/original/src/components/ServiceForm/index.tsx +2 -2
  186. package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
  187. package/themes/original/src/components/Sessions/index.tsx +5 -0
  188. package/themes/original/src/components/SignupForm/index.tsx +66 -59
  189. package/themes/original/src/components/SingleOrderCard/index.tsx +3 -2
  190. package/themes/original/src/components/SingleProductCard/index.tsx +2 -2
  191. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
  192. package/themes/original/src/components/StripeCardsList/index.tsx +17 -36
  193. package/themes/original/src/components/StripeElementsForm/index.tsx +74 -59
  194. package/themes/original/src/components/StripeElementsForm/naked.tsx +47 -0
  195. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
  196. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +86 -0
  197. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
  198. package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
  199. package/themes/original/src/components/UserFormDetails/index.tsx +123 -75
  200. package/themes/original/src/components/UserFormDetails/styles.tsx +7 -0
  201. package/themes/original/src/components/UserProfile/index.tsx +3 -2
  202. package/themes/original/src/components/UserProfileForm/index.tsx +5 -0
  203. package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
  204. package/themes/original/src/components/Wallets/index.tsx +8 -4
  205. package/themes/original/src/components/Wallets/styles.tsx +1 -1
  206. package/themes/original/src/components/WebsocketStatus/index.tsx +172 -0
  207. package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
  208. package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
  209. package/themes/original/src/components/shared/OButton.tsx +5 -5
  210. package/themes/original/src/components/shared/OInput.tsx +1 -4
  211. package/themes/original/src/components/shared/OModal.tsx +12 -14
  212. package/themes/original/src/layouts/Container.tsx +5 -3
  213. package/themes/original/src/types/index.tsx +1 -0
  214. package/themes/original/src/utils/index.tsx +12 -1
  215. 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.33-test",
3
+ "version": "0.21.34-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,6 +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
80
  "react-native-device-info": "^8.7.1",
80
81
  "react-native-document-picker": "^5.2.0",
81
82
  "react-native-elements": "^3.0.0-alpha.1",
@@ -115,7 +116,7 @@
115
116
  "react-native-tracking-transparency": "^0.1.1",
116
117
  "react-native-uuid": "^2.0.1",
117
118
  "react-native-vector-icons": "^7.1.0",
118
- "react-native-webview": "^11.22.7",
119
+ "react-native-webview": "^11.6.4",
119
120
  "react-native-youtube-iframe": "^2.2.2",
120
121
  "rn-placeholder": "^3.0.3",
121
122
  "styled-components": "^5.1.1",
@@ -127,8 +128,8 @@
127
128
  "@babel/core": "^7.11.6",
128
129
  "@babel/runtime": "^7.11.2",
129
130
  "@react-native-community/eslint-config": "^2.0.0",
130
- "@types/react": "^18.0.14",
131
- "@types/react-dom": "^18.0.5",
131
+ "@types/react": "^18.0.15",
132
+ "@types/react-dom": "^18.0.6",
132
133
  "@types/react-native": "^0.63.25",
133
134
  "@types/react-native-calendar-picker": "^7.0.2",
134
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';
@@ -42,6 +43,7 @@ import { NewOrderNotification } from './src/components/NewOrderNotification';
42
43
  import { DriverSchedule } from './src/components/DriverSchedule';
43
44
  import { ScheduleBlocked } from './src/components/ScheduleBlocked';
44
45
  import { OrderDetailsLogistic } from './src/components/OrderDetailsLogistic'
46
+ import { Sessions } from './src/components/Sessions';
45
47
  //OComponents
46
48
  import {
47
49
  OText,
@@ -70,6 +72,7 @@ export {
70
72
  //Components
71
73
  AcceptOrRejectOrder,
72
74
  BusinessController,
75
+ BusinessProductList,
73
76
  Chat,
74
77
  DriverMap,
75
78
  FloatingButton,
@@ -104,6 +107,7 @@ export {
104
107
  ReviewCustomer,
105
108
  SafeAreaContainerLayout,
106
109
  SearchBar,
110
+ Sessions,
107
111
  SignupForm,
108
112
  StoresList,
109
113
  UserFormDetailsUI,
@@ -307,7 +307,11 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
307
307
  }, [])
308
308
 
309
309
  return (
310
- <KeyboardAvoidingView style={{ flex: 1 }}>
310
+ <KeyboardAvoidingView
311
+ enabled
312
+ behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
313
+ style={{ flex: 1 }}
314
+ >
311
315
  <View style={styles.parent}>
312
316
  <View style={styles.upper}>
313
317
  <TopActions>
@@ -511,7 +515,10 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
511
515
  <View
512
516
  style={{
513
517
  ...styles.bottomParent,
514
- marginBottom: (keyboardState.height === 0) ? isPage ? 0 : 30 : keyboardState.height - (isPage ? 20 : -10)
518
+ marginBottom: Platform.OS === 'ios'
519
+ ? 30 : (keyboardState.height === 0)
520
+ ? isPage ? 0 : 30
521
+ : keyboardState.height - (isPage ? 20 : -10)
515
522
  }}
516
523
  >
517
524
  <OButton
@@ -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
+ }