ordering-ui-react-native 0.17.92 → 0.17.93-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 (214) hide show
  1. package/package.json +8 -7
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessInformation/index.tsx +10 -9
  4. package/src/components/BusinessesListing/index.tsx +1 -1
  5. package/src/components/OrderCreating/index.tsx +0 -20
  6. package/src/components/PaymentOptionsWebView/index.tsx +29 -8
  7. package/src/components/PhoneInputNumber/index.tsx +6 -2
  8. package/src/components/StripeMethodForm/index.tsx +136 -102
  9. package/src/components/VerifyPhone/styles.tsx +1 -2
  10. package/src/components/shared/OToast.tsx +3 -2
  11. package/src/types/index.tsx +5 -0
  12. package/src/utils/index.tsx +5 -0
  13. package/themes/business/index.tsx +2 -0
  14. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +36 -26
  15. package/themes/business/src/components/BusinessController/index.tsx +0 -1
  16. package/themes/business/src/components/Chat/index.tsx +163 -123
  17. package/themes/business/src/components/DriverMap/index.tsx +17 -6
  18. package/themes/business/src/components/DriverSchedule/index.tsx +45 -8
  19. package/themes/business/src/components/FloatingButton/index.tsx +34 -31
  20. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  21. package/themes/business/src/components/LoginForm/index.tsx +5 -2
  22. package/themes/business/src/components/MapView/index.tsx +14 -10
  23. package/themes/business/src/components/MessagesOption/index.tsx +20 -93
  24. package/themes/business/src/components/NewOrderNotification/index.tsx +123 -96
  25. package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
  26. package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
  27. package/themes/business/src/components/OrderDetails/Delivery.tsx +202 -12
  28. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +84 -37
  29. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +87 -66
  30. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +200 -0
  31. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  32. package/themes/business/src/components/OrderMessage/index.tsx +19 -18
  33. package/themes/business/src/components/OrderSummary/index.tsx +114 -123
  34. package/themes/business/src/components/OrdersOption/index.tsx +22 -22
  35. package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
  36. package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
  37. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +17 -12
  38. package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
  39. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
  40. package/themes/business/src/components/PreviousOrders/index.tsx +198 -221
  41. package/themes/business/src/components/ProductItemAccordion/index.tsx +7 -1
  42. package/themes/business/src/components/ReviewCustomer/index.tsx +18 -13
  43. package/themes/business/src/components/StoresList/index.tsx +3 -4
  44. package/themes/business/src/components/UserProfileForm/index.tsx +14 -15
  45. package/themes/business/src/components/shared/OModal.tsx +16 -9
  46. package/themes/business/src/types/index.tsx +24 -10
  47. package/themes/business/src/utils/index.tsx +29 -2
  48. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  49. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  50. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  51. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  52. package/themes/kiosk/src/components/Intro/index.tsx +16 -1
  53. package/themes/kiosk/src/components/LoginForm/index.tsx +7 -5
  54. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  55. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  56. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  57. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +2 -2
  58. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  59. package/themes/original/index.tsx +1 -1
  60. package/themes/original/src/components/AddressDetails/index.tsx +19 -3
  61. package/themes/original/src/components/AddressForm/index.tsx +35 -17
  62. package/themes/original/src/components/AddressList/index.tsx +5 -8
  63. package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
  64. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  65. package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
  66. package/themes/original/src/components/BusinessBasicInformation/index.tsx +72 -36
  67. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +10 -12
  68. package/themes/original/src/components/BusinessController/index.tsx +35 -44
  69. package/themes/original/src/components/BusinessController/styles.tsx +12 -5
  70. package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
  71. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
  72. package/themes/original/src/components/BusinessInformation/index.tsx +140 -85
  73. package/themes/original/src/components/BusinessItemAccordion/index.tsx +15 -20
  74. package/themes/original/src/components/BusinessListingSearch/index.tsx +346 -340
  75. package/themes/original/src/components/BusinessListingSearch/styles.tsx +0 -18
  76. package/themes/original/src/components/BusinessPreorder/index.tsx +103 -19
  77. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -2
  78. package/themes/original/src/components/BusinessProductsList/index.tsx +15 -7
  79. package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
  80. package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
  81. package/themes/original/src/components/BusinessProductsListing/index.tsx +664 -556
  82. package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -3
  83. package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
  84. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
  85. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
  86. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
  87. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +37 -404
  88. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  89. package/themes/original/src/components/Cart/index.tsx +55 -55
  90. package/themes/original/src/components/CartContent/index.tsx +103 -59
  91. package/themes/original/src/components/CartContent/styles.tsx +6 -6
  92. package/themes/original/src/components/Checkout/index.tsx +276 -32
  93. package/themes/original/src/components/CitiesControl/index.tsx +1 -1
  94. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  95. package/themes/original/src/components/DriverTips/index.tsx +12 -4
  96. package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
  97. package/themes/original/src/components/Favorite/index.tsx +1 -5
  98. package/themes/original/src/components/GPSButton/index.tsx +6 -4
  99. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
  100. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +42 -5
  101. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +2 -0
  102. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +86 -10
  103. package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
  104. package/themes/original/src/components/GoogleMap/index.tsx +63 -7
  105. package/themes/original/src/components/Home/index.tsx +13 -4
  106. package/themes/original/src/components/LastOrder/index.tsx +2 -1
  107. package/themes/original/src/components/LastOrders/index.tsx +2 -1
  108. package/themes/original/src/components/LoginForm/Otp/index.tsx +91 -25
  109. package/themes/original/src/components/LoginForm/index.tsx +64 -34
  110. package/themes/original/src/components/LottieAnimation/index.tsx +88 -63
  111. package/themes/original/src/components/MessageListing/index.tsx +9 -2
  112. package/themes/original/src/components/Messages/index.tsx +15 -4
  113. package/themes/original/src/components/MomentOption/index.tsx +193 -92
  114. package/themes/original/src/components/MomentSelector/index.tsx +1 -1
  115. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +161 -49
  116. package/themes/original/src/components/MultiCheckout/index.tsx +373 -69
  117. package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
  118. package/themes/original/src/components/MultiOrdersDetails/index.tsx +1 -1
  119. package/themes/original/src/components/MyOrders/index.tsx +12 -1
  120. package/themes/original/src/components/NavBar/index.tsx +20 -13
  121. package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
  122. package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
  123. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +21 -5
  124. package/themes/original/src/components/OrderDetails/index.tsx +50 -38
  125. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  126. package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
  127. package/themes/original/src/components/OrderProgress/index.tsx +34 -25
  128. package/themes/original/src/components/OrderSummary/index.tsx +83 -57
  129. package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -6
  130. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +13 -13
  131. package/themes/original/src/components/OrdersOption/index.tsx +43 -20
  132. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  133. package/themes/original/src/components/PageBanner/index.tsx +65 -29
  134. package/themes/original/src/components/PageBanner/styles.tsx +0 -3
  135. package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
  136. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
  137. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  138. package/themes/original/src/components/PaymentOptions/index.tsx +100 -34
  139. package/themes/original/src/components/PhoneInputNumber/index.tsx +18 -4
  140. package/themes/original/src/components/ProductForm/index.tsx +86 -30
  141. package/themes/original/src/components/ProductForm/styles.tsx +3 -3
  142. package/themes/original/src/components/ProductItemAccordion/index.tsx +8 -6
  143. package/themes/original/src/components/ProductOptionSubOption/index.tsx +49 -20
  144. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +10 -9
  145. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  146. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
  147. package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
  148. package/themes/original/src/components/Promotions/index.tsx +2 -2
  149. package/themes/original/src/components/Promotions/styles.tsx +3 -1
  150. package/themes/original/src/components/ReviewProducts/index.tsx +16 -7
  151. package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
  152. package/themes/original/src/components/ServiceForm/index.tsx +63 -20
  153. package/themes/original/src/components/SignupForm/index.tsx +43 -27
  154. package/themes/original/src/components/SingleOrderCard/index.tsx +44 -20
  155. package/themes/original/src/components/SingleOrderCard/styles.tsx +1 -1
  156. package/themes/original/src/components/SingleProductCard/index.tsx +13 -10
  157. package/themes/original/src/components/SingleProductCard/styles.tsx +8 -3
  158. package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
  159. package/themes/original/src/components/StripeCardsList/index.tsx +61 -5
  160. package/themes/original/src/components/StripeElementsForm/index.tsx +48 -34
  161. package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
  162. package/themes/original/src/components/UpsellingProducts/index.tsx +5 -10
  163. package/themes/original/src/components/UserDetails/index.tsx +3 -1
  164. package/themes/original/src/components/UserFormDetails/index.tsx +78 -9
  165. package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
  166. package/themes/original/src/components/UserProfile/index.tsx +7 -25
  167. package/themes/original/src/components/UserProfileForm/index.tsx +30 -31
  168. package/themes/original/src/components/UserVerification/index.tsx +55 -50
  169. package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
  170. package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
  171. package/themes/original/src/components/Wallets/index.tsx +51 -61
  172. package/themes/original/src/components/Wallets/styles.tsx +2 -4
  173. package/themes/original/src/components/shared/OButton.tsx +3 -3
  174. package/themes/original/src/components/shared/OInput.tsx +4 -5
  175. package/themes/original/src/components/shared/OModal.tsx +3 -3
  176. package/themes/original/src/types/index.tsx +37 -10
  177. package/themes/original/src/utils/index.tsx +185 -13
  178. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  179. package/src/navigators/BottomNavigator.tsx +0 -117
  180. package/src/navigators/CheckoutNavigator.tsx +0 -66
  181. package/src/navigators/HomeNavigator.tsx +0 -202
  182. package/src/navigators/NavigationRef.tsx +0 -7
  183. package/src/navigators/RootNavigator.tsx +0 -269
  184. package/src/pages/Account.tsx +0 -34
  185. package/src/pages/AddressForm.tsx +0 -62
  186. package/src/pages/AddressList.tsx +0 -24
  187. package/src/pages/BusinessProductsList.tsx +0 -81
  188. package/src/pages/BusinessesListing.tsx +0 -43
  189. package/src/pages/CartList.tsx +0 -49
  190. package/src/pages/Checkout.tsx +0 -101
  191. package/src/pages/ForgotPassword.tsx +0 -24
  192. package/src/pages/Help.tsx +0 -23
  193. package/src/pages/HelpAccountAndPayment.tsx +0 -23
  194. package/src/pages/HelpGuide.tsx +0 -23
  195. package/src/pages/HelpOrder.tsx +0 -23
  196. package/src/pages/Home.tsx +0 -36
  197. package/src/pages/IntroductoryTutorial.tsx +0 -170
  198. package/src/pages/Login.tsx +0 -47
  199. package/src/pages/MomentOption.tsx +0 -30
  200. package/src/pages/MultiCheckout.tsx +0 -31
  201. package/src/pages/MultiOrdersDetails.tsx +0 -27
  202. package/src/pages/MyOrders.tsx +0 -40
  203. package/src/pages/NetworkError.tsx +0 -24
  204. package/src/pages/NotFound.tsx +0 -22
  205. package/src/pages/OrderDetails.tsx +0 -25
  206. package/src/pages/ProductDetails.tsx +0 -55
  207. package/src/pages/Profile.tsx +0 -36
  208. package/src/pages/ReviewDriver.tsx +0 -30
  209. package/src/pages/ReviewOrder.tsx +0 -32
  210. package/src/pages/ReviewProducts.tsx +0 -30
  211. package/src/pages/Sessions.tsx +0 -22
  212. package/src/pages/Signup.tsx +0 -53
  213. package/src/pages/SpinnerLoader.tsx +0 -10
  214. package/src/pages/Splash.tsx +0 -21
@@ -10,19 +10,24 @@ import {
10
10
  ToastType,
11
11
  MultiCheckout as MultiCheckoutController
12
12
  } from 'ordering-components/native'
13
- import { View, StyleSheet, Platform } from 'react-native'
13
+ import { View, StyleSheet, Platform, ScrollView } from 'react-native'
14
14
  import { useTheme } from 'styled-components/native';
15
15
  import { Container } from '../../layouts/Container';
16
16
  import NavBar from '../NavBar';
17
- import { OText, OIcon, OModal } from '../shared';
17
+ import { OText, OIcon, OModal, OButton } from '../shared';
18
18
  import { getTypesText } from '../../utils';
19
19
  import { UserDetails } from '../UserDetails'
20
20
  import { AddressDetails } from '../AddressDetails'
21
+ import { MultiCart as MultiCartController } from '../MultiCart'
21
22
  import { MultiCartsPaymethodsAndWallets } from '../MultiCartsPaymethodsAndWallets'
22
23
  import { Cart } from '../Cart'
23
24
  import { FloatingButton } from '../FloatingButton'
24
25
  import { DriverTips } from '../DriverTips'
26
+ import { CouponControl } from '../CouponControl';
25
27
  import { DriverTipsContainer } from '../Cart/styles'
28
+ import { OSTable, OSCoupon } from '../OrderSummary/styles';
29
+ import { SignupForm } from '../SignupForm'
30
+ import { LoginForm } from '../LoginForm'
26
31
 
27
32
  import {
28
33
  ChContainer,
@@ -50,15 +55,19 @@ const MultiCheckoutUI = (props: any) => {
50
55
  navigation,
51
56
  placing,
52
57
  openCarts,
53
- totalCartsPrice,
54
58
  handleGroupPlaceOrder,
55
59
  paymethodSelected,
56
60
  handleSelectPaymethod,
57
61
  handleSelectWallet,
58
62
  handlePaymethodDataChange,
59
63
  cartUuid,
64
+ loyaltyPlansState,
60
65
  totalCartsFee,
61
- cartGroup
66
+ cartGroup,
67
+ walletState,
68
+ onNavigationRedirectReplace,
69
+ merchantId,
70
+ cartsInvalid
62
71
  } = props
63
72
 
64
73
  const theme = useTheme();
@@ -67,7 +76,11 @@ const MultiCheckoutUI = (props: any) => {
67
76
  paddingLeft: 40,
68
77
  paddingRight: 40
69
78
  },
70
- wrapperNavbar: { paddingHorizontal: 40 }
79
+ wrapperNavbar: { paddingHorizontal: 40 },
80
+ detailWrapper: {
81
+ paddingHorizontal: 40,
82
+ width: '100%'
83
+ },
71
84
  })
72
85
 
73
86
  const [, { showToast }] = useToast();
@@ -76,20 +89,69 @@ const MultiCheckoutUI = (props: any) => {
76
89
  const [{ parsePrice, parseDate }] = useUtils();
77
90
  const [{ options, carts, loading }, { confirmCart }] = useOrder();
78
91
  const [validationFields] = useValidationFields();
79
- const [{ user }] = useSession()
92
+ const [{ user }, { login }] = useSession()
80
93
 
81
94
  const configTypes = configs?.order_types_allowed?.value.split('|').map((value: any) => Number(value)) || []
82
95
  const isPreOrder = configs?.preorder_status_enabled?.value === '1'
83
- const isMultiDriverTips = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
84
- const isDisablePlaceOrderButton = !(paymethodSelected?.paymethod_id || paymethodSelected?.wallet_id) || (paymethodSelected?.paymethod?.gateway === 'stripe' && !paymethodSelected?.paymethod_data)
96
+ const isMultiDriverTips = configs?.checkout_multi_business_enabled?.value === '1'
85
97
  const walletCarts = (Object.values(carts)?.filter((cart: any) => cart?.products && cart?.products?.length && cart?.status !== 2 && cart?.valid_schedule && cart?.valid_products && cart?.valid_address && cart?.valid_maximum && cart?.valid_minimum && cart?.wallets) || null) || []
98
+ const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
99
+ const cartsToShow = openCarts?.length > 0 ? openCarts : cartsInvalid
100
+ const walletName: any = {
101
+ cash: {
102
+ name: t('PAY_WITH_CASH_WALLET', 'Pay with Cash Wallet'),
103
+ },
104
+ credit_point: {
105
+ name: t('PAY_WITH_CREDITS_POINTS_WALLET', 'Pay with Credit Points Wallet'),
106
+ }
107
+ }
108
+
109
+ const totalCartsPrice = cartGroup?.result?.balance
110
+
86
111
  const driverTipsOptions = typeof configs?.driver_tip_options?.value === 'string'
87
112
  ? JSON.parse(configs?.driver_tip_options?.value) || []
88
113
  : configs?.driver_tip_options?.value || []
89
114
 
115
+ const creditPointGeneralPlan = loyaltyPlansState?.result?.find((loyal: any) => loyal.type === 'credit_point')
116
+ const loyalBusinessAvailable = creditPointGeneralPlan?.businesses?.filter((b: any) => b.accumulates) ?? []
117
+
118
+ const accumulationRateBusiness = (businessId: number) => {
119
+ const value = loyalBusinessAvailable?.find((loyal: any) => loyal.business_id === businessId)?.accumulation_rate ?? 0
120
+ return value || (creditPointGeneralPlan?.accumulation_rate ?? 0)
121
+ }
122
+
123
+ const getIncludedTaxes = (cart: any) => {
124
+ if (cart?.taxes === null || !cart?.taxes) {
125
+ return cart.business.tax_type === 1 ? cart?.tax : 0
126
+ } else {
127
+ return cart?.taxes.reduce((taxIncluded: number, tax: any) => {
128
+ return taxIncluded + (tax.type === 1 ? tax.summary?.tax : 0)
129
+ }, 0)
130
+ }
131
+ }
132
+
133
+ const clearAmount = (value: any) => parseFloat((Math.trunc(value * 100) / 100).toFixed(configs.format_number_decimal_length?.value ?? 2))
134
+
135
+ const loyaltyRewardValue = openCarts
136
+ ?.reduce((sum: any, cart: any) => sum + clearAmount((cart?.subtotal + getIncludedTaxes(cart)) * accumulationRateBusiness(cart?.business_id)), 0)
137
+ ?.toFixed(configs.format_number_decimal_length?.value ?? 2)
138
+
90
139
  const [isUserDetailsEdit, setIsUserDetailsEdit] = useState(false);
91
140
  const [phoneUpdate, setPhoneUpdate] = useState(false);
92
141
  const [userErrors, setUserErrors] = useState<any>([]);
142
+ const [placeByMethodPay, setPlaceByMethodPay] = useState(false)
143
+ const [allowedGuest, setAllowedGuest] = useState(false)
144
+ const [isOpen, setIsOpen] = useState(false)
145
+ const [requiredFields, setRequiredFields] = useState<any>([])
146
+ const stripePaymethods: any = ['stripe', 'stripe_direct', 'stripe_connect', 'stripe_redirect']
147
+ const [openModal, setOpenModal] = useState({ login: false, signup: false, isGuest: false })
148
+ const [methodPaySupported, setMethodPaySupported] = useState({ enabled: false, message: null, loading: true })
149
+ const methodsPay = ['global_google_pay', 'global_apple_pay']
150
+ const isDisablePlaceOrderButton = cartGroup?.loading || (!(paymethodSelected?.paymethod_id || paymethodSelected?.wallet_id) && cartGroup?.result?.balance > 0) ||
151
+ (paymethodSelected?.paymethod?.gateway === 'stripe' && !paymethodSelected?.paymethod_data) ||
152
+ walletCarts.length > 0
153
+ || (methodsPay.includes(paymethodSelected?.gateway) && (!methodPaySupported.enabled || methodPaySupported.loading)) || openCarts?.length === 0
154
+
93
155
  const handleMomentClick = () => {
94
156
  if (isPreOrder) {
95
157
  navigation.navigate('MomentOption')
@@ -100,11 +162,12 @@ const MultiCheckoutUI = (props: any) => {
100
162
  setUserErrors([])
101
163
  const errors = []
102
164
  const notFields = ['coupon', 'driver_tip', 'mobile_phone', 'address', 'zipcode', 'address_notes']
165
+ const _requiredFields: any = []
103
166
 
104
167
  Object.values(validationFields?.fields?.checkout).map((field: any) => {
105
168
  if (field?.required && !notFields.includes(field.code)) {
106
169
  if (!user[field?.code]) {
107
- errors.push(t(`VALIDATION_ERROR_${field.code.toUpperCase()}_REQUIRED`, `The field ${field?.name} is required`))
170
+ _requiredFields.push(field?.code)
108
171
  }
109
172
  }
110
173
  })
@@ -115,8 +178,9 @@ const MultiCheckoutUI = (props: any) => {
115
178
  validationFields?.fields?.checkout?.cellphone?.required) ||
116
179
  configs?.verification_phone_required?.value === '1')
117
180
  ) {
118
- errors.push(t('VALIDATION_ERROR_MOBILE_PHONE_REQUIRED', 'The field Phone number is required'))
181
+ _requiredFields.push('cellphone')
119
182
  }
183
+ setRequiredFields(_requiredFields)
120
184
 
121
185
  if (phoneUpdate) {
122
186
  errors.push(t('NECESSARY_UPDATE_COUNTRY_PHONE_CODE', 'It is necessary to update your phone number'))
@@ -129,11 +193,20 @@ const MultiCheckoutUI = (props: any) => {
129
193
  setPhoneUpdate(val)
130
194
  }
131
195
 
132
- const handlePlaceOrder = () => {
133
- if (!userErrors.length) {
134
- handleGroupPlaceOrder && handleGroupPlaceOrder()
196
+ const handlePlaceOrder = (confirmPayment?: any) => {
197
+ if (stripePaymethods.includes(paymethodSelected?.gateway) && user?.guest_id) {
198
+ setOpenModal({ ...openModal, signup: true, isGuest: true })
199
+ return
200
+ }
201
+
202
+ if (!userErrors.length && (!requiredFields?.length || allowedGuest)) {
203
+ handleGroupPlaceOrder && handleGroupPlaceOrder(confirmPayment)
135
204
  return
136
205
  }
206
+ if (requiredFields?.length) {
207
+ setIsOpen(true)
208
+ return
209
+ }
137
210
  let stringError = ''
138
211
  Object.values(userErrors).map((item: any, i: number) => {
139
212
  stringError += (i + 1) === userErrors.length ? `- ${item?.message || item}` : `- ${item?.message || item}\n`
@@ -142,12 +215,62 @@ const MultiCheckoutUI = (props: any) => {
142
215
  setIsUserDetailsEdit(true)
143
216
  }
144
217
 
218
+ const handlePlaceOrderAsGuest = () => {
219
+ setIsOpen(false)
220
+ handleGroupPlaceOrder && handleGroupPlaceOrder()
221
+ }
222
+
223
+ const handleSuccessSignup = (user: any) => {
224
+ login({
225
+ user,
226
+ token: user?.session?.access_token
227
+ })
228
+ openModal?.isGuest && handlePlaceOrderAsGuest()
229
+ setOpenModal({ ...openModal, signup: false, isGuest: false })
230
+ }
231
+
232
+ const handleSuccessLogin = (user: any) => {
233
+ if (user) setOpenModal({ ...openModal, login: false })
234
+ }
235
+
145
236
  useEffect(() => {
146
237
  if (validationFields && validationFields?.fields?.checkout) {
147
238
  checkValidationFields()
148
239
  }
149
240
  }, [validationFields, user])
150
241
 
242
+ useEffect(() => {
243
+ if (cartsToShow?.length === 1) {
244
+ onNavigationRedirectReplace('CheckoutPage', {
245
+ cartUuid: cartsToShow[0]?.uuid,
246
+ fromMulti: true
247
+ })
248
+ return
249
+ }
250
+ }, [cartsToShow])
251
+
252
+ useEffect(() => {
253
+ if (walletState.error) {
254
+ showToast(ToastType.Error, t(walletState.error, walletState.error?.[0]?.replace(/_/g, ' ')))
255
+ }
256
+ }, [walletState.error])
257
+
258
+ useEffect(() => {
259
+ if (!cartUuid) {
260
+ onNavigationRedirectReplace('BottomTab', { screen: 'Cart' })
261
+ }
262
+ }, [cartUuid])
263
+
264
+ useEffect(() => {
265
+ if (paymethodSelected?.gateway === 'global_google_pay') {
266
+ setMethodPaySupported({
267
+ enabled: true,
268
+ loading: false,
269
+ message: null
270
+ })
271
+ }
272
+ }, [paymethodSelected])
273
+
151
274
  return (
152
275
  <>
153
276
  <Container noPadding>
@@ -164,8 +287,15 @@ const MultiCheckoutUI = (props: any) => {
164
287
  <ChContainer style={styles.pagePadding}>
165
288
  <ChSection style={{ paddingTop: 0 }}>
166
289
  <ChHeader>
167
- <CHMomentWrapper onPress={() => navigation.navigate('OrderTypes', { configTypes: configTypes })}>
168
- <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textSecondary}>{t(getTypesText(options?.type || 1), 'Delivery')}</OText>
290
+ <CHMomentWrapper isCustomColor={isChewLayout} onPress={() => navigation.navigate('OrderTypes', { configTypes: configTypes })}>
291
+ <OText
292
+ size={12}
293
+ numberOfLines={1}
294
+ ellipsizeMode={'tail'}
295
+ color={theme.colors?.[isChewLayout ? 'white' : 'textSecondary']}
296
+ >
297
+ {t(getTypesText(options?.type || 1), 'Delivery')}
298
+ </OText>
169
299
  <OIcon
170
300
  src={theme.images.general.arrow_down}
171
301
  width={10}
@@ -195,15 +325,45 @@ const MultiCheckoutUI = (props: any) => {
195
325
 
196
326
  <ChSection>
197
327
  <ChUserDetails>
198
- <UserDetails
199
- isUserDetailsEdit={isUserDetailsEdit}
200
- useValidationFields
201
- useDefualtSessionManager
202
- useSessionUser
203
- isCheckout
204
- phoneUpdate={phoneUpdate}
205
- togglePhoneUpdate={togglePhoneUpdate}
206
- />
328
+ {(user?.guest_id && !allowedGuest) ? (
329
+ <View>
330
+ <OText size={14} numberOfLines={1} ellipsizeMode='tail' color={theme.colors.textNormal}>
331
+ {t('CUSTOMER_DETAILS', 'Customer details')}
332
+ </OText>
333
+ <OButton
334
+ text={t('SIGN_UP', 'Sign up')}
335
+ textStyle={{ color: theme.colors.white }}
336
+ style={{ borderRadius: 7.6, marginTop: 20 }}
337
+ onClick={() => setOpenModal({ ...openModal, signup: true })}
338
+ />
339
+ <OButton
340
+ text={t('LOGIN', 'Login')}
341
+ textStyle={{ color: theme.colors.primary }}
342
+ bgColor={theme.colors.white}
343
+ borderColor={theme.colors.primary}
344
+ style={{ borderRadius: 7.6, marginTop: 20 }}
345
+ onClick={() => setOpenModal({ ...openModal, login: true })}
346
+ />
347
+ <OButton
348
+ text={t('CONTINUE_AS_GUEST', 'Continue as guest')}
349
+ textStyle={{ color: theme.colors.black }}
350
+ bgColor={theme.colors.white}
351
+ borderColor={theme.colors.black}
352
+ style={{ borderRadius: 7.6, marginTop: 20 }}
353
+ onClick={() => setAllowedGuest(true)}
354
+ />
355
+ </View>
356
+ ) : (
357
+ <UserDetails
358
+ isUserDetailsEdit={isUserDetailsEdit}
359
+ useValidationFields
360
+ useDefualtSessionManager
361
+ useSessionUser
362
+ isCheckout
363
+ phoneUpdate={phoneUpdate}
364
+ togglePhoneUpdate={togglePhoneUpdate}
365
+ />
366
+ )}
207
367
  </ChUserDetails>
208
368
  <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginHorizontal: -40 }} />
209
369
  </ChSection>
@@ -220,47 +380,80 @@ const MultiCheckoutUI = (props: any) => {
220
380
  </ChAddress>
221
381
  <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginTop: 13, marginHorizontal: -40 }} />
222
382
  </ChSection>
223
-
224
- <ChSection>
225
- <MultiCartsPaymethodsAndWallets
226
- openCarts={openCarts}
227
- paymethodSelected={paymethodSelected}
228
- handleSelectPaymethod={handleSelectPaymethod}
229
- handleSelectWallet={handleSelectWallet}
230
- handlePaymethodDataChange={handlePaymethodDataChange}
231
- cartUuid={cartUuid}
232
- />
233
- <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginTop: 13, marginHorizontal: -40 }} />
234
- </ChSection>
235
-
383
+ {openCarts?.length > 0 && (
384
+ <ChSection>
385
+ <MultiCartsPaymethodsAndWallets
386
+ openCarts={openCarts}
387
+ paymethodSelected={paymethodSelected}
388
+ walletsPaymethod={cartGroup?.result?.wallets}
389
+ handleSelectPaymethod={handleSelectPaymethod}
390
+ handleSelectWallet={handleSelectWallet}
391
+ handlePaymethodDataChange={handlePaymethodDataChange}
392
+ cartUuid={cartUuid}
393
+ merchantId={merchantId}
394
+ setMethodPaySupported={setMethodPaySupported}
395
+ methodPaySupported={methodPaySupported}
396
+ placeByMethodPay={placeByMethodPay}
397
+ setPlaceByMethodPay={setPlaceByMethodPay}
398
+ cartTotal={totalCartsPrice}
399
+ handlePlaceOrder={handlePlaceOrder}
400
+ />
401
+ <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginTop: 13, marginHorizontal: -40 }} />
402
+ </ChSection>
403
+ )}
236
404
  {
237
405
  isMultiDriverTips &&
238
406
  options?.type === 1 &&
239
407
  validationFields?.fields?.checkout?.driver_tip?.enabled &&
240
408
  openCarts.every((cart: any) => cart.business_id && cart.status !== 2) &&
241
409
  driverTipsOptions && driverTipsOptions?.length > 0 &&
242
- (
243
- <ChSection>
244
- <DriverTipsContainer>
410
+ (
411
+ <ChSection>
412
+ <DriverTipsContainer>
413
+ <OText size={14} lineHeight={20} color={theme.colors.textNormal}>
414
+ {t('DRIVER_TIPS', 'Driver Tips')}
415
+ </OText>
416
+ <DriverTips
417
+ isMulti
418
+ isLoading={loading}
419
+ carts={openCarts}
420
+ businessIds={openCarts.map((cart: any) => cart.business_id)}
421
+ driverTipsOptions={driverTipsOptions}
422
+ isFixedPrice={parseInt(configs?.driver_tip_type?.value, 10) === 1}
423
+ isDriverTipUseCustom={!!parseInt(configs?.driver_tip_use_custom?.value, 10)}
424
+ driverTip={parseInt(configs?.driver_tip_type?.value, 10) === 1
425
+ ? openCarts?.reduce((sum: any, cart: any) => sum + cart?.driver_tip, 0)
426
+ : openCarts[0]?.driver_tip_rate}
427
+ useOrderContext
428
+ />
429
+ </DriverTipsContainer>
430
+ <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginTop: 13, marginHorizontal: -40 }} />
431
+ </ChSection>
432
+ )}
433
+
434
+ {
435
+ validationFields?.fields?.checkout?.coupon?.enabled &&
436
+ openCarts.every((cart: any) => cart.business_id && cart.status !== 2) &&
437
+ configs?.multi_business_checkout_coupon_input_style?.value === 'group' &&
438
+ openCarts?.length > 0 &&
439
+ (
440
+ <ChSection>
245
441
  <OText size={14} lineHeight={20} color={theme.colors.textNormal}>
246
- {t('DRIVER_TIPS', 'Driver Tips')}
442
+ {t('DISCOUNT_COUPON', 'Discount coupon')}
247
443
  </OText>
248
- <DriverTips
249
- isMulti
250
- carts={openCarts}
251
- businessIds={openCarts.map((cart: any) => cart.business_id)}
252
- driverTipsOptions={driverTipsOptions}
253
- isFixedPrice={parseInt(configs?.driver_tip_type?.value, 10) === 1}
254
- isDriverTipUseCustom={!!parseInt(configs?.driver_tip_use_custom?.value, 10)}
255
- driverTip={parseInt(configs?.driver_tip_type?.value, 10) === 1
256
- ? openCarts[0]?.driver_tip
257
- : openCarts[0]?.driver_tip_rate}
258
- useOrderContext
259
- />
260
- </DriverTipsContainer>
261
- <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginTop: 13, marginHorizontal: -40 }} />
262
- </ChSection>
263
- )}
444
+ <OSTable>
445
+ <OSCoupon>
446
+ <CouponControl
447
+ isMulti
448
+ carts={openCarts}
449
+ businessIds={openCarts.map((cart: any) => cart.business_id)}
450
+ price={openCarts.reduce((total: any, cart: any) => total + cart.total, 0)}
451
+ />
452
+ </OSCoupon>
453
+ </OSTable>
454
+ <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginTop: 13, marginHorizontal: -40 }} />
455
+ </ChSection>
456
+ )}
264
457
 
265
458
  <ChSection>
266
459
  <ChCarts>
@@ -269,20 +462,24 @@ const MultiCheckoutUI = (props: any) => {
269
462
  {t('MOBILE_FRONT_YOUR_ORDER', 'Your order')}
270
463
  </OText>
271
464
  </CartsHeader>
272
- {openCarts.map((cart: any) => (
465
+ {cartsToShow.map((cart: any) => (
273
466
  <React.Fragment key={cart.uuid}>
274
467
  <Cart
275
468
  cart={cart}
276
469
  cartuuid={cart.uuid}
277
470
  isMultiCheckout
471
+ hideCouponInput={configs?.multi_business_checkout_coupon_input_style?.value === 'group'}
278
472
  hideDeliveryFee={configs?.multi_business_checkout_show_combined_delivery_fee?.value === '1'}
279
473
  hideDriverTip={configs?.multi_business_checkout_show_combined_driver_tip?.value === '1'}
280
474
  onNavigationRedirect={(route: string, params: any) => props.navigation.navigate(route, params)}
475
+ businessConfigs={cart?.business?.configs}
281
476
  />
282
- <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginTop: 13, marginHorizontal: -40 }} />
477
+ {openCarts.length > 1 && (
478
+ <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginTop: 13, marginHorizontal: -40 }} />
479
+ )}
283
480
  </React.Fragment>
284
481
  ))}
285
- {!cartGroup?.loading && openCarts.length === 0 && (
482
+ {!cartGroup?.loading && openCarts.length === 0 && cartsInvalid?.length === 0 && (
286
483
  <CCNotCarts>
287
484
  <OText size={24} style={{ textAlign: 'center' }}>
288
485
  {t('CARTS_NOT_FOUND', 'You don\'t have carts available')}
@@ -294,33 +491,53 @@ const MultiCheckoutUI = (props: any) => {
294
491
  {t('WARNING_PARTIAL_WALLET_CARTS', 'Important: One or more carts can`t be completed due a partial payment with cash/points wallet and requires to be paid individually')}
295
492
  </OText>
296
493
  )}
297
- {openCarts.length > 0 && (
494
+ {openCarts.length > 1 && (
298
495
  <ChCartsTotal>
299
- {totalCartsFee && configs?.multi_business_checkout_show_combined_delivery_fee?.value === '1' && (
496
+ {!!totalCartsFee && configs?.multi_business_checkout_show_combined_delivery_fee?.value === '1' && (
300
497
  <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
301
498
  <OText size={14} lineHeight={24} color={theme.colors.textNormal} weight={'400'}>
302
499
  {t('TOTAL_DELIVERY_FEE', 'Total delivery fee')}
303
500
  </OText>
304
- <OText size={14} lineHeight={24} color={theme.colors.textNormal} weight={'400'}>{parsePrice(totalCartsFee)}</OText>
501
+ <OText size={14} lineHeight={24} color={theme.colors.textNormal} weight={'400'}>
502
+ {parsePrice(totalCartsFee)}
503
+ </OText>
305
504
  </View>
306
505
  )}
307
506
  {openCarts.reduce((sum: any, cart: any) => sum + cart?.driver_tip, 0) > 0 &&
308
507
  configs?.multi_business_checkout_show_combined_driver_tip?.value === '1' && (
309
- <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
508
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
509
+ <OText size={14} lineHeight={24} color={theme.colors.textNormal} weight={'400'}>
510
+ {t('DRIVER_TIP', 'Driver tip')}
511
+ </OText>
512
+ <OText size={14} lineHeight={24} color={theme.colors.textNormal} weight={'400'}>
513
+ {parsePrice(openCarts.reduce((sum: any, cart: any) => sum + cart?.driver_tip, 0))}
514
+ </OText>
515
+ </View>
516
+ )}
517
+ {!cartGroup?.loading && cartGroup?.result?.payment_events?.length > 0 && cartGroup?.result?.payment_events?.map((event: any) => (
518
+ <View key={event.id} style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
310
519
  <OText size={14} lineHeight={24} color={theme.colors.textNormal} weight={'400'}>
311
- {t('DRIVER_TIP', 'Driver tip')}
520
+ {walletName[cartGroup?.result?.wallets?.find((wallet: any) => wallet.wallet_id === event.wallet_id)?.type]?.name}
312
521
  </OText>
313
522
  <OText size={14} lineHeight={24} color={theme.colors.textNormal} weight={'400'}>
314
- {parsePrice(openCarts.reduce((sum: any, cart: any) => sum + cart?.driver_tip, 0))}
523
+ -{parsePrice(event.amount, { isTruncable: true })}
315
524
  </OText>
316
525
  </View>
317
- )}
526
+ ))}
318
527
  <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
319
528
  <OText size={16} lineHeight={24} color={theme.colors.textNormal} weight={'500'}>
320
529
  {t('TOTAL_FOR_ALL_CARTS', 'Total for all Carts')}
321
530
  </OText>
322
531
  <OText size={16} lineHeight={24} color={theme.colors.textNormal} weight={'500'}>{parsePrice(totalCartsPrice)}</OText>
323
532
  </View>
533
+ {!!loyaltyRewardValue && (
534
+ <View style={{ flexDirection: 'row', marginTop: 10, justifyContent: 'flex-end' }}>
535
+ <OText size={12} color={theme.colors.textNormal}>
536
+ {t('REWARD_LOYALTY_POINT', 'Reward :amount: on loyalty points').replace(':amount:', loyaltyRewardValue)}
537
+ </OText>
538
+ </View>
539
+ )}
540
+
324
541
  <OText size={12} color={theme.colors.mediumGray} mRight={70} style={{ marginTop: 10 }}>
325
542
  {t('MULTI_CHECKOUT_DESCRIPTION', 'You will receive a receipt for each business. The payment is not combined between multiple stores. Each payment is processed by the store')}
326
543
  </OText>
@@ -328,11 +545,73 @@ const MultiCheckoutUI = (props: any) => {
328
545
  )}
329
546
  </ChCarts>
330
547
  </ChSection>
548
+ {cartsToShow?.some((cart: any) => !cart?.valid_products && cart?.status !== 2) && (
549
+ <OText
550
+ color={theme.colors.error}
551
+ size={12}
552
+ >
553
+ {t('WARNING_INVALID_PRODUCTS_CHECKOUT', 'To continue with your checkout, please remove from your cart the products that are not available.')}
554
+ </OText>
555
+ )}
331
556
  </ChContainer>
557
+ <OModal
558
+ open={openModal.signup}
559
+ onClose={() => setOpenModal({ ...openModal, signup: false, isGuest: false })}
560
+ >
561
+ <ScrollView style={{ paddingHorizontal: 20, width: '100%' }}>
562
+ <SignupForm
563
+ handleSuccessSignup={handleSuccessSignup}
564
+ isGuest
565
+ signupButtonText={t('SIGNUP', 'Signup')}
566
+ useSignupByEmail
567
+ useChekoutFileds
568
+ />
569
+ </ScrollView>
570
+ </OModal>
571
+ <OModal
572
+ open={openModal.login}
573
+ onClose={() => setOpenModal({ ...openModal, login: false })}
574
+ >
575
+ <ScrollView style={{ paddingHorizontal: 20, width: '100%' }}>
576
+ <LoginForm
577
+ handleSuccessLogin={handleSuccessLogin}
578
+ isGuest
579
+ loginButtonText={t('LOGIN', 'Login')}
580
+ loginButtonBackground={theme.colors.primary}
581
+ />
582
+ </ScrollView>
583
+ </OModal>
584
+ <OModal
585
+ open={isOpen}
586
+ onClose={() => setIsOpen(false)}
587
+ >
588
+ <View style={styles.detailWrapper}>
589
+ <UserDetails
590
+ isUserDetailsEdit
591
+ useValidationFields
592
+ useDefualtSessionManager
593
+ useSessionUser
594
+ isCheckout
595
+ isEdit
596
+ phoneUpdate={phoneUpdate}
597
+ togglePhoneUpdate={togglePhoneUpdate}
598
+ requiredFields={requiredFields}
599
+ hideUpdateButton
600
+ handlePlaceOrderAsGuest={handlePlaceOrderAsGuest}
601
+ onClose={() => {
602
+ setIsOpen(false)
603
+ handlePlaceOrder()
604
+ }}
605
+ setIsOpen={setIsOpen}
606
+ />
607
+ </View>
608
+ </OModal>
332
609
  </Container>
333
610
 
334
611
  <FloatingButton
335
- handleClick={() => handlePlaceOrder()}
612
+ handleClick={methodsPay.includes(paymethodSelected?.gateway)
613
+ ? () => setPlaceByMethodPay(true)
614
+ : () => handlePlaceOrder()}
336
615
  isSecondaryBtn={isDisablePlaceOrderButton}
337
616
  disabled={isDisablePlaceOrderButton}
338
617
  btnText={placing ? t('PLACING', 'Placing') : t('PLACE_ORDER', 'Place Order')}
@@ -345,9 +624,34 @@ const MultiCheckoutUI = (props: any) => {
345
624
  }
346
625
 
347
626
  export const MultiCheckout = (props: any) => {
627
+ const [loadMultiCarts, setLoadMultiCarts] = useState(!!props.route?.params?.checkCarts)
628
+ const [cartUuid, setCartUuid] = useState('')
629
+
348
630
  const multiCheckoutProps = {
349
631
  ...props,
632
+ cartUuid: props.route?.params?.cartUuid ?? cartUuid,
350
633
  UIComponent: MultiCheckoutUI
351
634
  }
352
- return <MultiCheckoutController {...multiCheckoutProps} />
635
+
636
+ const multiCartProps = {
637
+ ...props,
638
+ handleOnRedirectMultiCheckout: (cartUuid: string) => {
639
+ setCartUuid(cartUuid)
640
+ setLoadMultiCarts(false)
641
+ },
642
+ handleOnRedirectCheckout: (cartUuid: string) => {
643
+ props.navigation.navigate('CheckoutNavigator', {
644
+ screen: 'CheckoutPage',
645
+ cartUuid
646
+ })
647
+ }
648
+ }
649
+
650
+ return (
651
+ loadMultiCarts ? (
652
+ <MultiCartController {...multiCartProps} />
653
+ ) : (
654
+ <MultiCheckoutController {...multiCheckoutProps} />
655
+ )
656
+ )
353
657
  }
@@ -13,7 +13,9 @@ export const ChHeader = styled.View`
13
13
  margin: 0px;
14
14
  `
15
15
  export const CHMomentWrapper = styled.TouchableOpacity`
16
- background-color: ${(props: any) => props.theme.colors.backgroundGray100};
16
+ background-color: ${(props: any) => props.isCustomColor
17
+ ? props.theme.colors.primary
18
+ : props.theme.colors.backgroundGray100};
17
19
  border-radius: 7.6px;
18
20
  font-size: 12px;
19
21
  max-width: 240px;
@@ -166,7 +166,7 @@ export const MultiOrdersDetailsUI = (props: any) => {
166
166
  <OText key={event.id} size={12} lineHeight={18} color={theme.colors.textNormal}>
167
167
  {event?.wallet_event
168
168
  ? walletName[event?.wallet_event?.wallet?.type]?.name
169
- : event?.paymethod?.name}
169
+ : t(event?.paymethod?.name.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)}
170
170
  </OText>
171
171
  ))}
172
172
  </Section>