ordering-ui-react-native 0.12.54 → 0.12.58

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 (205) hide show
  1. package/package.json +1 -1
  2. package/src/components/Cart/index.tsx +50 -16
  3. package/src/components/OrderDetails/index.tsx +8 -0
  4. package/src/components/OrderSummary/index.tsx +38 -3
  5. package/src/layouts/Container.tsx +1 -1
  6. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +8 -0
  7. package/themes/business/src/components/OrderDetails/styles.tsx +1 -0
  8. package/themes/business/src/layouts/Container.tsx +3 -1
  9. package/themes/doordash/src/components/Cart/index.tsx +36 -2
  10. package/themes/doordash/src/components/OrderDetails/index.tsx +8 -0
  11. package/themes/doordash/src/components/OrderSummary/index.tsx +36 -3
  12. package/themes/doordash/src/layouts/Container.tsx +1 -1
  13. package/themes/instacart/src/components/Cart/index.tsx +37 -3
  14. package/themes/instacart/src/components/OrderDetails/index.tsx +8 -0
  15. package/themes/instacart/src/components/OrderSummary/index.tsx +37 -4
  16. package/themes/instacart/src/layouts/Container.tsx +1 -1
  17. package/themes/kiosk/src/layouts/Container.tsx +2 -1
  18. package/themes/original/src/components/Cart/index.tsx +268 -234
  19. package/themes/original/src/components/OrderDetails/index.tsx +723 -715
  20. package/themes/original/src/components/OrderSummary/index.tsx +37 -3
  21. package/themes/original/src/layouts/Container.tsx +1 -1
  22. package/themes/single-business/src/components/Cart/index.tsx +92 -16
  23. package/themes/single-business/src/components/Cart/styles.tsx +39 -0
  24. package/themes/single-business/src/components/CartContent/index.tsx +56 -52
  25. package/themes/single-business/src/components/CartContent/styles.tsx +2 -16
  26. package/themes/single-business/src/components/PhoneInputNumber/index.tsx +103 -112
  27. package/themes/single-business/src/components/UserDetails/index.tsx +107 -111
  28. package/themes/single-business/src/components/UserDetails/styles.tsx +3 -8
  29. package/themes/single-business/src/components/UserFormDetails/index.tsx +279 -326
  30. package/themes/single-business/src/components/UserFormDetails/styles.tsx +7 -5
  31. package/themes/single-business/src/layouts/Container.tsx +1 -1
  32. package/themes/uber-eats/src/components/Cart/index.tsx +37 -3
  33. package/themes/uber-eats/src/components/OrderDetails/index.tsx +8 -0
  34. package/themes/uber-eats/src/components/OrderSummary/index.tsx +40 -6
  35. package/themes/uber-eats/src/layouts/Container.tsx +1 -1
  36. package/themes/franchises/index.tsx +0 -111
  37. package/themes/franchises/src/components/ActiveOrders/index.tsx +0 -134
  38. package/themes/franchises/src/components/ActiveOrders/styles.tsx +0 -44
  39. package/themes/franchises/src/components/AddressDetails/index.tsx +0 -77
  40. package/themes/franchises/src/components/AddressDetails/styles.tsx +0 -21
  41. package/themes/franchises/src/components/AddressForm/index.tsx +0 -837
  42. package/themes/franchises/src/components/AddressForm/styles.tsx +0 -27
  43. package/themes/franchises/src/components/AddressList/index.tsx +0 -338
  44. package/themes/franchises/src/components/AddressList/styles.tsx +0 -20
  45. package/themes/franchises/src/components/AppleLogin/index.tsx +0 -149
  46. package/themes/franchises/src/components/AppleLogin/styles.tsx +0 -21
  47. package/themes/franchises/src/components/BottomWrapper/index.tsx +0 -29
  48. package/themes/franchises/src/components/BusinessBasicInformation/index.tsx +0 -310
  49. package/themes/franchises/src/components/BusinessBasicInformation/styles.tsx +0 -66
  50. package/themes/franchises/src/components/BusinessController/index.tsx +0 -184
  51. package/themes/franchises/src/components/BusinessController/styles.tsx +0 -64
  52. package/themes/franchises/src/components/BusinessFeaturedController/index.tsx +0 -189
  53. package/themes/franchises/src/components/BusinessFeaturedController/styles.tsx +0 -50
  54. package/themes/franchises/src/components/BusinessInformation/index.tsx +0 -202
  55. package/themes/franchises/src/components/BusinessInformation/styles.tsx +0 -39
  56. package/themes/franchises/src/components/BusinessItemAccordion/index.tsx +0 -125
  57. package/themes/franchises/src/components/BusinessItemAccordion/styles.tsx +0 -54
  58. package/themes/franchises/src/components/BusinessProductsCategories/index.tsx +0 -87
  59. package/themes/franchises/src/components/BusinessProductsCategories/styles.tsx +0 -8
  60. package/themes/franchises/src/components/BusinessProductsList/index.tsx +0 -199
  61. package/themes/franchises/src/components/BusinessProductsList/styles.tsx +0 -14
  62. package/themes/franchises/src/components/BusinessProductsListing/index.tsx +0 -292
  63. package/themes/franchises/src/components/BusinessProductsListing/styles.tsx +0 -30
  64. package/themes/franchises/src/components/BusinessReviews/index.tsx +0 -249
  65. package/themes/franchises/src/components/BusinessReviews/styles.tsx +0 -59
  66. package/themes/franchises/src/components/BusinessTypeFilter/index.tsx +0 -127
  67. package/themes/franchises/src/components/BusinessTypeFilter/styles.tsx +0 -40
  68. package/themes/franchises/src/components/BusinessesListing/index.tsx +0 -339
  69. package/themes/franchises/src/components/BusinessesListing/styles.tsx +0 -92
  70. package/themes/franchises/src/components/Cart/index.tsx +0 -298
  71. package/themes/franchises/src/components/Cart/styles.tsx +0 -28
  72. package/themes/franchises/src/components/CartContent/index.tsx +0 -60
  73. package/themes/franchises/src/components/CartContent/styles.tsx +0 -19
  74. package/themes/franchises/src/components/Checkout/index.tsx +0 -664
  75. package/themes/franchises/src/components/Checkout/styles.tsx +0 -89
  76. package/themes/franchises/src/components/CouponControl/index.tsx +0 -119
  77. package/themes/franchises/src/components/CouponControl/styles.tsx +0 -22
  78. package/themes/franchises/src/components/DriverTips/index.tsx +0 -167
  79. package/themes/franchises/src/components/DriverTips/styles.tsx +0 -63
  80. package/themes/franchises/src/components/FacebookLogin/index.tsx +0 -107
  81. package/themes/franchises/src/components/FacebookLogin/styles.tsx +0 -21
  82. package/themes/franchises/src/components/FloatingButton/index.tsx +0 -100
  83. package/themes/franchises/src/components/FloatingButton/styles.tsx +0 -26
  84. package/themes/franchises/src/components/ForgotPasswordForm/index.tsx +0 -156
  85. package/themes/franchises/src/components/ForgotPasswordForm/styles.tsx +0 -11
  86. package/themes/franchises/src/components/GPSButton/index.tsx +0 -84
  87. package/themes/franchises/src/components/GPSButton/styles.ts +0 -6
  88. package/themes/franchises/src/components/GoogleLogin/index.tsx +0 -122
  89. package/themes/franchises/src/components/GoogleLogin/styles.tsx +0 -23
  90. package/themes/franchises/src/components/GoogleMap/index.tsx +0 -229
  91. package/themes/franchises/src/components/Help/index.tsx +0 -56
  92. package/themes/franchises/src/components/Help/styles.tsx +0 -11
  93. package/themes/franchises/src/components/HelpAccountAndPayment/index.tsx +0 -68
  94. package/themes/franchises/src/components/HelpAccountAndPayment/styles.tsx +0 -6
  95. package/themes/franchises/src/components/HelpGuide/index.tsx +0 -67
  96. package/themes/franchises/src/components/HelpGuide/styles.tsx +0 -6
  97. package/themes/franchises/src/components/HelpOrder/index.tsx +0 -79
  98. package/themes/franchises/src/components/HelpOrder/styles.tsx +0 -6
  99. package/themes/franchises/src/components/Home/index.tsx +0 -102
  100. package/themes/franchises/src/components/Home/styles.tsx +0 -18
  101. package/themes/franchises/src/components/LanguageSelector/index.tsx +0 -98
  102. package/themes/franchises/src/components/LanguageSelector/styles.tsx +0 -7
  103. package/themes/franchises/src/components/LastOrder/index.tsx +0 -168
  104. package/themes/franchises/src/components/LastOrder/styles.tsx +0 -16
  105. package/themes/franchises/src/components/LastOrders/index.tsx +0 -104
  106. package/themes/franchises/src/components/LastOrders/styles.tsx +0 -17
  107. package/themes/franchises/src/components/LoginForm/index.tsx +0 -512
  108. package/themes/franchises/src/components/LoginForm/styles.tsx +0 -77
  109. package/themes/franchises/src/components/LogoutButton/index.tsx +0 -36
  110. package/themes/franchises/src/components/Messages/index.tsx +0 -359
  111. package/themes/franchises/src/components/Messages/styles.tsx +0 -20
  112. package/themes/franchises/src/components/MomentOption/index.tsx +0 -321
  113. package/themes/franchises/src/components/MomentOption/styles.tsx +0 -66
  114. package/themes/franchises/src/components/NavBar/index.tsx +0 -129
  115. package/themes/franchises/src/components/NotFoundSource/index.tsx +0 -50
  116. package/themes/franchises/src/components/NotFoundSource/styles.tsx +0 -16
  117. package/themes/franchises/src/components/Notifications/index.tsx +0 -120
  118. package/themes/franchises/src/components/Notifications/styles.ts +0 -21
  119. package/themes/franchises/src/components/OrderDetails/index.tsx +0 -820
  120. package/themes/franchises/src/components/OrderDetails/styles.tsx +0 -120
  121. package/themes/franchises/src/components/OrderSummary/index.tsx +0 -232
  122. package/themes/franchises/src/components/OrderSummary/styles.tsx +0 -41
  123. package/themes/franchises/src/components/OrderTypeSelector/index.tsx +0 -92
  124. package/themes/franchises/src/components/OrderTypeSelector/styles.tsx +0 -27
  125. package/themes/franchises/src/components/OrdersOption/index.tsx +0 -243
  126. package/themes/franchises/src/components/OrdersOption/styles.tsx +0 -5
  127. package/themes/franchises/src/components/PaymentOptionCash/index.tsx +0 -102
  128. package/themes/franchises/src/components/PaymentOptionCash/styles.tsx +0 -18
  129. package/themes/franchises/src/components/PaymentOptionStripe/index.tsx +0 -234
  130. package/themes/franchises/src/components/PaymentOptionStripe/styles.tsx +0 -71
  131. package/themes/franchises/src/components/PaymentOptions/index.tsx +0 -430
  132. package/themes/franchises/src/components/PaymentOptions/styles.tsx +0 -77
  133. package/themes/franchises/src/components/PhoneInputNumber/index.tsx +0 -127
  134. package/themes/franchises/src/components/PhoneInputNumber/styles.tsx +0 -3
  135. package/themes/franchises/src/components/PreviousOrders/index.tsx +0 -188
  136. package/themes/franchises/src/components/PreviousOrders/styles.tsx +0 -33
  137. package/themes/franchises/src/components/ProductForm/index.tsx +0 -695
  138. package/themes/franchises/src/components/ProductForm/styles.tsx +0 -78
  139. package/themes/franchises/src/components/ProductIngredient/index.tsx +0 -43
  140. package/themes/franchises/src/components/ProductIngredient/styles.tsx +0 -7
  141. package/themes/franchises/src/components/ProductItemAccordion/index.tsx +0 -276
  142. package/themes/franchises/src/components/ProductItemAccordion/styles.tsx +0 -57
  143. package/themes/franchises/src/components/ProductOption/index.tsx +0 -50
  144. package/themes/franchises/src/components/ProductOption/styles.tsx +0 -11
  145. package/themes/franchises/src/components/ProductOptionSubOption/index.tsx +0 -146
  146. package/themes/franchises/src/components/ProductOptionSubOption/styles.tsx +0 -32
  147. package/themes/franchises/src/components/ReviewDriver/index.tsx +0 -221
  148. package/themes/franchises/src/components/ReviewDriver/styles.tsx +0 -46
  149. package/themes/franchises/src/components/ReviewOrder/index.tsx +0 -325
  150. package/themes/franchises/src/components/ReviewOrder/styles.tsx +0 -46
  151. package/themes/franchises/src/components/ReviewProduct/index.tsx +0 -275
  152. package/themes/franchises/src/components/ReviewProduct/styles.tsx +0 -53
  153. package/themes/franchises/src/components/SearchBar/index.tsx +0 -139
  154. package/themes/franchises/src/components/SignupForm/index.tsx +0 -643
  155. package/themes/franchises/src/components/SignupForm/styles.tsx +0 -27
  156. package/themes/franchises/src/components/SingleProductCard/index.tsx +0 -124
  157. package/themes/franchises/src/components/SingleProductCard/styles.tsx +0 -23
  158. package/themes/franchises/src/components/StripeCardForm/index.tsx +0 -97
  159. package/themes/franchises/src/components/StripeCardForm/naked.tsx +0 -128
  160. package/themes/franchises/src/components/StripeCardForm/styles.tsx +0 -32
  161. package/themes/franchises/src/components/StripeCardsList/index.tsx +0 -182
  162. package/themes/franchises/src/components/StripeElementsForm/index.tsx +0 -204
  163. package/themes/franchises/src/components/StripeElementsForm/naked.tsx +0 -90
  164. package/themes/franchises/src/components/StripeElementsForm/styles.tsx +0 -13
  165. package/themes/franchises/src/components/StripeRedirectForm/index.tsx +0 -159
  166. package/themes/franchises/src/components/StripeRedirectForm/styles.tsx +0 -23
  167. package/themes/franchises/src/components/TagSelector/index.tsx +0 -94
  168. package/themes/franchises/src/components/TagSelector/styles.ts +0 -0
  169. package/themes/franchises/src/components/TaxInformation/index.tsx +0 -51
  170. package/themes/franchises/src/components/TaxInformation/styles.tsx +0 -9
  171. package/themes/franchises/src/components/UpsellingProducts/index.tsx +0 -222
  172. package/themes/franchises/src/components/UpsellingProducts/styles.tsx +0 -50
  173. package/themes/franchises/src/components/UserDetails/index.tsx +0 -134
  174. package/themes/franchises/src/components/UserDetails/styles.tsx +0 -26
  175. package/themes/franchises/src/components/UserFormDetails/index.tsx +0 -351
  176. package/themes/franchises/src/components/UserFormDetails/styles.tsx +0 -35
  177. package/themes/franchises/src/components/UserProfile/index.tsx +0 -179
  178. package/themes/franchises/src/components/UserProfile/styles.ts +0 -42
  179. package/themes/franchises/src/components/UserProfileForm/index.tsx +0 -253
  180. package/themes/franchises/src/components/UserProfileForm/styles.tsx +0 -29
  181. package/themes/franchises/src/components/VerifyPhone/index.tsx +0 -188
  182. package/themes/franchises/src/components/VerifyPhone/styles.tsx +0 -43
  183. package/themes/franchises/src/components/shared/OAlert.tsx +0 -55
  184. package/themes/franchises/src/components/shared/OBottomPopup.tsx +0 -73
  185. package/themes/franchises/src/components/shared/OBottomStickBar.tsx +0 -62
  186. package/themes/franchises/src/components/shared/OButton.tsx +0 -132
  187. package/themes/franchises/src/components/shared/ODropDown.tsx +0 -169
  188. package/themes/franchises/src/components/shared/OIcon.tsx +0 -53
  189. package/themes/franchises/src/components/shared/OIconButton.tsx +0 -127
  190. package/themes/franchises/src/components/shared/OIconText.tsx +0 -54
  191. package/themes/franchises/src/components/shared/OInput.tsx +0 -113
  192. package/themes/franchises/src/components/shared/OKeyButton.tsx +0 -35
  193. package/themes/franchises/src/components/shared/OModal.tsx +0 -172
  194. package/themes/franchises/src/components/shared/OText.tsx +0 -52
  195. package/themes/franchises/src/components/shared/OTextarea.tsx +0 -36
  196. package/themes/franchises/src/components/shared/OToast.tsx +0 -93
  197. package/themes/franchises/src/components/shared/OToggle.tsx +0 -158
  198. package/themes/franchises/src/components/shared/index.tsx +0 -29
  199. package/themes/franchises/src/config/constants.tsx +0 -57
  200. package/themes/franchises/src/layouts/Container.tsx +0 -23
  201. package/themes/franchises/src/layouts/SafeAreaContainer.tsx +0 -6
  202. package/themes/franchises/src/providers/AlertProvider.tsx +0 -43
  203. package/themes/franchises/src/providers/StoreUtil.tsx +0 -50
  204. package/themes/franchises/src/types/index.tsx +0 -445
  205. package/themes/franchises/src/utils/index.tsx +0 -222
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.12.54",
3
+ "version": "0.12.58",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -16,14 +16,14 @@ import { ProductItemAccordion } from '../ProductItemAccordion';
16
16
  import { BusinessItemAccordion } from '../BusinessItemAccordion';
17
17
  import { CouponControl } from '../CouponControl';
18
18
 
19
- import { OButton, OModal, OText } from '../shared';
19
+ import { OButton, OModal, OText, OInput } from '../shared';
20
20
  import { ProductForm } from '../ProductForm';
21
21
  import { UpsellingProducts } from '../UpsellingProducts';
22
22
  import { verifyDecimals } from '../../utils';
23
23
  import { useTheme } from 'styled-components/native';
24
24
  import AntIcon from 'react-native-vector-icons/AntDesign'
25
25
  import { TaxInformation } from '../TaxInformation';
26
- import { TouchableOpacity } from 'react-native';
26
+ import { ActivityIndicator, TouchableOpacity, View } from 'react-native';
27
27
 
28
28
  const CartUI = (props: any) => {
29
29
  const {
@@ -35,6 +35,8 @@ const CartUI = (props: any) => {
35
35
  removeProduct,
36
36
  handleCartOpen,
37
37
  setIsCartsLoading,
38
+ handleChangeComment,
39
+ commentState
38
40
  } = props
39
41
 
40
42
  const theme = useTheme()
@@ -180,19 +182,19 @@ const CartUI = (props: any) => {
180
182
  ))
181
183
  }
182
184
  {
183
- cart?.fees?.length > 0 && cart?.fees?.filter((fee : any) => !(fee.fixed === 0 && fee.percentage === 0)).map((fee: any) => (
184
- <OSTable key={fee?.id}>
185
- <OSRow>
186
- <OText numberOfLines={1}>
187
- {fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}{' '}
188
- ({parsePrice(fee?.fixed)} + {fee?.percentage}%){' '}
189
- </OText>
190
- <TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: fee })} >
191
- <AntIcon name='exclamationcircleo' size={18} color={theme.colors.primary} />
192
- </TouchableOpacity>
193
- </OSRow>
194
- <OText>{parsePrice(fee?.summary?.fixed + fee?.summary?.percentage || 0)}</OText>
195
- </OSTable>
185
+ cart?.fees?.length > 0 && cart?.fees?.filter((fee: any) => !(fee.fixed === 0 && fee.percentage === 0)).map((fee: any) => (
186
+ <OSTable key={fee?.id}>
187
+ <OSRow>
188
+ <OText numberOfLines={1}>
189
+ {fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}{' '}
190
+ ({parsePrice(fee?.fixed)} + {fee?.percentage}%){' '}
191
+ </OText>
192
+ <TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: fee })} >
193
+ <AntIcon name='exclamationcircleo' size={18} color={theme.colors.primary} />
194
+ </TouchableOpacity>
195
+ </OSRow>
196
+ <OText>{parsePrice(fee?.summary?.fixed + fee?.summary?.percentage || 0)}</OText>
197
+ </OSTable>
196
198
  ))
197
199
  }
198
200
  {orderState?.options?.type === 1 && cart?.delivery_price > 0 && (
@@ -235,6 +237,38 @@ const CartUI = (props: any) => {
235
237
  </OText>
236
238
  </OSTable>
237
239
  </OSTotal>
240
+ {cart?.status !== 2 && (
241
+ <OSTable>
242
+ <View style={{ width: '100%', marginTop: 20 }}>
243
+ <OText>{t('COMMENTS', 'Comments')}</OText>
244
+ <View style={{ flex: 1, width: '100%' }}>
245
+ <OInput
246
+ value={cart?.comment}
247
+ placeholder={t('SPECIAL_COMMENTS', 'Special Comments')}
248
+ onChange={(value: string) => handleChangeComment(value)}
249
+ style={{
250
+ alignItems: 'flex-start',
251
+ width: '100%',
252
+ height: 100,
253
+ borderColor: theme.colors.textSecondary,
254
+ paddingRight: 50,
255
+ marginTop: 10
256
+ }}
257
+ multiline
258
+ />
259
+ {commentState?.loading && (
260
+ <View style={{ position: 'absolute', right: 20 }}>
261
+ <ActivityIndicator
262
+ size='large'
263
+ style={{ height: 100 }}
264
+ color={theme.colors.primary}
265
+ />
266
+ </View>
267
+ )}
268
+ </View>
269
+ </View>
270
+ </OSTable>
271
+ )}
238
272
  </OSBill>
239
273
  )}
240
274
  {cart?.valid_products && (
@@ -294,7 +328,7 @@ const CartUI = (props: any) => {
294
328
  onClose={() => setOpenTaxModal({ open: false, data: null })}
295
329
  entireModal
296
330
  >
297
- <TaxInformation data={openTaxModal.data} products={cart.products} />
331
+ <TaxInformation data={openTaxModal.data} products={cart?.products} />
298
332
  </OModal>
299
333
  </CContainer>
300
334
  )
@@ -527,6 +527,14 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
527
527
  </OText>
528
528
  </Table>
529
529
  </Total>
530
+ {order?.comment && (
531
+ <Table>
532
+ <OText style={{flex: 1}}>{t('COMMENT', 'Comment')}</OText>
533
+ <OText style={{maxWidth: '70%'}}>
534
+ {order?.comment}
535
+ </OText>
536
+ </Table>
537
+ )}
530
538
  {
531
539
  (
532
540
  parseInt(order?.status) === 1 ||
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from 'react';
2
- import { TouchableOpacity, View } from 'react-native'
2
+ import { ActivityIndicator, TouchableOpacity, View } from 'react-native'
3
3
  import {
4
4
  Cart,
5
5
  useOrder,
@@ -19,12 +19,13 @@ import {
19
19
 
20
20
  import { ProductItemAccordion } from '../ProductItemAccordion';
21
21
  import { CouponControl } from '../CouponControl';
22
- import { OModal, OText } from '../shared';
22
+ import { OInput, OModal, OText } from '../shared';
23
23
  import { ProductForm } from '../ProductForm';
24
24
  import { verifyDecimals } from '../../utils';
25
25
  import { useTheme } from 'styled-components/native';
26
26
  import { TaxInformation } from '../TaxInformation';
27
27
  import AntIcon from 'react-native-vector-icons/AntDesign'
28
+
28
29
  const OrderSummaryUI = (props: any) => {
29
30
  const {
30
31
  cart,
@@ -33,7 +34,9 @@ const OrderSummaryUI = (props: any) => {
33
34
  offsetDisabled,
34
35
  removeProduct,
35
36
  isCartPending,
36
- isFromCheckout
37
+ isFromCheckout,
38
+ commentState,
39
+ handleChangeComment
37
40
  } = props;
38
41
 
39
42
  const theme = useTheme();
@@ -186,6 +189,38 @@ const OrderSummaryUI = (props: any) => {
186
189
  </OSTable>
187
190
  </View>
188
191
  )}
192
+ {cart?.status !== 2 && (
193
+ <OSTable>
194
+ <View style={{ width: '100%', marginTop: 20 }}>
195
+ <OText>{t('COMMENTS', 'Comments')}</OText>
196
+ <View style={{ flex: 1, width: '100%' }}>
197
+ <OInput
198
+ value={cart?.comment}
199
+ placeholder={t('SPECIAL_COMMENTS', 'Special Comments')}
200
+ onChange={(value: string) => handleChangeComment(value)}
201
+ style={{
202
+ alignItems: 'flex-start',
203
+ width: '100%',
204
+ height: 100,
205
+ borderColor: theme.colors.textSecondary,
206
+ paddingRight: 50,
207
+ marginTop: 10
208
+ }}
209
+ multiline
210
+ />
211
+ {commentState?.loading && (
212
+ <View style={{ position: 'absolute', right: 20 }}>
213
+ <ActivityIndicator
214
+ size='large'
215
+ style={{ height: 100 }}
216
+ color={theme.colors.primary}
217
+ />
218
+ </View>
219
+ )}
220
+ </View>
221
+ </View>
222
+ </OSTable>
223
+ )}
189
224
  </OSBill>
190
225
  )}
191
226
  <OModal
@@ -19,7 +19,7 @@ const SafeAreaStyled = styled.SafeAreaView`
19
19
  export const Container = (props: any) => {
20
20
  return (
21
21
  <SafeAreaStyled>
22
- <ContainerStyled nopadding={props.nopadding} keyboardShouldPersistTaps='handled'>
22
+ <ContainerStyled ref={props?.forwardRef} nopadding={props.nopadding} keyboardShouldPersistTaps='handled'>
23
23
  {props.children}
24
24
  </ContainerStyled>
25
25
  </SafeAreaStyled>
@@ -428,6 +428,14 @@ export const OrderContentComponent = (props: OrderContent) => {
428
428
  {parsePrice(order?.summary?.total ?? 0)}
429
429
  </OText>
430
430
  </Table>
431
+ {order?.comment && (
432
+ <Table>
433
+ <OText style={{ flex: 1 }}>{t('COMMENT', 'Comment')}</OText>
434
+ <OText style={{ maxWidth: '70%' }}>
435
+ {order?.comment}
436
+ </OText>
437
+ </Table>
438
+ )}
431
439
  </Total>
432
440
  </OrderBill >
433
441
  <OModal
@@ -68,6 +68,7 @@ export const Table = styled.View`
68
68
 
69
69
  export const OrderBill = styled.View`
70
70
  padding-vertical: 20px;
71
+ padding-bottom: 30px;
71
72
  flex: 1;
72
73
  `;
73
74
 
@@ -46,7 +46,9 @@ export const Container = (props: any) => {
46
46
  <ContainerStyled
47
47
  contentContainerStyle={props.style}
48
48
  keyboardShouldPersistTaps="handled"
49
- orientation={orientation}>
49
+ orientation={orientation}
50
+ ref={props?.forwardRef}
51
+ >
50
52
  {props.children}
51
53
  </ContainerStyled>
52
54
  </SafeAreaStyled>
@@ -16,12 +16,12 @@ import { ProductItemAccordion } from '../ProductItemAccordion';
16
16
  import { BusinessItemAccordion } from '../BusinessItemAccordion';
17
17
  import { CouponControl } from '../CouponControl';
18
18
 
19
- import { OButton, OModal, OText } from '../shared';
19
+ import { OButton, OInput, OModal, OText } from '../shared';
20
20
  import { useTheme } from 'styled-components/native';
21
21
  import { ProductForm } from '../ProductForm';
22
22
  import { UpsellingProducts } from '../UpsellingProducts';
23
23
  import { verifyDecimals } from '../../utils';
24
- import { Platform } from 'react-native';
24
+ import { ActivityIndicator, Platform, View } from 'react-native';
25
25
  import { TaxInformation } from '../TaxInformation';
26
26
  import { TouchableOpacity } from 'react-native';
27
27
  import AntIcon from 'react-native-vector-icons/AntDesign'
@@ -36,6 +36,8 @@ const CartUI = (props: any) => {
36
36
  removeProduct,
37
37
  handleCartOpen,
38
38
  setIsCartsLoading,
39
+ handleChangeComment,
40
+ commentState
39
41
  // isFromCart
40
42
  } = props
41
43
  const theme = useTheme();
@@ -222,6 +224,38 @@ const CartUI = (props: any) => {
222
224
  </OText>
223
225
  </OSTable>
224
226
  </OSTotal>
227
+ {cart?.status !== 2 && (
228
+ <OSTable>
229
+ <View style={{ width: '100%', marginTop: 20 }}>
230
+ <OText>{t('COMMENTS', 'Comments')}</OText>
231
+ <View style={{ flex: 1, width: '100%' }}>
232
+ <OInput
233
+ value={cart?.comment}
234
+ placeholder={t('SPECIAL_COMMENTS', 'Special Comments')}
235
+ onChange={(value: string) => handleChangeComment(value)}
236
+ style={{
237
+ alignItems: 'flex-start',
238
+ width: '100%',
239
+ height: 100,
240
+ borderColor: theme.colors.textSecondary,
241
+ paddingRight: 50,
242
+ marginTop: 10
243
+ }}
244
+ multiline
245
+ />
246
+ {commentState?.loading && (
247
+ <View style={{ position: 'absolute', right: 20 }}>
248
+ <ActivityIndicator
249
+ size='large'
250
+ color={theme.colors.primary}
251
+ style={{ height: 100 }}
252
+ />
253
+ </View>
254
+ )}
255
+ </View>
256
+ </View>
257
+ </OSTable>
258
+ )}
225
259
  </OSBill>
226
260
  )}
227
261
  {cart?.valid_products && (
@@ -445,6 +445,14 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
445
445
  <OText size={12} weight={Platform.OS === 'ios' ? '600' : 'bold'}>{parsePrice(order?.summary?.total || order?.total)}</OText>
446
446
  </Table>
447
447
  </Total>
448
+ {order?.comment && (
449
+ <Table>
450
+ <OText style={{ flex: 1 }}>{t('COMMENT', 'Comment')}</OText>
451
+ <OText style={{ maxWidth: '70%' }}>
452
+ {order?.comment}
453
+ </OText>
454
+ </Table>
455
+ )}
448
456
  </OrderBill>
449
457
  </OrderContent>
450
458
  </>
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from 'react';
2
- import { TextStyle, TouchableOpacity, View } from 'react-native'
2
+ import { ActivityIndicator, TextStyle, TouchableOpacity, View } from 'react-native'
3
3
  import {
4
4
  Cart,
5
5
  useOrder,
@@ -19,7 +19,7 @@ import {
19
19
 
20
20
  import { ProductItemAccordion } from '../ProductItemAccordion';
21
21
  import { CouponControl } from '../CouponControl';
22
- import { OModal, OText } from '../shared';
22
+ import { OInput, OModal, OText } from '../shared';
23
23
  import { useTheme } from 'styled-components/native';
24
24
  import { ProductForm } from '../ProductForm';
25
25
  import { verifyDecimals } from '../../utils';
@@ -40,6 +40,8 @@ const OrderSummaryUI = (props: any) => {
40
40
  title,
41
41
  paddingH,
42
42
  isMini,
43
+ commentState,
44
+ handleChangeComment
43
45
  } = props;
44
46
 
45
47
  const theme = useTheme();
@@ -235,7 +237,38 @@ const OrderSummaryUI = (props: any) => {
235
237
  )}
236
238
  </View>
237
239
  ) : null}
238
-
240
+ {cart?.status !== 2 && (
241
+ <OSTable>
242
+ <View style={{ width: '100%', marginTop: 20 }}>
243
+ <OText>{t('COMMENTS', 'Comments')}</OText>
244
+ <View style={{ flex: 1, width: '100%' }}>
245
+ <OInput
246
+ value={cart?.comment}
247
+ placeholder={t('SPECIAL_COMMENTS', 'Special Comments')}
248
+ onChange={(value: string) => handleChangeComment(value)}
249
+ style={{
250
+ alignItems: 'flex-start',
251
+ width: '100%',
252
+ height: 100,
253
+ borderColor: theme.colors.textSecondary,
254
+ paddingRight: 50,
255
+ marginTop: 10
256
+ }}
257
+ multiline
258
+ />
259
+ {commentState?.loading && (
260
+ <View style={{ position: 'absolute', right: 20 }}>
261
+ <ActivityIndicator
262
+ size='large'
263
+ style={{ height: 100 }}
264
+ color={theme.colors.primary}
265
+ />
266
+ </View>
267
+ )}
268
+ </View>
269
+ </View>
270
+ </OSTable>
271
+ )}
239
272
  </OSBill>
240
273
  )}
241
274
  <OModal
@@ -18,7 +18,7 @@ const SafeAreaStyled = styled.SafeAreaView`
18
18
  export const Container = (props: any) => {
19
19
  return (
20
20
  <SafeAreaStyled>
21
- <ContainerStyled style={props?.style} {...props} keyboardShouldPersistTaps='handled'>
21
+ <ContainerStyled ref={props?.forwardRef} style={props?.style} {...props} keyboardShouldPersistTaps='handled'>
22
22
  {props.children}
23
23
  </ContainerStyled>
24
24
  </SafeAreaStyled>
@@ -16,12 +16,12 @@ import { ProductItemAccordion } from '../ProductItemAccordion';
16
16
  import { BusinessItemAccordion } from '../BusinessItemAccordion';
17
17
  import { CouponControl } from '../CouponControl';
18
18
 
19
- import { OButton, OModal, OText } from '../shared';
19
+ import { OButton, OInput, OModal, OText } from '../shared';
20
20
  import { ProductForm } from '../ProductForm';
21
21
  import { UpsellingProducts } from '../UpsellingProducts';
22
22
  import { verifyDecimals } from '../../utils';
23
23
  import { useTheme } from 'styled-components/native';
24
- import { TouchableOpacity } from 'react-native';
24
+ import { ActivityIndicator, TouchableOpacity, View } from 'react-native';
25
25
  import AntIcon from 'react-native-vector-icons/AntDesign'
26
26
  import { TaxInformation } from '../TaxInformation';
27
27
  const CartUI = (props: any) => {
@@ -34,7 +34,9 @@ const CartUI = (props: any) => {
34
34
  removeProduct,
35
35
  handleCartOpen,
36
36
  setIsCartsLoading,
37
- isExpanded
37
+ isExpanded,
38
+ handleChangeComment,
39
+ commentState
38
40
  } = props
39
41
 
40
42
  const theme = useTheme()
@@ -245,6 +247,38 @@ const CartUI = (props: any) => {
245
247
  </OText>
246
248
  </OSTable>
247
249
  </OSTotal>
250
+ {cart?.status !== 2 && (
251
+ <OSTable>
252
+ <View style={{ width: '100%', marginTop: 20 }}>
253
+ <OText>{t('COMMENTS', 'Comments')}</OText>
254
+ <View style={{ flex: 1, width: '100%' }}>
255
+ <OInput
256
+ value={cart?.comment}
257
+ placeholder={t('SPECIAL_COMMENTS', 'Special Comments')}
258
+ onChange={(value: string) => handleChangeComment(value)}
259
+ style={{
260
+ alignItems: 'flex-start',
261
+ width: '100%',
262
+ height: 100,
263
+ borderColor: theme.colors.textSecondary,
264
+ paddingRight: 50,
265
+ marginTop: 10
266
+ }}
267
+ multiline
268
+ />
269
+ {commentState?.loading && (
270
+ <View style={{ position: 'absolute', right: 20 }}>
271
+ <ActivityIndicator
272
+ size='large'
273
+ style={{ height: 100 }}
274
+ color={theme.colors.primary}
275
+ />
276
+ </View>
277
+ )}
278
+ </View>
279
+ </View>
280
+ </OSTable>
281
+ )}
248
282
  </OSBill>
249
283
  )}
250
284
  {cart?.valid_products && (
@@ -478,6 +478,14 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
478
478
  <OText style={{ ...theme.labels.normal, fontWeight: '600', color: theme.colors.textPrimary }}>{t('TOTAL', 'Total')}</OText>
479
479
  <OText style={{ ...theme.labels.normal, fontWeight: '600', color: theme.colors.textPrimary }}>{parsePrice(order?.summary?.total || order?.total)}</OText>
480
480
  </Table>
481
+ {order?.comment && (
482
+ <Table>
483
+ <OText style={{ flex: 1 }}>{t('COMMENT', 'Comment')}</OText>
484
+ <OText style={{ maxWidth: '70%' }}>
485
+ {order?.comment}
486
+ </OText>
487
+ </Table>
488
+ )}
481
489
  </OrderBill>
482
490
  </OrderContent>
483
491
  </>
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { TouchableOpacity, View } from 'react-native'
2
+ import { ActivityIndicator, TouchableOpacity, View } from 'react-native'
3
3
  import {
4
4
  Cart,
5
5
  useOrder,
@@ -19,7 +19,7 @@ import {
19
19
 
20
20
  import { ProductItemAccordion } from '../ProductItemAccordion';
21
21
  import { CouponControl } from '../CouponControl';
22
- import { OIcon, OModal, OText } from '../shared';
22
+ import { OIcon, OInput, OModal, OText } from '../shared';
23
23
  import { ProductForm } from '../ProductForm';
24
24
  import { verifyDecimals } from '../../utils';
25
25
  import { useTheme } from 'styled-components/native';
@@ -38,7 +38,9 @@ const OrderSummaryUI = (props: any) => {
38
38
  isFromCheckout,
39
39
  isDriverTips,
40
40
  handleProductDelete,
41
- handleProductEdit
41
+ handleProductEdit,
42
+ handleChangeComment,
43
+ commentState
42
44
  } = props;
43
45
 
44
46
  const theme = useTheme();
@@ -218,7 +220,38 @@ const OrderSummaryUI = (props: any) => {
218
220
  </View>
219
221
  </View>
220
222
  )}
221
-
223
+ {cart?.status !== 2 && (
224
+ <OSTable>
225
+ <View style={{ width: '100%', marginTop: 20 }}>
226
+ <OText>{t('COMMENTS', 'Comments')}</OText>
227
+ <View style={{ flex: 1, width: '100%' }}>
228
+ <OInput
229
+ value={cart?.comment}
230
+ placeholder={t('SPECIAL_COMMENTS', 'Special Comments')}
231
+ onChange={(value: string) => handleChangeComment(value)}
232
+ style={{
233
+ alignItems: 'flex-start',
234
+ width: '100%',
235
+ height: 100,
236
+ borderColor: theme.colors.textSecondary,
237
+ paddingRight: 50,
238
+ marginTop: 10
239
+ }}
240
+ multiline
241
+ />
242
+ {commentState?.loading && (
243
+ <View style={{ position: 'absolute', right: 20 }}>
244
+ <ActivityIndicator
245
+ size='large'
246
+ style={{ height: 100 }}
247
+ color={theme.colors.primary}
248
+ />
249
+ </View>
250
+ )}
251
+ </View>
252
+ </View>
253
+ </OSTable>
254
+ )}
222
255
  </OSBill>
223
256
  )}
224
257
  <OModal
@@ -20,7 +20,7 @@ export const Container = (props: any) => {
20
20
  {props.children}
21
21
  </View>
22
22
  ) : (
23
- <ContainerStyled keyboardShouldPersistTaps='handled' {...props} style={{ padding: props.nopadding ? 0 : 40, paddingTop: 0 }}>
23
+ <ContainerStyled {...props} ref={props?.forwardRef} keyboardShouldPersistTaps='handled' {...props} style={{ padding: props.nopadding ? 0 : 40, paddingTop: 0 }}>
24
24
  {props.children}
25
25
  </ContainerStyled>
26
26
  )}
@@ -22,7 +22,7 @@ export const Container = (props: Props) => {
22
22
  <SafeAreStyled
23
23
  nestedScrollEnabled={props.nestedScrollEnabled}
24
24
  >
25
- <ContainerStyled {...props}>{props.children}</ContainerStyled>
25
+ <ContainerStyled {...props} ref={props?.forwardRef}>{props.children}</ContainerStyled>
26
26
  </SafeAreStyled>
27
27
  );
28
28
  };
@@ -35,4 +35,5 @@ interface Props {
35
35
  nestedScrollEnabled: boolean,
36
36
  nopadding?: boolean;
37
37
  children?: any;
38
+ forwardRef?: any
38
39
  }