ordering-ui-react-native 0.17.54 → 0.17.55-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 (221) hide show
  1. package/package.json +8 -7
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessesListing/index.tsx +1 -1
  4. package/src/components/OrderCreating/index.tsx +1 -21
  5. package/src/components/PaymentOptionsWebView/index.tsx +29 -8
  6. package/src/components/PhoneInputNumber/index.tsx +6 -2
  7. package/src/components/StripeMethodForm/index.tsx +136 -102
  8. package/src/components/VerifyPhone/styles.tsx +1 -2
  9. package/src/components/shared/OToast.tsx +4 -4
  10. package/src/types/index.tsx +5 -0
  11. package/src/utils/index.tsx +5 -0
  12. package/themes/business/index.tsx +2 -0
  13. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
  14. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  15. package/themes/business/src/components/BusinessController/index.tsx +0 -1
  16. package/themes/business/src/components/Chat/index.tsx +125 -113
  17. package/themes/business/src/components/DriverMap/index.tsx +17 -6
  18. package/themes/business/src/components/DriverSchedule/index.tsx +29 -2
  19. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  20. package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
  21. package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
  22. package/themes/business/src/components/LoginForm/index.tsx +240 -82
  23. package/themes/business/src/components/LoginForm/styles.tsx +10 -0
  24. package/themes/business/src/components/MapView/index.tsx +10 -10
  25. package/themes/business/src/components/NewOrderNotification/index.tsx +35 -21
  26. package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
  27. package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
  28. package/themes/business/src/components/OrderDetails/Delivery.tsx +191 -6
  29. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +93 -50
  30. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +64 -63
  31. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
  32. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  33. package/themes/business/src/components/OrderMessage/index.tsx +19 -18
  34. package/themes/business/src/components/OrderSummary/index.tsx +113 -121
  35. package/themes/business/src/components/OrdersOption/index.tsx +32 -75
  36. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +249 -0
  37. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  38. package/themes/business/src/components/PreviousOrders/index.tsx +445 -243
  39. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  40. package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
  41. package/themes/business/src/components/ReviewCustomer/index.tsx +30 -15
  42. package/themes/business/src/components/StoresList/index.tsx +3 -4
  43. package/themes/business/src/components/UserProfileForm/index.tsx +11 -13
  44. package/themes/business/src/components/shared/OLink.tsx +33 -13
  45. package/themes/business/src/components/shared/OModal.tsx +16 -9
  46. package/themes/business/src/components/shared/OText.tsx +8 -2
  47. package/themes/business/src/types/index.tsx +32 -2
  48. package/themes/business/src/utils/index.tsx +44 -1
  49. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  50. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  51. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  52. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  53. package/themes/kiosk/src/components/Intro/index.tsx +16 -1
  54. package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
  55. package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
  56. package/themes/kiosk/src/components/LoginForm/index.tsx +480 -156
  57. package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
  58. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  59. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  60. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  61. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +3 -2
  62. package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
  63. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  64. package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
  65. package/themes/kiosk/src/layouts/Container.tsx +7 -1
  66. package/themes/kiosk/src/types/index.d.ts +13 -0
  67. package/themes/kiosk/src/utils/index.tsx +15 -0
  68. package/themes/original/index.tsx +4 -0
  69. package/themes/original/src/components/AddressDetails/index.tsx +28 -10
  70. package/themes/original/src/components/AddressForm/index.tsx +68 -40
  71. package/themes/original/src/components/AddressList/index.tsx +27 -22
  72. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  73. package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
  74. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  75. package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
  76. package/themes/original/src/components/BusinessBasicInformation/index.tsx +153 -96
  77. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +10 -12
  78. package/themes/original/src/components/BusinessController/index.tsx +122 -68
  79. package/themes/original/src/components/BusinessController/styles.tsx +23 -4
  80. package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
  81. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
  82. package/themes/original/src/components/BusinessInformation/index.tsx +110 -108
  83. package/themes/original/src/components/BusinessItemAccordion/index.tsx +15 -20
  84. package/themes/original/src/components/BusinessListingSearch/index.tsx +352 -326
  85. package/themes/original/src/components/BusinessListingSearch/styles.tsx +0 -18
  86. package/themes/original/src/components/BusinessPreorder/index.tsx +103 -19
  87. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -2
  88. package/themes/original/src/components/BusinessProductsList/index.tsx +25 -15
  89. package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
  90. package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
  91. package/themes/original/src/components/BusinessProductsListing/index.tsx +683 -535
  92. package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
  93. package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
  94. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  95. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +96 -91
  96. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -4
  97. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  98. package/themes/original/src/components/Cart/index.tsx +77 -50
  99. package/themes/original/src/components/CartContent/index.tsx +115 -19
  100. package/themes/original/src/components/CartContent/styles.tsx +17 -7
  101. package/themes/original/src/components/Checkout/index.tsx +359 -171
  102. package/themes/original/src/components/Checkout/styles.tsx +4 -2
  103. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  104. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  105. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  106. package/themes/original/src/components/DriverTips/index.tsx +52 -34
  107. package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
  108. package/themes/original/src/components/Favorite/index.tsx +8 -9
  109. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  110. package/themes/original/src/components/FavoriteList/index.tsx +51 -80
  111. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  112. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  113. package/themes/original/src/components/GPSButton/index.tsx +6 -4
  114. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  115. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +96 -0
  116. package/themes/original/src/components/GiftCard/GiftCardUI/styles.tsx +5 -0
  117. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +100 -0
  118. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +8 -0
  119. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +191 -0
  120. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +8 -0
  121. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +165 -0
  122. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +9 -0
  123. package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
  124. package/themes/original/src/components/GoogleMap/index.tsx +15 -4
  125. package/themes/original/src/components/Help/index.tsx +8 -8
  126. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +10 -31
  127. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +5 -3
  128. package/themes/original/src/components/HelpGuide/index.tsx +6 -6
  129. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  130. package/themes/original/src/components/HelpOrder/index.tsx +6 -15
  131. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  132. package/themes/original/src/components/Home/index.tsx +13 -4
  133. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  134. package/themes/original/src/components/LoginForm/Otp/index.tsx +55 -13
  135. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  136. package/themes/original/src/components/LoginForm/index.tsx +64 -26
  137. package/themes/original/src/components/LottieAnimation/index.tsx +89 -55
  138. package/themes/original/src/components/MessageListing/index.tsx +16 -42
  139. package/themes/original/src/components/Messages/index.tsx +32 -10
  140. package/themes/original/src/components/MomentOption/index.tsx +194 -89
  141. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  142. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +151 -49
  143. package/themes/original/src/components/MultiCheckout/index.tsx +308 -88
  144. package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
  145. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  146. package/themes/original/src/components/MultiOrdersDetails/index.tsx +68 -21
  147. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  148. package/themes/original/src/components/MyOrders/index.tsx +77 -52
  149. package/themes/original/src/components/NavBar/index.tsx +18 -18
  150. package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
  151. package/themes/original/src/components/Notifications/index.tsx +46 -50
  152. package/themes/original/src/components/Notifications/styles.tsx +6 -3
  153. package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
  154. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +15 -3
  155. package/themes/original/src/components/OrderDetails/index.tsx +190 -358
  156. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  157. package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
  158. package/themes/original/src/components/OrderProgress/index.tsx +33 -59
  159. package/themes/original/src/components/OrderSummary/index.tsx +85 -57
  160. package/themes/original/src/components/OrderTypeSelector/index.tsx +1 -1
  161. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +24 -19
  162. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +14 -14
  163. package/themes/original/src/components/OrdersOption/index.tsx +76 -66
  164. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  165. package/themes/original/src/components/PageBanner/index.tsx +106 -31
  166. package/themes/original/src/components/PageBanner/styles.tsx +4 -4
  167. package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
  168. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  169. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  170. package/themes/original/src/components/PaymentOptions/index.tsx +64 -7
  171. package/themes/original/src/components/PhoneInputNumber/index.tsx +3 -3
  172. package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
  173. package/themes/original/src/components/ProductForm/index.tsx +109 -33
  174. package/themes/original/src/components/ProductForm/styles.tsx +5 -7
  175. package/themes/original/src/components/ProductItemAccordion/index.tsx +22 -19
  176. package/themes/original/src/components/ProductOptionSubOption/index.tsx +24 -14
  177. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +3 -4
  178. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  179. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
  180. package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
  181. package/themes/original/src/components/Promotions/index.tsx +234 -220
  182. package/themes/original/src/components/Promotions/styles.tsx +10 -3
  183. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  184. package/themes/original/src/components/ReviewOrder/index.tsx +26 -9
  185. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  186. package/themes/original/src/components/ReviewProducts/index.tsx +23 -11
  187. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  188. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  189. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  190. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  191. package/themes/original/src/components/ServiceForm/index.tsx +66 -17
  192. package/themes/original/src/components/Sessions/index.tsx +11 -8
  193. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  194. package/themes/original/src/components/SignupForm/index.tsx +43 -20
  195. package/themes/original/src/components/SingleOrderCard/index.tsx +130 -52
  196. package/themes/original/src/components/SingleOrderCard/styles.tsx +11 -2
  197. package/themes/original/src/components/SingleProductCard/index.tsx +71 -34
  198. package/themes/original/src/components/SingleProductCard/styles.tsx +21 -4
  199. package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
  200. package/themes/original/src/components/StripeCardsList/index.tsx +13 -3
  201. package/themes/original/src/components/StripeElementsForm/index.tsx +48 -34
  202. package/themes/original/src/components/UpsellingProducts/index.tsx +238 -224
  203. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  204. package/themes/original/src/components/UserDetails/index.tsx +8 -4
  205. package/themes/original/src/components/UserFormDetails/index.tsx +76 -7
  206. package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
  207. package/themes/original/src/components/UserProfile/index.tsx +88 -79
  208. package/themes/original/src/components/UserProfileForm/index.tsx +27 -29
  209. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  210. package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
  211. package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
  212. package/themes/original/src/components/Wallets/index.tsx +67 -24
  213. package/themes/original/src/components/Wallets/styles.tsx +3 -4
  214. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  215. package/themes/original/src/components/shared/OButton.tsx +6 -2
  216. package/themes/original/src/components/shared/OInput.tsx +6 -1
  217. package/themes/original/src/components/shared/OModal.tsx +3 -3
  218. package/themes/original/src/layouts/Container.tsx +1 -1
  219. package/themes/original/src/types/index.tsx +40 -11
  220. package/themes/original/src/utils/index.tsx +273 -1
  221. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -1,15 +1,17 @@
1
1
  import React, { useState } from 'react'
2
2
  import { PromotionsController, useLanguage, useUtils } from 'ordering-components/native'
3
+ import FastImage from 'react-native-fast-image'
3
4
  import {
4
- PromotionsContainer,
5
- SingleOfferContainer,
6
- OfferInformation,
7
- SearchBarContainer,
8
- SingleBusinessOffer,
9
- AvailableBusinesses,
10
- OfferData,
11
- Code,
12
- BusinessInfo
5
+ PromotionsContainer,
6
+ SingleOfferContainer,
7
+ OfferInformation,
8
+ SearchBarContainer,
9
+ SingleBusinessOffer,
10
+ AvailableBusinesses,
11
+ OfferData,
12
+ Code,
13
+ BusinessInfo,
14
+ WrapperSingleOffer
13
15
  } from './styles'
14
16
  import { SearchBar } from '../SearchBar'
15
17
  import NavBar from '../NavBar'
@@ -17,234 +19,246 @@ import { useTheme } from 'styled-components/native';
17
19
  import { OButton, OIcon, OModal, OText } from '../shared'
18
20
  import { Placeholder, PlaceholderLine } from 'rn-placeholder'
19
21
  import { NotFoundSource } from '../NotFoundSource'
20
- import { View, StyleSheet, ScrollView, Platform, RefreshControl } from 'react-native'
21
- import FastImage from 'react-native-fast-image'
22
+ import { View, StyleSheet, ScrollView, RefreshControl } from 'react-native'
22
23
  import { PromotionParams } from '../../types'
23
24
  import { Container } from '../../layouts/Container'
24
25
 
25
26
  const PromotionsUI = (props: PromotionParams) => {
26
- const {
27
- navigation,
28
- offersState,
29
- handleSearchValue,
30
- searchValue,
31
- loadOffers,
32
- offerSelected,
33
- setOfferSelected
34
- } = props
27
+ const {
28
+ navigation,
29
+ offersState,
30
+ handleSearchValue,
31
+ searchValue,
32
+ loadOffers,
33
+ offerSelected,
34
+ setOfferSelected
35
+ } = props
35
36
 
36
- const theme = useTheme();
37
+ const theme = useTheme();
37
38
 
38
- const styles = StyleSheet.create({
39
- productStyle: {
40
- width: 75,
41
- height: 75,
42
- borderRadius: 7.6
43
- },
44
- buttonStyle: {
45
- width: 55,
46
- height: 25,
47
- paddingLeft: 0,
48
- paddingRight: 0
49
- },
50
- offerTitle: {
51
- fontSize: 12
52
- },
53
- offerDescription: {
54
- color: '#909BA9',
55
- fontSize: 10
56
- },
57
- offerExtraInfo: {
58
- fontSize: 10
59
- },
60
- modalButtonStyle: {
61
- width: 100,
62
- height: 35,
63
- paddingLeft: 0,
64
- paddingRight: 0,
65
- borderRadius: 7.6
66
- }
67
- });
39
+ const styles = StyleSheet.create({
40
+ productStyle: {
41
+ width: 75,
42
+ height: 75,
43
+ borderRadius: 7.6
44
+ },
45
+ buttonStyle: {
46
+ width: '100%',
47
+ height: 35,
48
+ paddingLeft: 0,
49
+ paddingRight: 0,
50
+ borderRadius: 8
51
+ },
52
+ offerTitle: {
53
+ fontSize: 14
54
+ },
55
+ offerDescription: {
56
+ color: '#909BA9',
57
+ fontSize: 12
58
+ },
59
+ offerExtraInfo: {
60
+ fontSize: 12
61
+ },
62
+ modalButtonStyle: {
63
+ width: 100,
64
+ height: 35,
65
+ paddingLeft: 0,
66
+ paddingRight: 0,
67
+ borderRadius: 7.6
68
+ }
69
+ });
68
70
 
69
- const [, t] = useLanguage()
70
- const [{ parseDate, parsePrice, optimizeImage }] = useUtils()
71
- const [openModal, setOpenModal] = useState(false)
72
- const [refreshing] = useState(false);
71
+ const [, t] = useLanguage()
72
+ const [{ parseDate, parsePrice, optimizeImage }] = useUtils()
73
+ const [openModal, setOpenModal] = useState(false)
74
+ const [refreshing] = useState(false);
73
75
 
74
- const handleClickOffer = (offer: any) => {
75
- setOpenModal(true)
76
- setOfferSelected(offer)
77
- }
76
+ const handleClickOffer = (offer: any) => {
77
+ setOpenModal(true)
78
+ setOfferSelected(offer)
79
+ }
78
80
 
79
- const handleBusinessClick = (store: any) => {
80
- setOpenModal(false)
81
- navigation.navigate('Business', { store: store.slug })
82
- }
81
+ const handleBusinessClick = (store: any) => {
82
+ setOpenModal(false)
83
+ navigation.navigate('Business', { store: store.slug })
84
+ }
83
85
 
84
- const handleOnRefresh = () => {
85
- if (!offersState.loading) {
86
- loadOffers();
87
- }
86
+ const handleOnRefresh = () => {
87
+ if (!offersState.loading) {
88
+ loadOffers();
88
89
  }
90
+ }
89
91
 
90
- const filteredOffers = offersState?.offers?.filter((offer: any) => offer.name.toLowerCase().includes(searchValue.toLowerCase()))
91
- const targetString = offerSelected?.target === 1
92
- ? t('SUBTOTAL', 'Subtotal')
93
- : offerSelected?.target === 2
94
- ? t('DELIVERY_FEE', 'Delivery fee')
95
- : t('SERVICE_FEE', 'Service fee')
92
+ const filteredOffers = offersState?.offers?.filter((offer: any) => offer.name.toLowerCase().includes(searchValue.toLowerCase()))
93
+ const targetString = offerSelected?.target === 1
94
+ ? t('SUBTOTAL', 'Subtotal')
95
+ : offerSelected?.target === 2
96
+ ? t('DELIVERY_FEE', 'Delivery fee')
97
+ : t('SERVICE_FEE', 'Service fee')
96
98
 
97
- return (
98
- <Container
99
- noPadding
100
- refreshControl={
101
- <RefreshControl
102
- refreshing={refreshing}
103
- onRefresh={() => handleOnRefresh()}
99
+ return (
100
+ <Container
101
+ noPadding
102
+ pt={20}
103
+ refreshControl={
104
+ <RefreshControl
105
+ refreshing={refreshing}
106
+ onRefresh={() => handleOnRefresh()}
107
+ />
108
+ }
109
+ >
110
+ <NavBar
111
+ title={t('PROMOTIONS', 'Promotions')}
112
+ titleAlign={'center'}
113
+ onActionLeft={() => navigation.goBack()}
114
+ showCall={false}
115
+ style={{ paddingVertical: 0, marginLeft: 20 }}
116
+ />
117
+ <PromotionsContainer>
118
+ <SearchBarContainer>
119
+ <SearchBar
120
+ placeholder={t('SEARCH_OFFERS', 'Search offers')}
121
+ onSearch={handleSearchValue}
122
+ />
123
+ </SearchBarContainer>
124
+
125
+ {offersState?.loading && (
126
+ <>
127
+ {[...Array(5).keys()].map((key, i) => (
128
+ <Placeholder key={i} style={{ flexDirection: 'row', marginBottom: 20 }}>
129
+ <PlaceholderLine height={10} width={45} />
130
+ <PlaceholderLine height={10} width={60} />
131
+ <PlaceholderLine height={10} width={75} />
132
+ </Placeholder>
133
+ ))}
134
+ </>
135
+ )}
136
+ {((!offersState?.loading && filteredOffers?.length === 0) || offersState?.error) && (
137
+ <NotFoundSource
138
+ content={offersState?.error || t('NOT_FOUND_OFFERS', 'Not found offers')}
139
+ />
140
+ )}
141
+ <ScrollView>
142
+ {!offersState?.loading && offersState.offers?.length > 0 && filteredOffers?.map((offer: any) => (
143
+ <WrapperSingleOffer key={offer.id}>
144
+ <SingleOfferContainer>
145
+ <FastImage
146
+ style={{ height: 80, width: 80, aspectRatio: 1, borderRadius: 8 }}
147
+ source={typeof offer?.image !== 'number' ? {
148
+ uri: optimizeImage(offer?.image, 'h_1024,c_limit'),
149
+ priority: FastImage.priority.normal,
150
+ } : theme.images?.dummies?.businessLogo}
104
151
  />
105
- }
152
+ <OfferInformation>
153
+ <OText style={styles.offerTitle} numberOfLines={2}>{offer?.name}</OText>
154
+ {!!offer?.description && (
155
+ <OText style={styles.offerDescription} numberOfLines={2}>{offer?.description}</OText>
156
+ )}
157
+ <OText style={styles.offerExtraInfo}>
158
+ {t('EXPIRES', 'Expires')} {parseDate(offer?.end, { outputFormat: 'MMM DD, YYYY' })}
159
+ </OText>
160
+ <AvailableBusinesses>
161
+ <OText style={styles.offerExtraInfo} numberOfLines={1}>
162
+ {t('APPLY_FOR', 'Apply for')}:
163
+ {offer.businesses.map((business: any, i: number) => (
164
+ <React.Fragment key={i}>{' '}{business?.name}{i + 1 < offer.businesses?.length ? ',' : ''}</React.Fragment>
165
+ ))}
166
+ </OText>
167
+ </AvailableBusinesses>
168
+ </OfferInformation>
169
+ </SingleOfferContainer>
170
+ <OButton
171
+ onClick={() => handleClickOffer(offer)}
172
+ text={t('VIEW', 'View')}
173
+ style={styles.buttonStyle}
174
+ textStyle={{ fontSize: 14, color: '#fff', flexWrap: 'nowrap' }}
175
+ />
176
+ </WrapperSingleOffer>
177
+ ))}
178
+ </ScrollView>
179
+ <OModal
180
+ open={openModal}
181
+ entireModal
182
+ title={``}
183
+ onClose={() => setOpenModal(false)}
106
184
  >
107
- <NavBar
108
- title={t('PROMOTIONS', 'Promotions')}
109
- titleAlign={'center'}
110
- onActionLeft={() => navigation.goBack()}
111
- showCall={false}
112
- style={{ paddingVertical: Platform.OS === 'ios' ? 0 : 20, marginLeft: 20 }}
113
- />
114
- <PromotionsContainer>
115
- <SearchBarContainer>
116
- <SearchBar
117
- placeholder={t('SEARCH_OFFERS', 'Search offers')}
118
- onSearch={handleSearchValue}
119
- />
120
- </SearchBarContainer>
121
-
122
- {offersState?.loading && (
123
- <>
124
- {[...Array(5).keys()].map((key, i) => (
125
- <Placeholder key={i} style={{ flexDirection: 'row', marginBottom: 20 }}>
126
- <PlaceholderLine height={10} width={45} />
127
- <PlaceholderLine height={10} width={60} />
128
- <PlaceholderLine height={10} width={75} />
129
- </Placeholder>
130
- ))}
131
- </>
132
- )}
133
- {((!offersState?.loading && filteredOffers?.length === 0) || offersState?.error) && (
134
- <NotFoundSource
135
- content={offersState?.error || t('NOT_FOUND_OFFERS', 'Not found offers')}
136
- />
137
- )}
138
- <ScrollView>
139
- {!offersState?.loading && offersState.offers?.length > 0 && filteredOffers?.map((offer: any) => (
140
- <SingleOfferContainer key={offer.id}>
141
- <OfferInformation>
142
- <OText style={styles.offerTitle} numberOfLines={2}>{offer?.name}</OText>
143
- {!!offer?.description && (
144
- <OText style={styles.offerDescription} numberOfLines={2}>{offer?.description}</OText>
145
- )}
146
- <OText style={styles.offerExtraInfo}>
147
- {t('EXPIRES', 'Expires')} {parseDate(offer?.end, { outputFormat: 'MMM DD, YYYY' })}
148
- </OText>
149
- <AvailableBusinesses>
150
- <OText style={styles.offerExtraInfo} numberOfLines={1}>
151
- {t('APPLY_FOR', 'Apply for')}:
152
- {offer.businesses.map((business: any, i: number) => (
153
- <React.Fragment key={i}>{' '}{business?.name}{i + 1 < offer.businesses?.length ? ',' : ''}</React.Fragment>
154
- ))}
155
- </OText>
156
- </AvailableBusinesses>
157
- </OfferInformation>
158
- <OButton
159
- onClick={() => handleClickOffer(offer)}
160
- text={t('VIEW', 'View')}
161
- style={styles.buttonStyle}
162
- textStyle={{ fontSize: 10, color: '#fff', flexWrap: 'nowrap' }}
163
- />
164
- </SingleOfferContainer>
165
- ))}
166
- </ScrollView>
167
- <OModal
168
- open={openModal}
169
- onClose={() => setOpenModal(false)}
170
- entireModal
171
-
172
- title={``}
173
- >
174
- <View style={{ padding: 20 }}>
175
- <OText style={{ alignSelf: 'center', fontWeight: '700' }} mBottom={20}>
176
- {offerSelected?.name} / {t('VALUE_OF_OFFER', 'Value of offer')}: {offerSelected?.rate_type === 1 ? `${offerSelected?.rate}%` : `${parsePrice(offerSelected?.rate)}`}
177
- </OText>
178
- <OfferData>
179
- {offerSelected?.type === 2 && (
180
- <Code>
181
- <OText>{t('YOUR_CODE', 'Your code')}</OText>
182
- <OText color={theme.colors.primary}>{offerSelected.coupon}</OText>
183
- </Code>
184
- )}
185
- <OText>{t('APPLIES_TO', 'Applies to')}: {targetString}</OText>
186
- {offerSelected?.auto && (
187
- <OText>{t('OFFER_AUTOMATIC', 'This offer applies automatic')}</OText>
188
- )}
189
- {!!offerSelected?.minimum && (
190
- <OText>{t('MINIMUM_PURCHASE_FOR_OFFER', 'Minimum purchase for use this offer')}: {parsePrice(offerSelected?.minimum)}</OText>
191
- )}
192
- {!!offerSelected?.max_discount && (
193
- <OText>{t('MAX_DISCOUNT_ALLOWED', 'Max discount allowed')}: {parsePrice(offerSelected?.max_discount)}</OText>
194
- )}
195
- {!!offerSelected?.description && (
196
- <OText>{offerSelected?.description}</OText>
197
- )}
198
- </OfferData>
199
- <OText style={{ marginTop: 10, marginBottom: 10 }}>
200
- {t('AVAILABLE_BUSINESSES_FOR_OFFER', 'Available businesses for this offer')}:
201
- </OText>
202
- <ScrollView style={{ height: '75%' }}>
203
- {offerSelected?.businesses?.map((business: any) => {
204
- return (
205
- <SingleBusinessOffer key={business.id}>
206
- {business?.logo ? (
207
- <FastImage
208
- style={styles.productStyle}
209
- source={{
210
- uri: optimizeImage(business?.logo, 'h_250,c_limit'),
211
- priority: FastImage.priority.normal,
212
- }}
213
- resizeMode={FastImage.resizeMode.cover}
214
- />
215
- ) : (
216
- <OIcon
217
- src={theme?.images?.dummies?.product}
218
- style={styles.productStyle}
219
- />
220
- )}
221
- <BusinessInfo>
222
- <OText style={{ maxWidth: '60%' }}>{business.name}</OText>
223
- <OButton
224
- onClick={() => handleBusinessClick(business)}
225
- text={t('GO_TO_BUSINESSS', 'Go to business')}
226
- style={styles.modalButtonStyle}
227
- textStyle={{ fontSize: 10, color: '#fff' }}
228
- />
229
- </BusinessInfo>
230
- </SingleBusinessOffer>
231
- )
232
- })}
233
- </ScrollView>
234
- </View>
235
- </OModal>
236
- </PromotionsContainer>
237
- </Container>
238
- )
185
+ <View style={{ padding: 20 }}>
186
+ <OText style={{ alignSelf: 'center', fontWeight: '700' }} mBottom={20}>
187
+ {offerSelected?.name} / {t('VALUE_OF_OFFER', 'Value of offer')}: {offerSelected?.rate_type === 1 ? `${offerSelected?.rate}%` : `${parsePrice(offerSelected?.rate)}`}
188
+ </OText>
189
+ <OfferData>
190
+ {offerSelected?.type === 2 && (
191
+ <Code>
192
+ <OText>{t('YOUR_CODE', 'Your code')}</OText>
193
+ <OText color={theme.colors.primary}>{offerSelected.coupon}</OText>
194
+ </Code>
195
+ )}
196
+ <OText>{t('APPLIES_TO', 'Applies to')}: {targetString}</OText>
197
+ {offerSelected?.auto && (
198
+ <OText>{t('OFFER_AUTOMATIC', 'This offer applies automatic')}</OText>
199
+ )}
200
+ {!!offerSelected?.minimum && (
201
+ <OText>{t('MINIMUM_PURCHASE_FOR_OFFER', 'Minimum purchase for use this offer')}: {parsePrice(offerSelected?.minimum)}</OText>
202
+ )}
203
+ {!!offerSelected?.max_discount && (
204
+ <OText>{t('MAX_DISCOUNT_ALLOWED', 'Max discount allowed')}: {parsePrice(offerSelected?.max_discount)}</OText>
205
+ )}
206
+ {!!offerSelected?.description && (
207
+ <OText>{offerSelected?.description}</OText>
208
+ )}
209
+ </OfferData>
210
+ <OText style={{ marginTop: 10, marginBottom: 10 }}>
211
+ {t('AVAILABLE_BUSINESSES_FOR_OFFER', 'Available businesses for this offer')}:
212
+ </OText>
213
+ <ScrollView
214
+ showsVerticalScrollIndicator={false}
215
+ style={{ height: '68%' }}
216
+ >
217
+ {offerSelected?.businesses?.map((business: any) => {
218
+ return (
219
+ <SingleBusinessOffer key={business.id}>
220
+ {business?.logo ? (
221
+ <FastImage
222
+ style={styles.productStyle}
223
+ source={{
224
+ uri: optimizeImage(business?.logo, 'h_250,c_limit'),
225
+ priority: FastImage.priority.normal,
226
+ }}
227
+ resizeMode={FastImage.resizeMode.cover}
228
+ />
229
+ ) : (
230
+ <OIcon
231
+ src={theme?.images?.dummies?.product}
232
+ style={styles.productStyle}
233
+ />
234
+ )}
235
+ <BusinessInfo>
236
+ <OText style={{ maxWidth: '60%' }}>{business.name}</OText>
237
+ <OButton
238
+ onClick={() => handleBusinessClick(business)}
239
+ text={t('GO_TO_BUSINESSS', 'Go to business')}
240
+ style={styles.modalButtonStyle}
241
+ textStyle={{ fontSize: 10, color: '#fff' }}
242
+ />
243
+ </BusinessInfo>
244
+ </SingleBusinessOffer>
245
+ )
246
+ })}
247
+ </ScrollView>
248
+ </View>
249
+ </OModal>
250
+ </PromotionsContainer>
251
+ </Container>
252
+ )
239
253
  }
240
254
 
241
255
  export const Promotions = (props: PromotionParams) => {
242
- const PromotionsProps = {
243
- ...props,
244
- UIComponent: PromotionsUI
245
- }
256
+ const PromotionsProps = {
257
+ ...props,
258
+ UIComponent: PromotionsUI
259
+ }
246
260
 
247
- return (
248
- <PromotionsController {...PromotionsProps} />
249
- )
261
+ return (
262
+ <PromotionsController {...PromotionsProps} />
263
+ )
250
264
  }
@@ -6,18 +6,24 @@ export const PromotionsContainer = styled.View`
6
6
  padding-right: 40px;
7
7
  `
8
8
 
9
+ export const WrapperSingleOffer = styled.View`
10
+ flex-direction: column;
11
+ width: 100%;
12
+ margin-bottom: 30px;
13
+ `
14
+
9
15
  export const SingleOfferContainer = styled.View`
10
16
  flex-direction: row;
11
17
  width: 100%;
12
18
  justify-content: space-between;
13
19
  align-items: center;
14
- margin-bottom: 20px;
15
-
20
+ margin-bottom: 10px;
16
21
  `
17
22
 
18
23
  export const OfferInformation = styled.View`
19
24
  justify-content: space-between;
20
- max-width: 75%;
25
+ min-width: 70%;
26
+ max-width: 70%;
21
27
  `
22
28
 
23
29
  export const SearchBarContainer = styled.View`
@@ -29,6 +35,7 @@ export const SearchBarContainer = styled.View`
29
35
 
30
36
  export const SingleBusinessOffer = styled.View`
31
37
  flex-direction: row;
38
+ margin-bottom: 10px;
32
39
  `
33
40
 
34
41
  export const AvailableBusinesses = styled.View`
@@ -131,7 +131,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
131
131
  if (!order?.user_review && !isDriverReviewed) {
132
132
  onSubmit()
133
133
  } else {
134
- onNavigationRedirect && onNavigationRedirect('MyOrders')
134
+ onNavigationRedirect('BottomTab', { screen: 'MyOrders' })
135
135
  }
136
136
  }
137
137
 
@@ -145,7 +145,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
145
145
  }
146
146
  if (!formState.loading && !formState.result?.error && alertState.success) {
147
147
  setIsDriverReviewed && setIsDriverReviewed(true)
148
- onNavigationRedirect('MyOrders')
148
+ onNavigationRedirect('BottomTab', { screen: 'MyOrders' })
149
149
  }
150
150
  }, [formState])
151
151
 
@@ -186,7 +186,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
186
186
  <NavBar
187
187
  title={t('REVIEW_DRIVER', 'Review driver')}
188
188
  titleAlign={'center'}
189
- onActionLeft={() => onNavigationRedirect('BottomTab')}
189
+ onActionLeft={() => onNavigationRedirect('BottomTab', { screen: 'MyOrders' })}
190
190
  showCall={false}
191
191
  btnStyle={{ paddingLeft: 0 }}
192
192
  style={{ flexDirection: 'column', alignItems: 'flex-start' }}
@@ -11,7 +11,8 @@ import {
11
11
  ActionContainer,
12
12
  SkipButton,
13
13
  RatingBarContainer,
14
- RatingTextContainer
14
+ RatingTextContainer,
15
+ MultiLogosContainer
15
16
  } from './styles'
16
17
  import { OButton, OIcon, OInput, OText } from '../shared'
17
18
  import { TouchableOpacity, StyleSheet, View, I18nManager } from 'react-native';
@@ -215,14 +216,30 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
215
216
  titleWrapStyle={{ paddingHorizontal: 0 }}
216
217
  titleStyle={{ marginRight: 0, marginLeft: 0 }}
217
218
  />
218
- <BusinessLogo>
219
- <View style={styles.logoWrapper}>
220
- <OIcon
221
- url={order?.logo}
222
- width={80}
223
- height={80}
224
- />
225
- </View>
219
+ <BusinessLogo isMulti={order?.business?.length > 1}>
220
+ {typeof order?.logo === 'string' || !order?.logo ? (
221
+ <View style={styles.logoWrapper}>
222
+ <OIcon
223
+ url={order?.logo}
224
+ width={80}
225
+ height={80}
226
+ />
227
+ </View>
228
+ ) : (
229
+ <MultiLogosContainer>
230
+ {order?.logo?.map((logo : string, i : number) => (
231
+ <React.Fragment key={logo}>
232
+ <View style={styles.logoWrapper}>
233
+ <OIcon
234
+ url={logo}
235
+ width={80}
236
+ height={80}
237
+ />
238
+ </View>
239
+ </React.Fragment>
240
+ ))}
241
+ </MultiLogosContainer>
242
+ )}
226
243
  </BusinessLogo>
227
244
  {order?.review ? (
228
245
  <View style={styles.reviewedStyle}>
@@ -42,3 +42,10 @@ export const RatingTextContainer = styled.View`
42
42
  justify-content: space-between;
43
43
  margin-top: 10px;
44
44
  `
45
+
46
+ export const MultiLogosContainer = styled.View`
47
+ display: flex;
48
+ justify-content: space-around;
49
+ flex-direction: row;
50
+ width: 100%;
51
+ `