ordering-ui-react-native 0.16.48 → 0.16.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 (208) hide show
  1. package/package.json +6 -5
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/ActiveOrders/index.tsx +61 -63
  4. package/src/components/ActiveOrders/styles.tsx +8 -14
  5. package/src/components/BusinessBasicInformation/index.tsx +11 -19
  6. package/src/components/BusinessInformation/index.tsx +33 -4
  7. package/src/components/BusinessInformation/styles.tsx +2 -2
  8. package/src/components/BusinessProductsList/index.tsx +10 -10
  9. package/src/components/BusinessesListing/index.tsx +1 -1
  10. package/src/components/Checkout/index.tsx +2 -1
  11. package/src/components/LanguageSelector/index.tsx +21 -16
  12. package/src/components/Messages/index.tsx +2 -2
  13. package/src/components/NotificationSetting/index.tsx +85 -0
  14. package/src/components/OrdersOption/index.tsx +54 -56
  15. package/src/components/PaymentOptions/index.tsx +298 -345
  16. package/src/components/PaymentOptionsWebView/index.tsx +120 -121
  17. package/src/components/ReviewDriver/index.tsx +1 -1
  18. package/src/components/ReviewOrder/index.tsx +2 -2
  19. package/src/components/ReviewProducts/index.tsx +11 -0
  20. package/src/components/SingleProductReview/index.tsx +8 -5
  21. package/src/components/StripeElementsForm/index.tsx +25 -16
  22. package/src/components/VerifyPhone/styles.tsx +1 -2
  23. package/src/components/shared/OBottomPopup.tsx +6 -2
  24. package/src/components/shared/OToast.tsx +4 -4
  25. package/src/index.tsx +2 -0
  26. package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
  27. package/src/utils/index.tsx +2 -1
  28. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +259 -238
  29. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  30. package/themes/business/src/components/BusinessController/index.tsx +2 -2
  31. package/themes/business/src/components/Chat/index.tsx +40 -32
  32. package/themes/business/src/components/DriverMap/index.tsx +7 -5
  33. package/themes/business/src/components/DriverSchedule/index.tsx +36 -19
  34. package/themes/business/src/components/LoginForm/index.tsx +111 -74
  35. package/themes/business/src/components/MapView/index.tsx +12 -1
  36. package/themes/business/src/components/MessagesOption/index.tsx +11 -1
  37. package/themes/business/src/components/NewOrderNotification/index.tsx +26 -41
  38. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +40 -30
  39. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +3 -3
  40. package/themes/business/src/components/OrdersListManager/index.tsx +10 -3
  41. package/themes/business/src/components/OrdersOption/index.tsx +76 -77
  42. package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
  43. package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
  44. package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
  45. package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
  46. package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
  47. package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
  48. package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
  49. package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
  50. package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
  51. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
  52. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  53. package/themes/business/src/components/PreviousOrders/index.tsx +332 -244
  54. package/themes/business/src/components/PreviousOrders/styles.tsx +30 -2
  55. package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
  56. package/themes/business/src/components/ReviewCustomer/index.tsx +39 -15
  57. package/themes/business/src/components/ScheduleBlocked/index.tsx +2 -2
  58. package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
  59. package/themes/business/src/components/UserProfileForm/index.tsx +2 -0
  60. package/themes/business/src/components/shared/ODropDown.tsx +42 -8
  61. package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
  62. package/themes/business/src/components/shared/OLink.tsx +24 -12
  63. package/themes/business/src/components/shared/OText.tsx +3 -2
  64. package/themes/business/src/types/index.tsx +25 -11
  65. package/themes/business/src/utils/index.tsx +10 -0
  66. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  67. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  68. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  69. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  70. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  71. package/themes/kiosk/src/components/LoginForm/index.tsx +121 -10
  72. package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
  73. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  74. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  75. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  76. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  77. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  78. package/themes/kiosk/src/types/index.d.ts +2 -0
  79. package/themes/original/index.tsx +8 -0
  80. package/themes/original/src/components/AddressDetails/index.tsx +10 -8
  81. package/themes/original/src/components/AddressForm/index.tsx +157 -140
  82. package/themes/original/src/components/AddressList/index.tsx +1 -1
  83. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  84. package/themes/original/src/components/BusinessBasicInformation/index.tsx +218 -147
  85. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +2 -2
  86. package/themes/original/src/components/BusinessController/index.tsx +231 -114
  87. package/themes/original/src/components/BusinessController/styles.tsx +14 -9
  88. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  89. package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
  90. package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
  91. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
  92. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
  93. package/themes/original/src/components/BusinessListingSearch/index.tsx +109 -139
  94. package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
  95. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
  96. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
  97. package/themes/original/src/components/BusinessProductsList/index.tsx +59 -60
  98. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  99. package/themes/original/src/components/BusinessProductsListing/index.tsx +177 -80
  100. package/themes/original/src/components/BusinessProductsListing/styles.tsx +18 -11
  101. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
  102. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +35 -23
  103. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +3 -2
  104. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +275 -120
  105. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +47 -10
  106. package/themes/original/src/components/BusinessesListing/index.tsx +80 -25
  107. package/themes/original/src/components/Cart/index.tsx +82 -15
  108. package/themes/original/src/components/Cart/styles.tsx +4 -0
  109. package/themes/original/src/components/CartContent/index.tsx +22 -16
  110. package/themes/original/src/components/Checkout/index.tsx +114 -118
  111. package/themes/original/src/components/Checkout/styles.tsx +4 -3
  112. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  113. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  114. package/themes/original/src/components/DriverTips/index.tsx +4 -4
  115. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  116. package/themes/original/src/components/FavoriteList/index.tsx +69 -45
  117. package/themes/original/src/components/FloatingButton/index.tsx +13 -11
  118. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  119. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  120. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  121. package/themes/original/src/components/GoogleMap/index.tsx +20 -12
  122. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +25 -10
  123. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +4 -0
  124. package/themes/original/src/components/HelpGuide/index.tsx +9 -8
  125. package/themes/original/src/components/HelpOrder/index.tsx +9 -8
  126. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  127. package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
  128. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  129. package/themes/original/src/components/LoginForm/index.tsx +98 -41
  130. package/themes/original/src/components/LottieAnimation/index.tsx +69 -0
  131. package/themes/original/src/components/Messages/index.tsx +35 -20
  132. package/themes/original/src/components/MomentOption/index.tsx +8 -6
  133. package/themes/original/src/components/MultiCart/index.tsx +63 -0
  134. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
  135. package/themes/original/src/components/MultiCheckout/index.tsx +10 -2
  136. package/themes/original/src/components/MultiOrdersDetails/index.tsx +34 -16
  137. package/themes/original/src/components/MyOrders/index.tsx +88 -22
  138. package/themes/original/src/components/NavBar/index.tsx +11 -5
  139. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  140. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  141. package/themes/original/src/components/Notifications/index.tsx +148 -0
  142. package/themes/original/src/components/Notifications/styles.tsx +17 -0
  143. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +167 -0
  144. package/themes/original/src/components/OrderDetails/index.tsx +200 -39
  145. package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
  146. package/themes/original/src/components/OrderItAgain/index.tsx +75 -0
  147. package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
  148. package/themes/original/src/components/OrderProgress/index.tsx +77 -66
  149. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  150. package/themes/original/src/components/OrderSummary/index.tsx +2 -35
  151. package/themes/original/src/components/OrderTypeSelector/index.tsx +85 -36
  152. package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
  153. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +94 -98
  154. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  155. package/themes/original/src/components/OrdersOption/index.tsx +101 -56
  156. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  157. package/themes/original/src/components/PaymentOptions/index.tsx +1 -2
  158. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  159. package/themes/original/src/components/PlaceSpot/index.tsx +249 -47
  160. package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
  161. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  162. package/themes/original/src/components/ProductForm/index.tsx +639 -664
  163. package/themes/original/src/components/ProductForm/styles.tsx +10 -11
  164. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  165. package/themes/original/src/components/ProductOption/index.tsx +1 -1
  166. package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
  167. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +0 -1
  168. package/themes/original/src/components/ProfessionalFilter/index.tsx +2 -1
  169. package/themes/original/src/components/ProfessionalProfile/index.tsx +19 -8
  170. package/themes/original/src/components/Promotions/index.tsx +232 -219
  171. package/themes/original/src/components/Promotions/styles.tsx +7 -2
  172. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  173. package/themes/original/src/components/ReviewOrder/index.tsx +120 -108
  174. package/themes/original/src/components/ReviewOrder/styles.tsx +5 -7
  175. package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
  176. package/themes/original/src/components/ReviewTrigger/index.tsx +136 -0
  177. package/themes/original/src/components/ReviewTrigger/styles.tsx +41 -0
  178. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  179. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  180. package/themes/original/src/components/ServiceForm/index.tsx +341 -267
  181. package/themes/original/src/components/SignupForm/index.tsx +160 -113
  182. package/themes/original/src/components/SingleOrderCard/index.tsx +266 -183
  183. package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
  184. package/themes/original/src/components/SingleProductCard/index.tsx +198 -112
  185. package/themes/original/src/components/SingleProductCard/styles.tsx +3 -10
  186. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  187. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  188. package/themes/original/src/components/StripeElementsForm/index.tsx +13 -2
  189. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -5
  190. package/themes/original/src/components/UserDetails/index.tsx +5 -3
  191. package/themes/original/src/components/UserFormDetails/index.tsx +6 -48
  192. package/themes/original/src/components/UserProfile/index.tsx +56 -31
  193. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  194. package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
  195. package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
  196. package/themes/original/src/components/Wallets/index.tsx +176 -164
  197. package/themes/original/src/components/Wallets/styles.tsx +12 -8
  198. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  199. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  200. package/themes/original/src/components/shared/OBottomPopup.tsx +48 -15
  201. package/themes/original/src/components/shared/OButton.tsx +10 -3
  202. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  203. package/themes/original/src/components/shared/OInput.tsx +10 -1
  204. package/themes/original/src/layouts/Container.tsx +13 -9
  205. package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
  206. package/themes/original/src/types/index.tsx +86 -28
  207. package/themes/original/src/utils/index.tsx +103 -58
  208. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -5,147 +5,146 @@ import WebView from 'react-native-webview';
5
5
  import { ActivityIndicator } from 'react-native-paper';
6
6
 
7
7
  import {
8
- ToastType,
9
- useToast,
10
- useApi,
11
- useLanguage,
12
- useConfig
8
+ ToastType,
9
+ useToast,
10
+ useApi,
11
+ useLanguage,
12
+ useConfig
13
13
  } from 'ordering-components/native';
14
14
 
15
15
  import { OText } from '../shared';
16
16
 
17
17
  interface PaymentOptionsWebViewParams {
18
- onNavigationRedirect?: Function,
19
- uri?: any,
20
- user?: any,
21
- token?: any,
22
- cart?: any,
23
- currency?: any,
24
- webviewPaymethod?: any,
25
- setShowGateway?: any,
26
- setOpenOrderCreating?: any,
27
- locationId?: any
18
+ onNavigationRedirect?: Function,
19
+ uri?: any,
20
+ user?: any,
21
+ token?: any,
22
+ cart?: any,
23
+ currency?: any,
24
+ webviewPaymethod?: any,
25
+ setShowGateway?: any,
26
+ setOpenOrderCreating?: any,
27
+ locationId?: any
28
28
  }
29
29
  export const PaymentOptionsWebView = (props: PaymentOptionsWebViewParams) => {
30
- const {
31
- onNavigationRedirect,
32
- uri,
33
- user,
34
- token,
35
- cart,
36
- currency,
37
- webviewPaymethod,
38
- setShowGateway,
39
- setOpenOrderCreating,
40
- locationId
41
- } = props
30
+ const {
31
+ onNavigationRedirect,
32
+ uri,
33
+ user,
34
+ token,
35
+ cart,
36
+ currency,
37
+ webviewPaymethod,
38
+ setShowGateway,
39
+ setOpenOrderCreating,
40
+ locationId
41
+ } = props
42
42
 
43
- const webviewRef = useRef<any>(null)
44
- const [, { showToast }] = useToast();
45
- const [ordering] = useApi()
46
- const [{ configs }] = useConfig();
47
- const [, t] = useLanguage();
43
+ const webviewRef = useRef<any>(null)
44
+ const [, { showToast }] = useToast();
45
+ const [ordering] = useApi()
46
+ const [{ configs }] = useConfig();
47
+ const [, t] = useLanguage();
48
48
 
49
+
50
+ const [progClr, setProgClr] = useState('#424242');
51
+ const [prog, setProg] = useState(true);
49
52
 
50
- const [progClr, setProgClr] = useState('#424242');
51
- const [prog, setProg] = useState(true);
52
-
53
- const handleCloseWebview = () => {
53
+ const handleCloseWebview = () => {
54
54
  setProg(true);
55
55
  setShowGateway({ open: false, closedByUser: true })
56
56
  }
57
57
 
58
- const onMessage = (e: any) => {
59
- if (e?.nativeEvent?.data && e?.nativeEvent?.data !== 'undefined') {
60
- let payment = JSON.parse(e.nativeEvent.data);
58
+ const onMessage = (e: any) => {
59
+ if (e?.nativeEvent?.data && e?.nativeEvent?.data !== 'undefined') {
60
+ let payment = JSON.parse(e.nativeEvent.data);
61
61
 
62
- if (payment === 'api error') {
62
+ if (payment === 'api error' || payment === 'Cancelled by user') {
63
63
  setShowGateway({ closedByUser: true, open: false })
64
64
  setProg(true);
65
65
  }
66
66
 
67
- if (payment) {
68
- if (payment.error) {
69
- showToast(ToastType.Error, payment.result)
70
- setOpenOrderCreating && setOpenOrderCreating(false)
71
- } else if (payment?.result?.order?.uuid) {
72
- showToast(ToastType.Success, t('ORDER_PLACED_SUCCESSfULLY', 'The order was placed successfully'))
73
- onNavigationRedirect && onNavigationRedirect('OrderDetails', { orderId: payment?.result?.order?.uuid, isFromCheckout: true })
67
+ if (payment) {
68
+ if (payment.error) {
69
+ showToast(ToastType.Error, payment.result)
70
+ setOpenOrderCreating && setOpenOrderCreating(false)
71
+ } else if (payment?.result?.order?.uuid) {
72
+ showToast(ToastType.Success, t('ORDER_PLACED_SUCCESSfULLY', 'The order was placed successfully'))
73
+ onNavigationRedirect && onNavigationRedirect('OrderDetails', { orderId: payment?.result?.order?.uuid, isFromCheckout: true})
74
+ }
75
+ setProg(true);
76
+ setShowGateway({ closedByUser: false, open: false })
77
+ }
74
78
  }
75
- setProg(true);
76
- setShowGateway({ closedByUser: false, open: false })
77
- }
78
- }
79
- }
79
+ }
80
80
 
81
- return (
81
+ return (
82
82
  <View style={{ zIndex: 9999, height: '100%', width: '100%', position: 'absolute', backgroundColor: 'white' }}>
83
- <Icon
84
- name="x"
85
- size={35}
86
- style={{ backgroundColor: 'white', paddingTop: 30, paddingLeft: 10 }}
87
- onPress={handleCloseWebview}
88
- />
89
- <OText
90
- style={{
91
- textAlign: 'center',
92
- fontSize: 16,
93
- fontWeight: 'bold',
94
- color: '#00457C',
95
- marginBottom: 5,
96
- marginTop: 10
97
- }}>
98
- {webviewPaymethod?.gateway === 'paypal' ? (t('PAYPAL_GATEWAY', 'PayPal GateWay')) : (t('SQUARE_PAYMENT', 'Square payment'))}
99
- </OText>
100
- <View style={{ padding: 20, opacity: prog ? 1 : 0, backgroundColor: 'white' }}>
101
- <ActivityIndicator size={24} color={progClr} />
102
- </View>
103
- <WebView
104
- source={{ uri: uri }}
105
- onMessage={onMessage}
106
- ref={webviewRef}
107
- javaScriptEnabled={true}
108
- javaScriptEnabledAndroid={true}
109
- cacheEnabled={false}
110
- cacheMode='LOAD_NO_CACHE'
111
- style={{ flex: 1 }}
112
- onShouldStartLoadWithRequest={() => true}
113
- onLoadStart={() => {
114
- setProg(true);
115
- setProgClr('#424242');
116
- }}
117
- onLoadProgress={() => {
118
- setProg(true);
119
- setProgClr('#00457C');
120
- }}
121
- onLoad={() => {
122
- setProg(true);
123
- setProgClr('#00457C');
124
- }}
125
- onLoadEnd={(e) => {
126
- const messageParams = locationId ? { locationId, clientId: webviewPaymethod?.credentials?.application_id } : {}
127
- const message = {
128
- action: 'init',
129
- data: {
130
- urlPlace: `${ordering.root}/carts/${cart?.uuid}/place`,
131
- urlConfirm: `${ordering.root}/carts/${cart?.uuid}/confirm`,
132
- payData: {
133
- paymethod_id: webviewPaymethod?.id,
134
- amount: cart?.balance ?? cart?.total,
135
- delivery_zone_id: cart?.delivery_zone_id,
136
- user_id: user?.id,
137
- user_name: user?.name
138
- },
139
- currency: configs?.stripe_currency?.value || currency,
140
- userToken: token,
141
- clientId: webviewPaymethod?.credentials?.client_id,
142
- ...messageParams
143
- }
144
- }
145
- setProg(false);
146
- webviewRef?.current?.postMessage?.(JSON.stringify(message))
147
- }}
148
- />
83
+ <Icon
84
+ name="x"
85
+ size={35}
86
+ style={{ backgroundColor: 'white', paddingTop: 30, paddingLeft: 10 }}
87
+ onPress={handleCloseWebview}
88
+ />
89
+ <OText
90
+ style={{
91
+ textAlign: 'center',
92
+ fontSize: 16,
93
+ fontWeight: 'bold',
94
+ color: '#00457C',
95
+ marginBottom: 5,
96
+ marginTop: 10
97
+ }}>
98
+ {webviewPaymethod?.gateway === 'paypal' ? (t('PAYPAL_GATEWAY', 'PayPal GateWay')) : (t('SQUARE_PAYMENT', 'Square payment'))}
99
+ </OText>
100
+ <View style={{ padding: 20, opacity: prog ? 1 : 0, backgroundColor: 'white' }}>
101
+ <ActivityIndicator size={24} color={progClr} />
102
+ </View>
103
+ <WebView
104
+ source={{ uri: uri }}
105
+ onMessage={onMessage}
106
+ ref={webviewRef}
107
+ javaScriptEnabled={true}
108
+ javaScriptEnabledAndroid={true}
109
+ cacheEnabled={false}
110
+ cacheMode='LOAD_NO_CACHE'
111
+ style={{ flex: 1 }}
112
+ onShouldStartLoadWithRequest={() => true}
113
+ onLoadStart={() => {
114
+ setProg(true);
115
+ setProgClr('#424242');
116
+ }}
117
+ onLoadProgress={() => {
118
+ setProg(true);
119
+ setProgClr('#00457C');
120
+ }}
121
+ onLoad={() => {
122
+ setProg(true);
123
+ setProgClr('#00457C');
124
+ }}
125
+ onLoadEnd={(e) => {
126
+ const messageParams = locationId ? { locationId } : {}
127
+ const message = {
128
+ action: 'init',
129
+ data: {
130
+ urlPlace: `${ordering.root}/carts/${cart?.uuid}/place`,
131
+ urlConfirm: `${ordering.root}/carts/${cart?.uuid}/confirm`,
132
+ payData: {
133
+ paymethod_id: webviewPaymethod?.id,
134
+ amount: cart?.balance ?? cart?.total,
135
+ delivery_zone_id: cart?.delivery_zone_id,
136
+ user_id: user?.id,
137
+ user_name: user?.name
138
+ },
139
+ currency: configs?.stripe_currency?.value || currency,
140
+ userToken: token,
141
+ clientId: webviewPaymethod?.credentials?.client_id,
142
+ ...messageParams
143
+ }
144
+ }
145
+ setProg(false);
146
+ webviewRef?.current?.postMessage?.(JSON.stringify(message))
147
+ }}
148
+ />
149
149
  </View>
150
- )
151
- }
150
+ )}
@@ -218,7 +218,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
218
218
  <RatingBarContainer>
219
219
  <LinearGradient
220
220
  start={{ x: 0.0, y: 0.0 }}
221
- end={{ x: qualificationList[dirverReviews?.qualification - 1]?.percent || 0, y: 0 }}
221
+ end={{ x: qualificationList[dirverReviews?.qualification - 1]?.percent || 0.0001, y: 0 }}
222
222
  locations={[.9999, .9999]}
223
223
  colors={[theme.colors.primary, theme.colors.lightGray]}
224
224
  style={styles.statusBar}
@@ -106,7 +106,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
106
106
  }
107
107
 
108
108
  const qualificationList = [
109
- { key: 1, text: t('TERRIBLE', 'Terrible'), percent: 0.0001, parentStyle: { left: '0%' }, isInnerStyle: false, pointerColor: false },
109
+ { key: 1, text: t('TERRIBLE', 'Terrible'), percent: 0, parentStyle: { left: '0%' }, isInnerStyle: false, pointerColor: false },
110
110
  { key: 2, text: t('BAD', 'Bad'), percent: 0.25, parentStyle: { left: '25%' }, isInnerStyle: true, pointerColor: true },
111
111
  { key: 3, text: t('OKAY', 'Okay'), percent: 0.5, parentStyle: { left: '50%' }, isInnerStyle: true, pointerColor: true },
112
112
  { key: 4, text: t('GOOD', 'Good'), percent: 0.75, parentStyle: { left: '75%' }, isInnerStyle: true, pointerColor: true },
@@ -238,7 +238,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
238
238
  <RatingBarContainer>
239
239
  <LinearGradient
240
240
  start={{ x: 0.0, y: 0.0 }}
241
- end={{ x: qualificationList[stars.quality - 1]?.percent || 0.0, y: 0.0 }}
241
+ end={{ x: qualificationList[stars.quality - 1]?.percent || 0.0001, y: 0.0 }}
242
242
  locations={[.9999, .9999]}
243
243
  colors={[theme.colors.primary, theme.colors.lightGray]}
244
244
  style={styles.statusBar}
@@ -61,6 +61,17 @@ const ReviewProductsUI = (props: ReviewProductParams) => {
61
61
  }
62
62
  }, [formState])
63
63
 
64
+ useEffect(() => {
65
+ const _changes = order?.products.map(product => {
66
+ return {
67
+ product_id: product?.product_id,
68
+ comment: '',
69
+ qualification: 5
70
+ }
71
+ })
72
+ handleChangeFormState(_changes)
73
+ }, [])
74
+
64
75
  return (
65
76
  <>
66
77
  <ReviewProductsContainer>
@@ -1,10 +1,11 @@
1
1
  import React, { useState, useEffect } from 'react'
2
- import { useLanguage } from 'ordering-components/native'
3
- import { OText, OButton, OInput } from '../shared'
2
+ import { useLanguage, useUtils } from 'ordering-components/native'
3
+ import { OText, OButton, OInput, OIcon } from '../shared'
4
4
  import { StyleSheet, TouchableOpacity, View } from 'react-native'
5
5
  import AntDesignIcons from 'react-native-vector-icons/AntDesign'
6
6
  import { useTheme } from 'styled-components/native'
7
7
  import { SingleProductReviewParams } from '../../types'
8
+ import FastImage from 'react-native-fast-image'
8
9
 
9
10
  import {
10
11
  ProductContainer,
@@ -12,6 +13,7 @@ import {
12
13
  LikeHandsActionContainer,
13
14
  LikeHandsButton,
14
15
  CommentsButtonGroup,
16
+ LogoWrapper
15
17
  } from './styles'
16
18
 
17
19
  export const SingleProductReview = (props: SingleProductReviewParams) => {
@@ -23,6 +25,7 @@ export const SingleProductReview = (props: SingleProductReviewParams) => {
23
25
 
24
26
  const [, t] = useLanguage()
25
27
  const theme = useTheme()
28
+ const [{ optimizeImage }] = useUtils()
26
29
 
27
30
  const styles = StyleSheet.create({
28
31
  inputTextArea: {
@@ -37,7 +40,7 @@ export const SingleProductReview = (props: SingleProductReviewParams) => {
37
40
  flexDirection: 'row',
38
41
  justifyContent: 'center',
39
42
  marginVertical: 10,
40
- },
43
+ }
41
44
  })
42
45
 
43
46
  const [comments, setComments] = useState<Array<any>>([])
@@ -69,7 +72,7 @@ export const SingleProductReview = (props: SingleProductReviewParams) => {
69
72
  }
70
73
 
71
74
  useEffect(() => {
72
- if (comments?.length === 0 && !extraComment && formState.changes?.length === 0 && qualification === 5) return
75
+ if (comments?.length === 0 && !extraComment) return
73
76
  let _comments = ''
74
77
  if (comments.length > 0) {
75
78
  comments.map(comment => (_comments += comment.content + '. '))
@@ -129,7 +132,7 @@ export const SingleProductReview = (props: SingleProductReviewParams) => {
129
132
  style={{ height: 35, paddingLeft: 5, paddingRight: 5, marginHorizontal: 3, marginVertical: 10 }}
130
133
  imgRightSrc={isSelectedComment(commentItem.key) ? theme.images.general.close : null}
131
134
  imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
132
- onClick={() => handleChangeComment(commentItem) }
135
+ onClick={() => handleChangeComment(commentItem)}
133
136
  />
134
137
  ))}
135
138
  </CommentsButtonGroup>
@@ -7,7 +7,6 @@ import {
7
7
  useConfirmSetupIntent,
8
8
  createPaymentMethod
9
9
  } from '@stripe/stripe-react-native';
10
- import configs from '../../config.json'
11
10
  import { ErrorMessage } from './styles';
12
11
 
13
12
  import { StripeElementsForm as StripeFormController } from './naked';
@@ -26,7 +25,8 @@ const StripeElementsFormUI = (props: any) => {
26
25
  methodsPay,
27
26
  paymethod,
28
27
  onCancel,
29
- cart
28
+ cart,
29
+ merchantId
30
30
  } = props;
31
31
 
32
32
  const theme = useTheme();
@@ -54,17 +54,25 @@ const StripeElementsFormUI = (props: any) => {
54
54
  }
55
55
 
56
56
  if (user?.address) {
57
- billingDetails.addressLine1 = user?.address
58
- }
57
+ billingDetails.address = {
58
+ line1: user?.address
59
+ }
60
+ }
59
61
 
60
62
  const createPayMethod = async () => {
61
- const params: any = { type: 'Card' }
62
- if (Object.keys(billingDetails).length > 0) {
63
- params.billingDetails = billingDetails
64
- }
63
+ const params: any = { paymentMethodType: 'Card', paymentMethodData: {} }
64
+ if (Object.keys(billingDetails).length > 0) {
65
+ params.paymentMethodData.billingDetails = {...billingDetails, token: card?.last4}
66
+ }
65
67
  try {
66
68
  setCreatePmLoading(true)
67
- const { paymentMethod } = await createPaymentMethod(params);
69
+ const { paymentMethod, error } = await createPaymentMethod(params);
70
+
71
+ if (error) {
72
+ setErrors(error?.message);
73
+ setCreatePmLoading(false)
74
+ return
75
+ }
68
76
 
69
77
  setCreatePmLoading(false)
70
78
  handleSource && handleSource({
@@ -87,10 +95,10 @@ const StripeElementsFormUI = (props: any) => {
87
95
  createPayMethod();
88
96
  return
89
97
  }
90
- const params: any = { type: 'Card' }
91
- if (Object.keys(billingDetails).length > 0) {
92
- params.billingDetails = billingDetails
93
- }
98
+ const params: any = { paymentMethodType: 'Card', paymentMethodData: {} }
99
+ if (Object.keys(billingDetails).length > 0) {
100
+ params.paymentMethodData.billingDetails = {...billingDetails, token: card?.last4}
101
+ }
94
102
  try {
95
103
  const { setupIntent, error } = await confirmSetupIntent(requirements, params);
96
104
 
@@ -126,12 +134,13 @@ const StripeElementsFormUI = (props: any) => {
126
134
  <View style={styles.container}>
127
135
  {publicKey ? (
128
136
  <View style={{ flex: 1 }}>
129
- <StripeProvider
137
+ <StripeProvider
130
138
  publishableKey={publicKey}
131
- merchantIdentifier={`merchant.${configs.apple_app_id}`}
139
+ merchantIdentifier={`merchant.${merchantId}`}
140
+ urlScheme={merchantId}
132
141
  >
133
142
  {methodsPay?.includes(paymethod) ? (
134
- <StripeMethodForm
143
+ <StripeMethodForm
135
144
  handleSource={handleSource}
136
145
  onCancel={onCancel}
137
146
  cart={cart}
@@ -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`
@@ -4,14 +4,18 @@ const deviceHeight = Dimensions.get('window').height
4
4
 
5
5
  interface Props {
6
6
  open: boolean;
7
+ containerStyle: any;
7
8
  title?: string;
9
+ titleStyle?: any;
8
10
  children?: any;
9
11
  onClose?: any;
10
12
  }
11
13
  const OBottomPopup = (props: Props) => {
12
14
  const {
13
15
  open,
16
+ containerStyle,
14
17
  title,
18
+ titleStyle,
15
19
  onClose,
16
20
  children
17
21
  } = props
@@ -29,9 +33,9 @@ const OBottomPopup = (props: Props) => {
29
33
  >
30
34
  <View style={styles.touchableOutsideStyle} />
31
35
  </TouchableWithoutFeedback>
32
- <View style={styles.bottomContainer}>
36
+ <View style={{ ...styles.bottomContainer, ...containerStyle }}>
33
37
  <View>
34
- <Text style={styles.titleStyle}>
38
+ <Text style={{ ...styles.titleStyle, ...titleStyle }}>
35
39
  {title}
36
40
  </Text>
37
41
  {children}
@@ -1,11 +1,11 @@
1
1
  import * as React from "react";
2
- import { Animated, StyleSheet, Text, View } from "react-native";
2
+ import { Animated, StyleSheet, Text, View, Platform } from "react-native";
3
3
  import { ToastType, useToast, useLanguage } from "ordering-components/native";
4
4
  import { useTheme } from 'styled-components/native';
5
5
  import { getTraduction } from '../../utils'
6
6
 
7
7
  const fadeDuration = 300;
8
- const bottomPosition = 20;
8
+ const topPosition = Platform.OS === 'ios' ? 40 : 20
9
9
 
10
10
  export const Toast = (props: any) => {
11
11
  const [toastConfig, { hideToast }] = useToast();
@@ -54,7 +54,7 @@ export const Toast = (props: any) => {
54
54
  backgroundColor = theme.colors.toastInfo || '#6BA4FF';
55
55
  break;
56
56
  case ToastType.Error:
57
- backgroundColor = theme.colors.toastError || '#D83520' ;
57
+ backgroundColor = theme.colors.toastError || '#D83520';
58
58
  break;
59
59
  case ToastType.Success:
60
60
  backgroundColor = theme.colors.toastSuccess || '#90C68E';
@@ -65,7 +65,7 @@ export const Toast = (props: any) => {
65
65
  <Animated.View
66
66
  style={[
67
67
  styles.container,
68
- { bottom: bottomPosition, opacity },
68
+ { top: topPosition, opacity },
69
69
  ]}
70
70
  >
71
71
  <View style={[styles.toast, { backgroundColor }]}>
package/src/index.tsx CHANGED
@@ -36,6 +36,7 @@ import { LogoutButton } from './components/LogoutButton';
36
36
  import { Messages } from './components/Messages';
37
37
  import { MomentOption } from './components/MomentOption';
38
38
  import NavBar from './components/NavBar';
39
+ import { NotificationSetting } from './components/NotificationSetting'
39
40
  import { NotFoundSource } from './components/NotFoundSource';
40
41
  import { OrderCreating } from './components/OrderCreating';
41
42
  import { OrderDetails } from './components/OrderDetails';
@@ -136,6 +137,7 @@ export {
136
137
  Messages,
137
138
  MomentOption,
138
139
  NavBar,
140
+ NotificationSetting,
139
141
  NotFoundSource,
140
142
  OrderCreating,
141
143
  OrderDetails,
@@ -0,0 +1 @@
1
+ declare module '@fatnlazycat/react-native-recaptcha-v3'
@@ -34,7 +34,8 @@ export const getTraduction = (key: string, t: any) => {
34
34
  ERROR_ADD_PRODUCT_VERY_FAR_FOR_DELIVERY: 'Error adding product, very far for delivery',
35
35
  ERROR_PRODUCT_NOT_FOUND: 'Error with the product',
36
36
  ERROR_ADD_BUSINESS_INVALID: 'An error occurred with the business',
37
- ERROR_INVALID_OFFER: 'The offer doesn\'t exist'
37
+ ERROR_INVALID_OFFER: 'The offer doesn\'t exist',
38
+ ERROR_ADD_PRODUCT_BEFORE_ADDRESS: 'You must have an address'
38
39
  }
39
40
 
40
41
  return keyList[key] ? t(key, keyList[key]) : t(key)