ordering-ui-react-native 0.16.50 → 0.16.51-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 (205) hide show
  1. package/package.json +6 -5
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/ActiveOrders/index.tsx +61 -63
  4. package/src/components/ActiveOrders/styles.tsx +8 -14
  5. package/src/components/BusinessInformation/index.tsx +33 -4
  6. package/src/components/BusinessInformation/styles.tsx +2 -2
  7. package/src/components/BusinessProductsList/index.tsx +10 -10
  8. package/src/components/BusinessesListing/index.tsx +1 -1
  9. package/src/components/Checkout/index.tsx +2 -1
  10. package/src/components/LanguageSelector/index.tsx +21 -16
  11. package/src/components/Messages/index.tsx +2 -2
  12. package/src/components/NotificationSetting/index.tsx +85 -0
  13. package/src/components/OrdersOption/index.tsx +54 -56
  14. package/src/components/PaymentOptions/index.tsx +298 -345
  15. package/src/components/PaymentOptionsWebView/index.tsx +120 -121
  16. package/src/components/ReviewProducts/index.tsx +11 -0
  17. package/src/components/SingleProductReview/index.tsx +8 -5
  18. package/src/components/StripeElementsForm/index.tsx +25 -16
  19. package/src/components/VerifyPhone/styles.tsx +1 -2
  20. package/src/components/shared/OBottomPopup.tsx +6 -2
  21. package/src/components/shared/OToast.tsx +4 -4
  22. package/src/index.tsx +2 -0
  23. package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
  24. package/src/utils/index.tsx +2 -1
  25. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +259 -238
  26. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  27. package/themes/business/src/components/BusinessController/index.tsx +2 -2
  28. package/themes/business/src/components/Chat/index.tsx +40 -32
  29. package/themes/business/src/components/DriverMap/index.tsx +7 -5
  30. package/themes/business/src/components/DriverSchedule/index.tsx +36 -19
  31. package/themes/business/src/components/LoginForm/index.tsx +111 -74
  32. package/themes/business/src/components/MapView/index.tsx +12 -1
  33. package/themes/business/src/components/MessagesOption/index.tsx +11 -1
  34. package/themes/business/src/components/NewOrderNotification/index.tsx +26 -41
  35. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +40 -30
  36. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +3 -3
  37. package/themes/business/src/components/OrdersListManager/index.tsx +10 -3
  38. package/themes/business/src/components/OrdersOption/index.tsx +76 -77
  39. package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
  40. package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
  41. package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
  42. package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
  43. package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
  44. package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
  45. package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
  46. package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
  47. package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
  48. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
  49. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  50. package/themes/business/src/components/PreviousOrders/index.tsx +332 -244
  51. package/themes/business/src/components/PreviousOrders/styles.tsx +30 -2
  52. package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
  53. package/themes/business/src/components/ReviewCustomer/index.tsx +39 -15
  54. package/themes/business/src/components/ScheduleBlocked/index.tsx +2 -2
  55. package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
  56. package/themes/business/src/components/UserProfileForm/index.tsx +2 -0
  57. package/themes/business/src/components/shared/ODropDown.tsx +42 -8
  58. package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
  59. package/themes/business/src/components/shared/OLink.tsx +24 -12
  60. package/themes/business/src/components/shared/OText.tsx +3 -2
  61. package/themes/business/src/types/index.tsx +25 -11
  62. package/themes/business/src/utils/index.tsx +10 -0
  63. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  64. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  65. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  66. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  67. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  68. package/themes/kiosk/src/components/LoginForm/index.tsx +121 -10
  69. package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
  70. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  71. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  72. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  73. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  74. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  75. package/themes/kiosk/src/types/index.d.ts +2 -0
  76. package/themes/original/index.tsx +8 -0
  77. package/themes/original/src/components/AddressDetails/index.tsx +10 -8
  78. package/themes/original/src/components/AddressForm/index.tsx +157 -140
  79. package/themes/original/src/components/AddressList/index.tsx +1 -1
  80. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  81. package/themes/original/src/components/BusinessBasicInformation/index.tsx +218 -147
  82. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +2 -2
  83. package/themes/original/src/components/BusinessController/index.tsx +192 -91
  84. package/themes/original/src/components/BusinessController/styles.tsx +14 -9
  85. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  86. package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
  87. package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
  88. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
  89. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
  90. package/themes/original/src/components/BusinessListingSearch/index.tsx +85 -137
  91. package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
  92. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
  93. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
  94. package/themes/original/src/components/BusinessProductsList/index.tsx +59 -61
  95. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  96. package/themes/original/src/components/BusinessProductsListing/index.tsx +179 -83
  97. package/themes/original/src/components/BusinessProductsListing/styles.tsx +19 -12
  98. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
  99. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +37 -30
  100. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +3 -2
  101. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +299 -148
  102. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +47 -11
  103. package/themes/original/src/components/BusinessesListing/index.tsx +80 -25
  104. package/themes/original/src/components/Cart/index.tsx +82 -15
  105. package/themes/original/src/components/Cart/styles.tsx +4 -0
  106. package/themes/original/src/components/CartContent/index.tsx +27 -17
  107. package/themes/original/src/components/CartContent/styles.tsx +1 -1
  108. package/themes/original/src/components/Checkout/index.tsx +114 -118
  109. package/themes/original/src/components/Checkout/styles.tsx +4 -3
  110. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  111. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  112. package/themes/original/src/components/DriverTips/index.tsx +4 -4
  113. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  114. package/themes/original/src/components/FavoriteList/index.tsx +69 -45
  115. package/themes/original/src/components/FloatingButton/index.tsx +13 -11
  116. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  117. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  118. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  119. package/themes/original/src/components/GoogleMap/index.tsx +20 -12
  120. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +25 -10
  121. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +4 -0
  122. package/themes/original/src/components/HelpGuide/index.tsx +9 -8
  123. package/themes/original/src/components/HelpOrder/index.tsx +9 -8
  124. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  125. package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
  126. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  127. package/themes/original/src/components/LoginForm/index.tsx +98 -41
  128. package/themes/original/src/components/LottieAnimation/index.tsx +69 -0
  129. package/themes/original/src/components/Messages/index.tsx +35 -20
  130. package/themes/original/src/components/MomentOption/index.tsx +8 -6
  131. package/themes/original/src/components/MultiCart/index.tsx +63 -0
  132. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
  133. package/themes/original/src/components/MultiCheckout/index.tsx +10 -2
  134. package/themes/original/src/components/MultiOrdersDetails/index.tsx +34 -16
  135. package/themes/original/src/components/MyOrders/index.tsx +88 -24
  136. package/themes/original/src/components/NavBar/index.tsx +11 -5
  137. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  138. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  139. package/themes/original/src/components/Notifications/index.tsx +148 -0
  140. package/themes/original/src/components/Notifications/styles.tsx +17 -0
  141. package/themes/original/src/components/OrderDetails/index.tsx +162 -50
  142. package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
  143. package/themes/original/src/components/OrderItAgain/index.tsx +75 -0
  144. package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
  145. package/themes/original/src/components/OrderProgress/index.tsx +77 -66
  146. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  147. package/themes/original/src/components/OrderSummary/index.tsx +2 -35
  148. package/themes/original/src/components/OrderTypeSelector/index.tsx +85 -36
  149. package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
  150. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +94 -98
  151. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  152. package/themes/original/src/components/OrdersOption/index.tsx +91 -53
  153. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  154. package/themes/original/src/components/PaymentOptions/index.tsx +1 -2
  155. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  156. package/themes/original/src/components/PlaceSpot/index.tsx +249 -47
  157. package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
  158. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  159. package/themes/original/src/components/ProductForm/index.tsx +365 -384
  160. package/themes/original/src/components/ProductForm/styles.tsx +7 -12
  161. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  162. package/themes/original/src/components/ProductOption/index.tsx +1 -1
  163. package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
  164. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +0 -1
  165. package/themes/original/src/components/ProfessionalFilter/index.tsx +2 -1
  166. package/themes/original/src/components/ProfessionalProfile/index.tsx +19 -8
  167. package/themes/original/src/components/Promotions/index.tsx +232 -219
  168. package/themes/original/src/components/Promotions/styles.tsx +7 -2
  169. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  170. package/themes/original/src/components/ReviewOrder/index.tsx +120 -108
  171. package/themes/original/src/components/ReviewOrder/styles.tsx +5 -7
  172. package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
  173. package/themes/original/src/components/ReviewTrigger/index.tsx +136 -0
  174. package/themes/original/src/components/ReviewTrigger/styles.tsx +41 -0
  175. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  176. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  177. package/themes/original/src/components/ServiceForm/index.tsx +341 -267
  178. package/themes/original/src/components/SignupForm/index.tsx +160 -113
  179. package/themes/original/src/components/SingleOrderCard/index.tsx +219 -129
  180. package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
  181. package/themes/original/src/components/SingleProductCard/index.tsx +180 -104
  182. package/themes/original/src/components/SingleProductCard/styles.tsx +3 -10
  183. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  184. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  185. package/themes/original/src/components/StripeElementsForm/index.tsx +13 -2
  186. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -5
  187. package/themes/original/src/components/UserDetails/index.tsx +5 -3
  188. package/themes/original/src/components/UserFormDetails/index.tsx +6 -48
  189. package/themes/original/src/components/UserProfile/index.tsx +58 -35
  190. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  191. package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
  192. package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
  193. package/themes/original/src/components/Wallets/index.tsx +176 -164
  194. package/themes/original/src/components/Wallets/styles.tsx +12 -8
  195. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  196. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  197. package/themes/original/src/components/shared/OBottomPopup.tsx +48 -15
  198. package/themes/original/src/components/shared/OButton.tsx +10 -3
  199. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  200. package/themes/original/src/components/shared/OInput.tsx +10 -1
  201. package/themes/original/src/layouts/Container.tsx +13 -9
  202. package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
  203. package/themes/original/src/types/index.tsx +79 -23
  204. package/themes/original/src/utils/index.tsx +103 -58
  205. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -1,6 +1,5 @@
1
1
  import React, { useState, useEffect } from 'react'
2
- import FontAwesome from 'react-native-vector-icons/FontAwesome';
3
- import { OrderReview as ReviewOrderController, useLanguage, useToast, ToastType, useUtils } from 'ordering-components/native'
2
+ import { OrderReview as ReviewOrderController, useLanguage, useToast, ToastType } from 'ordering-components/native'
4
3
  import { useForm, Controller } from 'react-hook-form'
5
4
  import LinearGradient from 'react-native-linear-gradient'
6
5
 
@@ -13,8 +12,7 @@ import {
13
12
  SkipButton,
14
13
  RatingBarContainer,
15
14
  RatingTextContainer,
16
- RatingStarContainer,
17
- PlacedDate
15
+ MultiLogosContainer
18
16
  } from './styles'
19
17
  import { OButton, OIcon, OInput, OText } from '../shared'
20
18
  import { TouchableOpacity, StyleSheet, View, I18nManager } from 'react-native';
@@ -91,11 +89,11 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
91
89
  const [, t] = useLanguage()
92
90
  const [, { showToast }] = useToast()
93
91
  const { handleSubmit, control, errors } = useForm()
94
- const [{ parseDate }] = useUtils()
92
+
95
93
  const [alertState, setAlertState] = useState<{ open: boolean, content: Array<any>, success?: boolean }>({ open: false, content: [], success: false })
96
94
  const [comments, setComments] = useState<Array<any>>([])
97
95
  const [extraComment, setExtraComment] = useState('')
98
- const placedOnDate = parseDate(order?.delivery_datetime, { outputFormat: 'dddd MMMM DD, YYYY' })
96
+ const [enableProduct, setEnableProduct] = useState(true)
99
97
 
100
98
  const onSubmit = () => {
101
99
  if (Object.values(stars).some((value: any) => value === 0)) {
@@ -109,6 +107,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
109
107
  handleReviewState && handleReviewState(order?.id)
110
108
  setIsReviewed && setIsReviewed(true)
111
109
  setAlertState({ ...alertState, success: true })
110
+ !enableProduct && navigation?.canGoBack() && navigation.goBack()
112
111
  }
113
112
 
114
113
  const qualificationList = [
@@ -145,7 +144,16 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
145
144
  if (!order?.review) {
146
145
  onSubmit()
147
146
  } else {
148
- onNavigationRedirect('ReviewProducts', { order: order })
147
+ skipOrderReview()
148
+ }
149
+ }
150
+
151
+ const skipOrderReview = () => {
152
+ if (enableProduct) onNavigationRedirect('ReviewProducts', { order: order })
153
+ else if (order?.driver && !order?.user_review) {
154
+ onNavigationRedirect('ReviewDriver', { order: order })
155
+ } else {
156
+ navigation?.canGoBack() && navigation.goBack()
149
157
  }
150
158
  }
151
159
 
@@ -191,30 +199,48 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
191
199
  setStars({ ...stars, comments: _comment })
192
200
  }, [comments, extraComment])
193
201
 
202
+ useEffect(() => {
203
+ setEnableProduct(!order?.products.every(product => product?.deleted))
204
+ }, [order])
205
+
194
206
  return (
195
207
  <>
196
208
  <ReviewOrderContainer>
197
209
  <NavBar
198
- title={t('HEY', 'Hey! ') + t('HOW_WAS_YOUR_ORDER', 'How was your order?')}
210
+ title={t('REVIEW_ORDER', 'Review your Order')}
199
211
  titleAlign={'center'}
200
- leftImg={theme.images.general.close}
201
212
  onActionLeft={() => navigation?.canGoBack() && navigation.goBack()}
202
213
  showCall={false}
203
214
  btnStyle={{ paddingLeft: 0 }}
204
- style={{ flexDirection: 'column', alignItems: 'flex-start', justifyContent: 'center' }}
205
- titleWrapStyle={{ paddingHorizontal: 0, width: '100%', justifyContent: 'center' }}
206
- titleStyle={{ textAlign: 'center', marginRight: 0, marginLeft: 0 }}
215
+ style={{ flexDirection: 'column', alignItems: 'flex-start' }}
216
+ titleWrapStyle={{ paddingHorizontal: 0 }}
217
+ titleStyle={{ marginRight: 0, marginLeft: 0 }}
207
218
  />
208
- <BusinessLogo>
209
- <View style={styles.logoWrapper}>
210
- <OIcon
211
- url={order?.logo}
212
- width={80}
213
- height={80}
214
- />
215
- </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
+ )}
216
243
  </BusinessLogo>
217
- {!!order?.business_name && <OText style={{ textAlign: 'center', marginTop: 15 }} color={theme.colors.textNormal}>{order?.business_name}</OText>}
218
244
  {order?.review ? (
219
245
  <View style={styles.reviewedStyle}>
220
246
  <OText color={theme.colors.primary}>{t('ORDER_REVIEWED', 'This order has been already reviewed')}</OText>
@@ -222,92 +248,78 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
222
248
  ) : (
223
249
  <View style={{ flex: 1, justifyContent: 'flex-end' }}>
224
250
  <FormReviews>
225
- {/* <OText mBottom={13} color={theme.colors.textNormal}>{t('HOW_WAS_YOUR_ORDER', 'How was your order?')}</OText> */}
226
- {false && (
227
- <RatingBarContainer>
228
- <LinearGradient
229
- start={{ x: 0.0, y: 0.0 }}
230
- end={{ x: qualificationList[stars.quality - 1]?.percent || 0, y: 0 }}
231
- locations={[.9999, .9999]}
232
- colors={[theme.colors.primary, theme.colors.backgroundGray200]}
233
- style={styles.statusBar}
234
- />
235
- <RatingTextContainer>
236
- {qualificationList.map((qualification: any) => (
237
- <View
238
- key={qualification.key}
239
- style={{ ...qualification.parentStyle, ...styles.ratingItemContainer }}
251
+ <OText mBottom={13} color={theme.colors.textNormal}>{t('HOW_WAS_YOUR_ORDER', 'How was your order?')}</OText>
252
+ <RatingBarContainer>
253
+ <LinearGradient
254
+ start={{ x: 0.0, y: 0.0 }}
255
+ end={{ x: qualificationList[stars.quality - 1]?.percent || 0, y: 0 }}
256
+ locations={[.9999, .9999]}
257
+ colors={[theme.colors.primary, theme.colors.backgroundGray200]}
258
+ style={styles.statusBar}
259
+ />
260
+ <RatingTextContainer>
261
+ {qualificationList.map((qualification: any) => (
262
+ <View
263
+ key={qualification.key}
264
+ style={{ ...qualification.parentStyle, ...styles.ratingItemContainer }}
265
+ >
266
+ <TouchableOpacity
267
+ style={qualification.isInnerStyle && styles.ratingItem}
268
+ onPress={() => handleChangeStars(qualification.key)}
240
269
  >
241
- <TouchableOpacity
242
- style={qualification.isInnerStyle && styles.ratingItem}
243
- onPress={() => handleChangeStars(qualification.key)}
244
- >
245
- <View
246
- style={{
247
- ...styles.ratingLineStyle,
248
- backgroundColor: (qualification.pointerColor && !(stars.quality >= qualification.key)) ? theme.colors.dusk : 'transparent'
249
- }}
250
- />
251
- <OText size={12} color={stars.quality === qualification.key ? theme.colors.black : theme.colors.backgroundGray200}>{qualification.text}</OText>
252
- </TouchableOpacity>
253
- </View>
254
- ))}
255
- </RatingTextContainer>
256
- </RatingBarContainer>
257
- )}
258
- <RatingStarContainer>
259
- {[...Array(5).keys()].map((index) => (<FontAwesome name={(index <= (stars?.quality - 1)) ? 'star' : 'star-o'} size={28} key={`star-symbol-${index}`} onPress={() => handleChangeStars(index + 1)} color={theme?.colors?.primary} />)
270
+ <View
271
+ style={{
272
+ ...styles.ratingLineStyle,
273
+ backgroundColor: (qualification.pointerColor && !(stars.quality >= qualification.key)) ? theme.colors.dusk : 'transparent'
274
+ }}
275
+ />
276
+ <OText size={12} color={stars.quality === qualification.key ? theme.colors.black : theme.colors.backgroundGray200}>{qualification.text}</OText>
277
+ </TouchableOpacity>
278
+ </View>
279
+ ))}
280
+ </RatingTextContainer>
281
+ </RatingBarContainer>
282
+
283
+ <OText style={{ marginTop: 30 }} color={theme.colors.textNormal}>
284
+ {commentsList[stars?.quality || 1]?.title}
285
+ </OText>
286
+ <CommentsButtonGroup>
287
+ {commentsList[stars?.quality || 1]?.list?.map(commentItem => (
288
+ <OButton
289
+ key={commentItem.key}
290
+ text={commentItem.content}
291
+ bgColor={isSelectedComment(commentItem.key) ? theme.colors.primary : theme.colors.backgroundGray200}
292
+ borderColor={isSelectedComment(commentItem.key) ? theme.colors.primary : theme.colors.backgroundGray200}
293
+ textStyle={{
294
+ color: isSelectedComment(commentItem.key) ? theme.colors.white : theme.colors.black,
295
+ fontSize: 13,
296
+ paddingRight: isSelectedComment(commentItem.key) ? 15 : 0
297
+ }}
298
+ style={{ height: 35, paddingLeft: 5, paddingRight: 5, marginHorizontal: 3, marginVertical: 10 }}
299
+ imgRightSrc={isSelectedComment(commentItem.key) ? theme.images.general.close : null}
300
+ imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
301
+ onClick={() => handleChangeComment(commentItem)}
302
+ />
303
+ ))}
304
+ </CommentsButtonGroup>
305
+
306
+ <OText style={{ marginTop: 30 }} color={theme.colors.textNormal}>{t('REVIEW_COMMENT_QUESTION', 'Do you want to add something?')}</OText>
307
+ <Controller
308
+ control={control}
309
+ defaultValue=''
310
+ name='comments'
311
+ render={({ onChange }: any) => (
312
+ <OInput
313
+ name='comments'
314
+ onChange={(val: any) => {
315
+ onChange(val)
316
+ setExtraComment(val.target.value)
317
+ }}
318
+ style={styles.inputTextArea}
319
+ multiline
320
+ />
260
321
  )}
261
- </RatingStarContainer>
262
- <PlacedDate>
263
- <OText color={theme.colors.textNormal}>{t('DONOT_FORGET_RATE_YOUR_ORDER', 'Do not forget to rate your order placed on ')}</OText>
264
- <OText color={theme.colors.textNormal} style={{ fontWeight: "bold" }}>{placedOnDate}</OText>
265
- </PlacedDate>
266
- {false && (
267
- <>
268
- <OText style={{ marginTop: 30 }} color={theme.colors.textNormal}>
269
- {commentsList[stars?.quality || 1]?.title}
270
- </OText>
271
- <CommentsButtonGroup>
272
- {commentsList[stars?.quality || 1]?.list?.map((commentItem: any) => (
273
- <OButton
274
- key={commentItem.key}
275
- text={commentItem.content}
276
- bgColor={isSelectedComment(commentItem.key) ? theme.colors.primary : theme.colors.backgroundGray200}
277
- borderColor={isSelectedComment(commentItem.key) ? theme.colors.primary : theme.colors.backgroundGray200}
278
- textStyle={{
279
- color: isSelectedComment(commentItem.key) ? theme.colors.white : theme.colors.black,
280
- fontSize: 13,
281
- paddingRight: isSelectedComment(commentItem.key) ? 15 : 0
282
- }}
283
- style={{ height: 35, paddingLeft: 5, paddingRight: 5, marginHorizontal: 3, marginVertical: 10 }}
284
- imgRightSrc={isSelectedComment(commentItem.key) ? theme.images.general.close : null}
285
- imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
286
- onClick={() => handleChangeComment(commentItem)}
287
- />
288
- ))}
289
- </CommentsButtonGroup>
290
- </>
291
- )}
292
- {/* <OText style={{ marginTop: 30 }} color={theme.colors.textNormal}>{t('REVIEW_COMMENT_QUESTION', 'Do you want to add something?')}</OText> */}
293
- {false && (
294
- <Controller
295
- control={control}
296
- defaultValue=''
297
- name='comments'
298
- render={({ onChange }: any) => (
299
- <OInput
300
- name='comments'
301
- onChange={(val: any) => {
302
- onChange(val)
303
- setExtraComment(val.target.value)
304
- }}
305
- style={styles.inputTextArea}
306
- multiline
307
- />
308
- )}
309
- />
310
- )}
322
+ />
311
323
  </FormReviews>
312
324
  </View>
313
325
  )}
@@ -316,13 +328,13 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
316
328
  <FloatingBottomContainer>
317
329
  <ActionContainer>
318
330
  <SkipButton
319
- onPress={() => onNavigationRedirect('ReviewProducts', { order: order })}
331
+ onPress={() => skipOrderReview()}
320
332
  >
321
333
  <OText weight={700} size={18} color={theme.colors.textNormal}>{t('FRONT_VISUALS_SKIP', 'Skip')}</OText>
322
334
  </SkipButton>
323
335
  <OButton
324
336
  textStyle={{ color: theme.colors.white, paddingRight: 10 }}
325
- text={t('GOTO_REVIEW', 'Go to review')}
337
+ text={t('CONTINUE', 'Continue')}
326
338
  style={{ borderRadius: 8 }}
327
339
  imgRightSrc={theme.images.general.arrow_right}
328
340
  imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
@@ -338,7 +350,7 @@ export const ReviewOrder = (props: ReviewOrderParams) => {
338
350
  const reviewOrderProps = {
339
351
  ...props,
340
352
  UIComponent: ReviewOrderUI,
341
- defaultStar: 5
353
+ defaultStar: props?.defaultStar || 5
342
354
  }
343
355
  return <ReviewOrderController {...reviewOrderProps} />
344
356
  }
@@ -42,12 +42,10 @@ export const RatingTextContainer = styled.View`
42
42
  justify-content: space-between;
43
43
  margin-top: 10px;
44
44
  `
45
- export const RatingStarContainer = styled.View`
45
+
46
+ export const MultiLogosContainer = styled.View`
47
+ display: flex;
48
+ justify-content: space-around;
46
49
  flex-direction: row;
47
- align-items: center;
48
- justify-content: space-between;
49
- margin-top: 10px;
50
- `
51
- export const PlacedDate = styled.View`
52
- margin-top: 30px;
50
+ width: 100%;
53
51
  `
@@ -56,7 +56,7 @@ const ReviewProductsUI = (props: ReviewProductParams) => {
56
56
  if (order?.driver && !order?.user_review) {
57
57
  onNavigationRedirect('ReviewDriver', { order: order })
58
58
  } else {
59
- onNavigationRedirect('MyOrders')
59
+ onNavigationRedirect('BottomTab', { screen: 'MyOrders' })
60
60
  }
61
61
  }
62
62
  }, [formState])
@@ -67,14 +67,14 @@ const ReviewProductsUI = (props: ReviewProductParams) => {
67
67
  <NavBar
68
68
  title={t('REVIEW_PRODUCT', 'Review product')}
69
69
  titleAlign={'center'}
70
- onActionLeft={() => onNavigationRedirect('MyOrders')}
70
+ onActionLeft={() => onNavigationRedirect('BottomTab', { screen: 'MyOrders' })}
71
71
  showCall={false}
72
72
  btnStyle={{ paddingLeft: 0 }}
73
73
  style={{ flexDirection: 'column', alignItems: 'flex-start' }}
74
74
  titleWrapStyle={{ paddingHorizontal: 0 }}
75
75
  titleStyle={{ marginRight: 0, marginLeft: 0 }}
76
76
  />
77
- {order?.products?.map((product: any) => (
77
+ {order?.products?.map((product: any) => !product?.deleted && (
78
78
  <SingleProductReview
79
79
  key={product.id}
80
80
  product={product}
@@ -87,7 +87,10 @@ const ReviewProductsUI = (props: ReviewProductParams) => {
87
87
  <FloatingBottomContainer>
88
88
  <ActionContainer>
89
89
  <SkipButton
90
- onPress={() => (order?.driver && !order?.user_review) ? onNavigationRedirect('ReviewDriver', { order: order }) : onNavigationRedirect('MyOrders')}
90
+ onPress={() => (order?.driver && !order?.user_review) ?
91
+ onNavigationRedirect('ReviewDriver', { order: order }) :
92
+ onNavigationRedirect('BottomTab', { screen: 'MyOrders' })
93
+ }
91
94
  >
92
95
  <OText weight={700} size={18} color={theme.colors.textNormal}>{t('FRONT_VISUALS_SKIP', 'Skip')}</OText>
93
96
  </SkipButton>
@@ -95,7 +98,7 @@ const ReviewProductsUI = (props: ReviewProductParams) => {
95
98
  textStyle={{ color: theme.colors.white, paddingRight: 10 }}
96
99
  text={order?.driver && !order?.user_review ? t('CONTINUE', 'Continue') : t('SEND_REVIEW', 'Send Review')}
97
100
  style={{ borderRadius: 8 }}
98
- imgRightSrc={theme.images.general.arrow_right}
101
+ imgRightSrc={theme.images.general.arrow_right}
99
102
  imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
100
103
  isDisabled={formState.loading || formState?.changes?.length === 0}
101
104
  onClick={() => handleContinueClick()}
@@ -0,0 +1,136 @@
1
+ import React, { useState } from 'react'
2
+ import FontAwesome from 'react-native-vector-icons/FontAwesome';
3
+ import { useLanguage, useUtils } from 'ordering-components/native'
4
+
5
+ import {
6
+ ReviewOrderContainer,
7
+ BusinessLogo,
8
+ FormReviews,
9
+ ActionContainer,
10
+ RatingStarContainer,
11
+ PlacedDate,
12
+ MultiLogosContainer
13
+ } from './styles'
14
+ import { OButton, OIcon, OText } from '../shared'
15
+ import { StyleSheet, View, I18nManager } from 'react-native';
16
+ import { FloatingBottomContainer } from '../../layouts/FloatingBottomContainer'
17
+
18
+ import { useTheme } from 'styled-components/native'
19
+
20
+ export const ReviewTrigger = (props: any) => {
21
+ const {
22
+ order,
23
+ handleOpenOrderReview
24
+ } = props
25
+
26
+ const theme = useTheme()
27
+
28
+ const styles = StyleSheet.create({
29
+ logoWrapper: {
30
+ shadowColor: theme.colors.black,
31
+ shadowRadius: 3,
32
+ shadowOffset: { width: 1, height: 4 },
33
+ elevation: 3,
34
+ borderRadius: 8,
35
+ shadowOpacity: 0.1,
36
+ overflow: 'hidden'
37
+ },
38
+ inputTextArea: {
39
+ borderColor: theme.colors.lightGray,
40
+ borderRadius: 8,
41
+ marginTop: 10,
42
+ marginBottom: 40,
43
+ height: 100,
44
+ alignItems: 'flex-start'
45
+ },
46
+ statusBar: {
47
+ transform: [{ scaleX: I18nManager.isRTL ? -1 : 1 }],
48
+ height: 10,
49
+ borderRadius: 5,
50
+ marginTop: 5
51
+ },
52
+ ratingItemContainer: {
53
+ position: 'absolute',
54
+ top: -20
55
+ },
56
+ ratingItem: {
57
+ left: '-50%',
58
+ flexDirection: 'column',
59
+ alignItems: 'center'
60
+ },
61
+ ratingLineStyle: {
62
+ height: 10,
63
+ width: 1,
64
+ marginBottom: 10,
65
+ backgroundColor: theme.colors.dusk
66
+ },
67
+ reviewedStyle: {
68
+ flexDirection: 'row',
69
+ justifyContent: 'center',
70
+ marginVertical: 20
71
+ },
72
+ })
73
+
74
+ const [, t] = useLanguage()
75
+ const [{ parseDate }] = useUtils()
76
+ const placedOnDate = parseDate(order?.delivery_datetime, { utc: true, outputFormat: 'dddd MMMM DD, YYYY' })
77
+ const [star, setStar] = useState(5)
78
+
79
+ return (
80
+ <>
81
+ <ReviewOrderContainer>
82
+ <BusinessLogo>
83
+ {typeof order?.logo === 'string' || !order?.logo ? (
84
+ <View style={styles.logoWrapper}>
85
+ <OIcon
86
+ url={order?.logo}
87
+ width={80}
88
+ height={80}
89
+ />
90
+ </View>
91
+ ) : (
92
+ <MultiLogosContainer>
93
+ {order?.logo?.map((logo : string, i : number) => (
94
+ <React.Fragment key={logo}>
95
+ <View style={styles.logoWrapper}>
96
+ <OIcon
97
+ url={logo}
98
+ width={80}
99
+ height={80}
100
+ />
101
+ </View>
102
+ </React.Fragment>
103
+ ))}
104
+ </MultiLogosContainer>
105
+
106
+ )}
107
+ </BusinessLogo>
108
+ {!!order?.business_name && <OText style={{ textAlign: 'center', marginTop: 15 }} color={theme.colors.textNormal}>{order?.business_name}</OText>}
109
+ <View style={{ flex: 1, justifyContent: 'flex-end' }}>
110
+ <FormReviews>
111
+ <RatingStarContainer>
112
+ {[...Array(5).keys()].map((index: number) => (<FontAwesome name={(index <= (star - 1)) ? 'star' : 'star-o'} size={28} key={`star-symbol-${index}`} onPress={() => setStar(index + 1)} color={theme?.colors?.primary} />)
113
+ )}
114
+ </RatingStarContainer>
115
+ <PlacedDate>
116
+ <OText color={theme.colors.textNormal}>{t('DONOT_FORGET_RATE_YOUR_ORDER', 'Do not forget to rate your order placed on ')}</OText>
117
+ <OText color={theme.colors.textNormal} style={{ fontWeight: "bold" }}>{placedOnDate}</OText>
118
+ </PlacedDate>
119
+ </FormReviews>
120
+ </View>
121
+ </ReviewOrderContainer>
122
+ <FloatingBottomContainer borderTopWidth={0} borderRadius={10}>
123
+ <ActionContainer>
124
+ <OButton
125
+ textStyle={{ color: theme.colors.white, paddingRight: 10 }}
126
+ text={t('GOTO_REVIEW', 'Go to review')}
127
+ style={{ borderRadius: 8 }}
128
+ imgRightSrc={theme.images.general.arrow_right}
129
+ imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
130
+ onClick={() => handleOpenOrderReview(star)}
131
+ />
132
+ </ActionContainer>
133
+ </FloatingBottomContainer>
134
+ </>
135
+ )
136
+ }
@@ -0,0 +1,41 @@
1
+ import styled from 'styled-components/native'
2
+
3
+ export const ReviewOrderContainer = styled.ScrollView`
4
+ padding: 0 25px;
5
+ margin-bottom: 100px;
6
+ `
7
+
8
+ export const BusinessLogo = styled.View`
9
+ margin-vertical: 5px;
10
+ align-items: center;
11
+ `
12
+
13
+ export const FormReviews = styled.View`
14
+ flex: 1;
15
+ height: 100%;
16
+ margin-top: 10px;
17
+ `
18
+
19
+ export const ActionContainer = styled.View`
20
+ flex-direction: row;
21
+ align-items: center;
22
+ justify-content: center;
23
+ padding: 3px 30px;
24
+ `
25
+
26
+ export const RatingStarContainer = styled.View`
27
+ flex-direction: row;
28
+ align-items: center;
29
+ justify-content: space-between;
30
+ margin-top: 10px;
31
+ `
32
+ export const PlacedDate = styled.View`
33
+ margin-top: 30px;
34
+ `
35
+
36
+ export const MultiLogosContainer = styled.View`
37
+ display: flex;
38
+ justify-content: space-around;
39
+ flex-direction: row;
40
+ width: 100%;
41
+ `
@@ -0,0 +1,68 @@
1
+ import React, { useState } from 'react'
2
+ import { Platform, View } from 'react-native'
3
+ import { useLanguage } from 'ordering-components/native';
4
+ import { useTheme } from 'styled-components/native';
5
+
6
+ import {
7
+ Accordion,
8
+ AccordionSection,
9
+ DropdownWrapper,
10
+ } from './styles'
11
+ import { OIcon, OText } from '../shared';
12
+
13
+ export const ScheduleAccordion = (props: any) => {
14
+
15
+ const {
16
+ scheduleFormatted,
17
+ schedule,
18
+ weekIndex
19
+ } = props
20
+
21
+ const [isActive, setActiveState] = useState(false)
22
+ const [, t] = useLanguage()
23
+ const theme = useTheme();
24
+
25
+ const daysOfWeek = [
26
+ t('DAY7', 'Sunday'),
27
+ t('DAY1', 'Monday'),
28
+ t('DAY2', 'Tuesday'),
29
+ t('DAY3', 'Wednesday'),
30
+ t('DAY4', 'Thursday'),
31
+ t('DAY5', 'Friday'),
32
+ t('DAY6', 'Saturday'),
33
+ ];
34
+
35
+ return (
36
+ <AccordionSection>
37
+ <Accordion
38
+ onPress={() => setActiveState(!isActive)}
39
+ activeOpacity={1}
40
+ >
41
+ <DropdownWrapper>
42
+ <OText
43
+ mBottom={16}
44
+ mRight={8}
45
+ lineHeight={21}
46
+ size={14}
47
+ weight={Platform.OS === 'android' ? 'bold' : '600'}
48
+ >{daysOfWeek[weekIndex]}</OText>
49
+ <OIcon src={theme.images.general.arrow_down} color={theme.colors.textNormal} width={8} />
50
+ </DropdownWrapper>
51
+ <View style={{ display: isActive ? 'flex' : 'none', paddingStart: 20 }}>
52
+ {schedule?.lapses?.map((lapse: any) => (
53
+ schedule?.enabled ?
54
+ <OText mBottom={16}>
55
+ {scheduleFormatted(lapse.open) +
56
+ ' - ' +
57
+ scheduleFormatted(lapse.close)}
58
+ </OText>
59
+ :
60
+ <OText color={theme.colors.red} mBottom={16}>
61
+ {t('CLOSED', 'Closed')}
62
+ </OText>
63
+ ))}
64
+ </View>
65
+ </Accordion>
66
+ </AccordionSection>
67
+ )
68
+ }
@@ -0,0 +1,14 @@
1
+ import styled from 'styled-components/native'
2
+
3
+ export const AccordionSection = styled.View`
4
+ background: #FFF;
5
+ `
6
+
7
+ export const Accordion = styled.TouchableOpacity`
8
+ flex-direction: column;
9
+ justify-content: space-between;
10
+ `
11
+
12
+ export const DropdownWrapper = styled.View`
13
+ flex-direction: row;
14
+ `