ordering-ui-react-native 0.16.35 → 0.16.36-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 (196) hide show
  1. package/package.json +7 -5
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/ActiveOrders/index.tsx +61 -63
  4. package/src/components/ActiveOrders/styles.tsx +8 -14
  5. package/src/components/BusinessBasicInformation/index.tsx +11 -19
  6. package/src/components/BusinessInformation/index.tsx +33 -4
  7. package/src/components/BusinessInformation/styles.tsx +2 -2
  8. package/src/components/BusinessProductsList/index.tsx +10 -10
  9. package/src/components/BusinessesListing/index.tsx +1 -1
  10. package/src/components/Checkout/index.tsx +2 -1
  11. package/src/components/LanguageSelector/index.tsx +21 -16
  12. package/src/components/LoginForm/index.tsx +15 -0
  13. package/src/components/Messages/index.tsx +2 -2
  14. package/src/components/NotificationSetting/index.tsx +85 -0
  15. package/src/components/OrderDetails/index.tsx +2 -20
  16. package/src/components/OrdersOption/index.tsx +54 -56
  17. package/src/components/PaymentOptions/index.tsx +335 -365
  18. package/src/components/PaymentOptionsWebView/index.tsx +120 -121
  19. package/src/components/ReviewDriver/index.tsx +1 -1
  20. package/src/components/ReviewOrder/index.tsx +2 -1
  21. package/src/components/ReviewProducts/index.tsx +11 -0
  22. package/src/components/SignupForm/index.tsx +15 -0
  23. package/src/components/SingleProductReview/index.tsx +8 -5
  24. package/src/components/StripeElementsForm/index.tsx +25 -16
  25. package/src/components/VerifyPhone/styles.tsx +1 -2
  26. package/src/components/shared/OBottomPopup.tsx +6 -2
  27. package/src/index.tsx +2 -0
  28. package/src/pages/BusinessesListing.tsx +7 -6
  29. package/src/pages/OrderDetails.tsx +1 -1
  30. package/src/pages/ReviewDriver.tsx +2 -2
  31. package/src/pages/ReviewOrder.tsx +2 -2
  32. package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
  33. package/src/utils/index.tsx +2 -1
  34. package/themes/business/src/components/BusinessController/index.tsx +2 -2
  35. package/themes/business/src/components/Chat/index.tsx +38 -30
  36. package/themes/business/src/components/DriverMap/index.tsx +7 -5
  37. package/themes/business/src/components/DriverSchedule/index.tsx +36 -19
  38. package/themes/business/src/components/LoginForm/index.tsx +111 -74
  39. package/themes/business/src/components/MapView/index.tsx +12 -1
  40. package/themes/business/src/components/MessagesOption/index.tsx +11 -1
  41. package/themes/business/src/components/NewOrderNotification/index.tsx +26 -41
  42. package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
  43. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +25 -19
  44. package/themes/business/src/components/OrdersListManager/index.tsx +10 -3
  45. package/themes/business/src/components/OrdersOption/index.tsx +65 -21
  46. package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
  47. package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
  48. package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
  49. package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
  50. package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
  51. package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
  52. package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
  53. package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
  54. package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
  55. package/themes/business/src/components/PreviousOrders/index.tsx +21 -23
  56. package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
  57. package/themes/business/src/components/ReviewCustomer/index.tsx +27 -13
  58. package/themes/business/src/components/ScheduleBlocked/index.tsx +2 -2
  59. package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
  60. package/themes/business/src/components/UserProfileForm/index.tsx +2 -0
  61. package/themes/business/src/components/shared/ODropDown.tsx +42 -8
  62. package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
  63. package/themes/business/src/types/index.tsx +15 -9
  64. package/themes/business/src/utils/index.tsx +10 -0
  65. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  66. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  67. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  68. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  69. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  70. package/themes/kiosk/src/components/LoginForm/index.tsx +121 -10
  71. package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
  72. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  73. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  74. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  75. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  76. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  77. package/themes/kiosk/src/types/index.d.ts +2 -0
  78. package/themes/original/index.tsx +4 -0
  79. package/themes/original/src/components/AddressDetails/index.tsx +2 -2
  80. package/themes/original/src/components/AddressForm/index.tsx +151 -140
  81. package/themes/original/src/components/AddressList/index.tsx +1 -1
  82. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  83. package/themes/original/src/components/BusinessBasicInformation/index.tsx +324 -162
  84. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +6 -2
  85. package/themes/original/src/components/BusinessController/index.tsx +190 -113
  86. package/themes/original/src/components/BusinessController/styles.tsx +0 -7
  87. package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
  88. package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
  89. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
  90. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
  91. package/themes/original/src/components/BusinessListingSearch/index.tsx +80 -128
  92. package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
  93. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
  94. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
  95. package/themes/original/src/components/BusinessProductsList/index.tsx +49 -52
  96. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  97. package/themes/original/src/components/BusinessProductsListing/index.tsx +179 -104
  98. package/themes/original/src/components/BusinessProductsListing/styles.tsx +18 -11
  99. package/themes/original/src/components/BusinessReviews/index.tsx +6 -1
  100. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
  101. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +37 -25
  102. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -4
  103. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +278 -104
  104. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +47 -10
  105. package/themes/original/src/components/BusinessesListing/index.tsx +95 -7
  106. package/themes/original/src/components/Cart/index.tsx +54 -16
  107. package/themes/original/src/components/Cart/styles.tsx +4 -0
  108. package/themes/original/src/components/CartContent/index.tsx +22 -16
  109. package/themes/original/src/components/Checkout/index.tsx +109 -64
  110. package/themes/original/src/components/Checkout/styles.tsx +0 -1
  111. package/themes/original/src/components/DriverTips/index.tsx +4 -4
  112. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  113. package/themes/original/src/components/Favorite/index.tsx +1 -0
  114. package/themes/original/src/components/FavoriteList/index.tsx +32 -2
  115. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  116. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  117. package/themes/original/src/components/GoogleMap/index.tsx +20 -12
  118. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +25 -10
  119. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +4 -0
  120. package/themes/original/src/components/HelpGuide/index.tsx +9 -8
  121. package/themes/original/src/components/HelpOrder/index.tsx +9 -8
  122. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  123. package/themes/original/src/components/LoginForm/Otp/index.tsx +95 -72
  124. package/themes/original/src/components/LoginForm/index.tsx +107 -50
  125. package/themes/original/src/components/LottieAnimation/index.tsx +69 -0
  126. package/themes/original/src/components/Messages/index.tsx +17 -17
  127. package/themes/original/src/components/MomentOption/index.tsx +8 -6
  128. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -92
  129. package/themes/original/src/components/MultiCheckout/index.tsx +6 -0
  130. package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -16
  131. package/themes/original/src/components/MyOrders/index.tsx +70 -6
  132. package/themes/original/src/components/NavBar/index.tsx +15 -9
  133. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  134. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  135. package/themes/original/src/components/Notifications/index.tsx +148 -0
  136. package/themes/original/src/components/Notifications/styles.tsx +17 -0
  137. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +167 -0
  138. package/themes/original/src/components/OrderDetails/index.tsx +200 -37
  139. package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
  140. package/themes/original/src/components/OrderItAgain/index.tsx +75 -0
  141. package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
  142. package/themes/original/src/components/OrderProgress/index.tsx +77 -66
  143. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  144. package/themes/original/src/components/OrderSummary/index.tsx +3 -36
  145. package/themes/original/src/components/OrderTypeSelector/index.tsx +85 -36
  146. package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
  147. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +97 -106
  148. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  149. package/themes/original/src/components/OrdersOption/index.tsx +71 -55
  150. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  151. package/themes/original/src/components/PaymentOptions/index.tsx +41 -23
  152. package/themes/original/src/components/PhoneInputNumber/index.tsx +5 -11
  153. package/themes/original/src/components/PlaceSpot/index.tsx +243 -47
  154. package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
  155. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  156. package/themes/original/src/components/ProductForm/index.tsx +635 -664
  157. package/themes/original/src/components/ProductForm/styles.tsx +9 -8
  158. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  159. package/themes/original/src/components/ProductOption/index.tsx +1 -1
  160. package/themes/original/src/components/ProfessionalFilter/index.tsx +2 -1
  161. package/themes/original/src/components/ProfessionalProfile/index.tsx +26 -14
  162. package/themes/original/src/components/ReviewDriver/index.tsx +7 -7
  163. package/themes/original/src/components/ReviewOrder/index.tsx +18 -3
  164. package/themes/original/src/components/ReviewProducts/index.tsx +2 -2
  165. package/themes/original/src/components/ReviewTrigger/index.tsx +118 -0
  166. package/themes/original/src/components/ReviewTrigger/styles.tsx +34 -0
  167. package/themes/original/src/components/SearchBar/index.tsx +5 -3
  168. package/themes/original/src/components/ServiceForm/index.tsx +410 -258
  169. package/themes/original/src/components/SignupForm/index.tsx +362 -210
  170. package/themes/original/src/components/SingleOrderCard/index.tsx +229 -181
  171. package/themes/original/src/components/SingleOrderCard/styles.tsx +0 -7
  172. package/themes/original/src/components/SingleProductCard/index.tsx +200 -110
  173. package/themes/original/src/components/SingleProductCard/styles.tsx +2 -10
  174. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  175. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  176. package/themes/original/src/components/StripeElementsForm/index.tsx +18 -7
  177. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -5
  178. package/themes/original/src/components/UserDetails/index.tsx +11 -2
  179. package/themes/original/src/components/UserFormDetails/index.tsx +67 -77
  180. package/themes/original/src/components/UserProfile/index.tsx +56 -31
  181. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  182. package/themes/original/src/components/UserProfileForm/index.tsx +10 -10
  183. package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
  184. package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
  185. package/themes/original/src/components/Wallets/index.tsx +176 -164
  186. package/themes/original/src/components/Wallets/styles.tsx +12 -8
  187. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  188. package/themes/original/src/components/shared/OBottomPopup.tsx +48 -15
  189. package/themes/original/src/components/shared/OButton.tsx +10 -3
  190. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  191. package/themes/original/src/components/shared/OInput.tsx +13 -3
  192. package/themes/original/src/layouts/Container.tsx +13 -9
  193. package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
  194. package/themes/original/src/types/index.tsx +91 -30
  195. package/themes/original/src/utils/index.tsx +121 -10
  196. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -9,7 +9,7 @@ export const TopActions = styled.TouchableOpacity`
9
9
  height: 60px;
10
10
  justify-content: center;
11
11
  padding-horizontal: 30px;
12
- width: 80px;
12
+ width: 100px;
13
13
  `;
14
14
 
15
15
  export const TopHeader = styled.View`
@@ -49,7 +49,7 @@ export const ProductDescription = styled.View`
49
49
  `
50
50
 
51
51
  export const ProductEditions = styled.View`
52
-
52
+ padding: 0 40px;
53
53
  `
54
54
 
55
55
  export const SectionTitle = styled.View`
@@ -65,26 +65,23 @@ export const WrapperSubOption = styled.View`
65
65
  `
66
66
 
67
67
  export const ProductComment = styled.View`
68
- padding-bottom: 50px;
68
+ padding-bottom: ${(props: any) => props.pb || 60}px;
69
69
  `
70
70
 
71
71
  export const ProductActions = styled.View`
72
72
  position: absolute;
73
73
  bottom: 0px;
74
- min-height: 70px;
75
74
  padding-top: ${(props: any) => props.ios ? '20px' : '0'};
76
75
  padding-horizontal: 40px;
76
+ padding-vertical: 20px;
77
77
  width: 100%;
78
- flex-direction: row;
78
+ flex-direction: ${(props: any) => props.isColumn ? 'column' : 'row'};
79
79
  background-color: #FFF;
80
80
  z-index: 1000;
81
- align-items: center;
82
- justify-content: space-between;
83
81
  border-top-width: 1px;
84
82
  border-top-color: ${(props: any) => props.theme.colors.border};
85
83
  `
86
84
  export const ExtraOptionWrap = styled.ScrollView`
87
- margin-horizontal: -40px;
88
85
  `;
89
86
 
90
87
  export const WeightUnitSwitch = styled.View`
@@ -99,4 +96,8 @@ export const WeightUnitItem = styled.View`
99
96
  `}
100
97
  `
101
98
  export const ProductSummary = styled.View`
99
+ padding: 26px 40px;
100
+ position: relative;
101
+ background-color: white;
102
+ z-index: 100;
102
103
  `
@@ -4,6 +4,8 @@ import { useUtils, useLanguage, useOrder } from 'ordering-components/native'
4
4
  import { useTheme } from 'styled-components/native';
5
5
  import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons'
6
6
  import RNPickerSelect from 'react-native-picker-select'
7
+ import { ServiceForm } from '../ServiceForm';
8
+ import FastImage from 'react-native-fast-image'
7
9
 
8
10
  import {
9
11
  Accordion,
@@ -18,7 +20,7 @@ import {
18
20
  ProductSubOption,
19
21
  ProductComment
20
22
  } from './styles'
21
- import { OIcon, OText, OAlert } from '../shared'
23
+ import { OIcon, OText, OAlert, OModal } from '../shared'
22
24
 
23
25
  import { ProductItemAccordionParams } from '../../types'
24
26
 
@@ -68,9 +70,10 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
68
70
 
69
71
  const [, t] = useLanguage()
70
72
  const [orderState] = useOrder()
71
- const [{ parsePrice, optimizeImage }] = useUtils()
73
+ const [{ parsePrice, optimizeImage, parseDate }] = useUtils()
72
74
 
73
75
  const [isActive, setActiveState] = useState(false)
76
+ const [isServiceOpen, setIsServiceOpen] = useState(false)
74
77
  // const [setHeight, setHeightState] = useState({ height: new Animated.Value(0) })
75
78
  // const [setRotate, setRotateState] = useState({ angle: new Animated.Value(0) })
76
79
 
@@ -92,6 +95,14 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
92
95
  return product
93
96
  }
94
97
 
98
+ const handleEditProduct = (curProduct: any) => {
99
+ if (!curProduct?.calendar_event) {
100
+ onEditProduct && onEditProduct(curProduct)
101
+ return
102
+ }
103
+ setIsServiceOpen(true)
104
+ }
105
+
95
106
  /* const toggleAccordion = () => {
96
107
  if ((!product?.valid_menu && isCartProduct)) return
97
108
  if (isActive) {
@@ -133,135 +144,195 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
133
144
  })
134
145
 
135
146
  return (
136
- <AccordionSection>
137
- <Accordion
138
- isValid={product?.valid ?? true}
139
- onPress={() => (!product?.valid_menu && isCartProduct)
140
- ? {}
141
- : setActiveState(!isActive)}
142
- activeOpacity={1}
143
- >
144
- <View style={{ flexDirection: 'row', alignItems: 'flex-start' }}>
145
- <ContentInfo>
146
- {product?.images && (
147
- <ProductImage>
148
- {isFromCheckout ? (
149
- <OIcon url={optimizeImage(product?.images, 'h_100,c_limit')} style={{ ...styles.productImage, ...{ width: 82, height: 82 } }} />
150
- ) : (
151
- <OIcon url={optimizeImage(product?.images, 'h_100,c_limit')} style={styles.productImage} />
152
- )}
153
- </ProductImage>
154
- )}
155
- {isCartProduct && !isCartPending && getProductMax && (
156
- <ProductInfo>
157
- <RNPickerSelect
158
- items={productOptions}
159
- onValueChange={handleChangeQuantity}
160
- value={product.quantity.toString()}
161
- style={pickerStyle}
162
- useNativeAndroidPickerStyle={false}
163
- placeholder={{}}
164
- Icon={() => <View style={pickerStyle.icon}><OIcon src={theme.images.general.arrow_down} color={theme.colors.textNormal} width={8} /></View>}
165
- disabled={orderState.loading}
166
- />
167
- </ProductInfo>
168
- )}
169
- {isFromCheckout && (
170
- <ProductQuantity>
171
- <OText size={12} lineHeight={18}>
172
- {product?.quantity}
173
- </OText>
174
- </ProductQuantity>
175
- )}
176
- <View style={{ flex: 1 }}>
177
- <OText size={12} lineHeight={18} weight={'400'}>{product.name}</OText>
178
- </View>
179
- <View style={{ display: 'flex', flexDirection: 'column', flex: 1, alignItems: 'flex-end' }}>
180
- <View style={{ flexDirection: 'row' }}>
181
- <OText size={12} lineHeight={18} weight={'400'}>{parsePrice(product.total || product.price)}</OText>
182
- {(productInfo().ingredients.length > 0 || productInfo().options.length > 0 || product.comment) && (
183
- <MaterialCommunityIcon name='chevron-down' size={18} />
184
- )}
147
+ <>
148
+ <AccordionSection>
149
+ <Accordion
150
+ isValid={product?.valid ?? true}
151
+ onPress={() => (!product?.valid_menu && isCartProduct)
152
+ ? {}
153
+ : setActiveState(!isActive)}
154
+ activeOpacity={1}
155
+ >
156
+ <View style={{ flexDirection: 'row', alignItems: 'flex-start' }}>
157
+ <ContentInfo>
158
+ {(product?.images || theme?.images?.dummies?.product) && (
159
+ <ProductImage>
160
+ {isFromCheckout ? (
161
+ product?.images ? (
162
+ <FastImage
163
+ style={{ ...styles.productImage, ...{ width: 82, height: 82 } }}
164
+ source={{
165
+ uri: optimizeImage(product?.images, 'h_100,c_limit'),
166
+ priority: FastImage.priority.normal,
167
+ }}
168
+ resizeMode={FastImage.resizeMode.cover}
169
+ />
170
+ ) : (
171
+ <OIcon
172
+ src={theme?.images?.dummies?.product}
173
+ style={{ ...styles.productImage, ...{ width: 82, height: 82 } }}
174
+ />
175
+ )
176
+ ) : (
177
+ product?.images ? (
178
+ <FastImage
179
+ style={styles.productImage}
180
+ source={{
181
+ uri: optimizeImage(product?.images, 'h_100,c_limit'),
182
+ priority: FastImage.priority.normal,
183
+ }}
184
+ resizeMode={FastImage.resizeMode.cover}
185
+ />
186
+ ) : (
187
+ <OIcon
188
+ src={theme?.images?.dummies?.product}
189
+ style={styles.productImage}
190
+ />
191
+ )
192
+ )}
193
+ </ProductImage>
194
+ )}
195
+ {!!product?.calendar_event ? (
196
+ <View style={{ flex: 1, marginLeft: 10, flexDirection: 'column' }}>
197
+ <View>
198
+ <OText size={12} lineHeight={18} weight={'400'} numberOfLines={1}>{product?.name}</OText>
199
+ </View>
200
+ <OText size={10} color={theme.colors.textSecondary} style={{ marginTop: 3 }}>
201
+ {parseDate(product?.calendar_event?.start, { outputFormat: 'hh:mm a' })} - {parseDate(product?.calendar_event?.end, { outputFormat: 'hh:mm a' })}
202
+ </OText>
203
+ </View>
204
+ ) : (
205
+ <>
206
+ {isCartProduct && !isCartPending && getProductMax && (
207
+ <ProductInfo>
208
+ <RNPickerSelect
209
+ items={productOptions}
210
+ onValueChange={handleChangeQuantity}
211
+ value={product.quantity.toString()}
212
+ style={pickerStyle}
213
+ useNativeAndroidPickerStyle={false}
214
+ placeholder={{}}
215
+ Icon={() => <View style={pickerStyle.icon}><OIcon src={theme.images.general.arrow_down} color={theme.colors.textNormal} width={8} /></View>}
216
+ disabled={orderState.loading}
217
+ />
218
+ </ProductInfo>
219
+ )}
220
+ {isFromCheckout && (
221
+ <ProductQuantity>
222
+ <OText size={12} lineHeight={18}>
223
+ {product?.quantity}
224
+ </OText>
225
+ </ProductQuantity>
226
+ )}
227
+ <View style={{ flex: 1 }}>
228
+ <OText size={12} lineHeight={18} weight={'400'}>{product.name}</OText>
229
+ </View>
230
+ </>
231
+ )}
232
+ <View style={{ display: 'flex', flexDirection: 'column', flex: 1, alignItems: 'flex-end', maxWidth: 100 }}>
233
+ <View style={{ flexDirection: 'row' }}>
234
+ <OText size={12} lineHeight={18} weight={'400'}>{parsePrice(product.total || product.price)}</OText>
235
+ {(productInfo().ingredients.length > 0 || productInfo().options.length > 0 || product.comment) && (
236
+ <MaterialCommunityIcon name='chevron-down' size={18} />
237
+ )}
238
+ </View>
239
+ <View style={{ display: 'flex', flexDirection: 'row', justifyContent: 'flex-start' }}>
240
+ {onEditProduct && isCartProduct && !isCartPending && product?.valid_menu && (
241
+ <TouchableOpacity onPress={() => handleEditProduct(product)} style={{ marginEnd: 7 }}>
242
+ <OIcon
243
+ src={theme.images.general.pencil}
244
+ width={20}
245
+ color={theme.colors.textSecondary}
246
+ />
247
+ </TouchableOpacity>
248
+ )}
249
+ {onDeleteProduct && isCartProduct && !isCartPending && (
250
+ <OAlert
251
+ title={t('DELETE_PRODUCT', 'Delete Product')}
252
+ message={t('QUESTION_DELETE_PRODUCT', 'Are you sure that you want to delete the product?')}
253
+ onAccept={() => onDeleteProduct(product)}
254
+ >
255
+ <OIcon
256
+ src={theme.images.general.trash}
257
+ width={20}
258
+ color={theme.colors.textSecondary}
259
+ />
260
+ </OAlert>
261
+ )}
262
+ </View>
185
263
  </View>
186
- <View style={{ display: 'flex', flexDirection: 'row', justifyContent: 'flex-start' }}>
187
- {onEditProduct && isCartProduct && !isCartPending && product?.valid_menu && (
188
- <TouchableOpacity onPress={() => onEditProduct(product)} style={{ marginEnd: 7 }}>
189
- <OIcon
190
- src={theme.images.general.pencil}
191
- width={16}
192
- color={theme.colors.textSecondary}
193
- />
194
- </TouchableOpacity>
195
- )}
196
- {onDeleteProduct && isCartProduct && !isCartPending && (
197
- <OAlert
198
- title={t('DELETE_PRODUCT', 'Delete Product')}
199
- message={t('QUESTION_DELETE_PRODUCT', 'Are you sure that you want to delete the product?')}
200
- onAccept={() => onDeleteProduct(product)}
201
- >
202
- <OIcon
203
- src={theme.images.general.trash}
204
- width={17}
205
- color={theme.colors.textSecondary}
206
- />
207
- </OAlert>
208
- )}
264
+ </ContentInfo>
265
+ </View>
266
+ {((isCartProduct && !isCartPending && product?.valid_menu && !product?.valid_quantity) ||
267
+ (!product?.valid_menu && isCartProduct && !isCartPending)) && (
268
+ <View style={{ alignItems: 'flex-end', width: '100%', }}>
269
+ <OText size={14} color={theme.colors.red} style={{ textAlign: 'right', marginTop: 5 }}>
270
+ {t('NOT_AVAILABLE', 'Not available')}
271
+ </OText>
209
272
  </View>
210
- </View>
211
- </ContentInfo>
212
- </View>
213
- {((isCartProduct && !isCartPending && product?.valid_menu && !product?.valid_quantity) ||
214
- (!product?.valid_menu && isCartProduct && !isCartPending)) && (
215
- <View style={{ alignItems: 'flex-end', width: '100%', }}>
216
- <OText size={14} color={theme.colors.red} style={{ textAlign: 'right', marginTop: 5 }}>
217
- {t('NOT_AVAILABLE', 'Not available')}
218
- </OText>
219
- </View>
220
- )}
221
- </Accordion>
222
-
223
- <View style={{ display: isActive ? 'flex' : 'none', paddingStart: 40 }}>
224
- <Animated.View>
225
- <AccordionContent>
226
- {productInfo().ingredients.length > 0 && productInfo().ingredients.some((ingredient: any) => !ingredient.selected) && (
227
- <ProductOptionsList>
228
- <OText size={10} color={theme.colors.textSecondary}>{t('INGREDIENTS', 'Ingredients')}</OText>
229
- {productInfo().ingredients.map((ingredient: any) => !ingredient.selected && (
230
- <OText size={10} color={theme.colors.textThird} key={ingredient.id} style={{ marginLeft: 10 }}>{t('NO', 'No')} {ingredient.name}</OText>
231
- ))}
232
- </ProductOptionsList>
233
- )}
234
- {productInfo().options.length > 0 && (
235
- <ProductOptionsList>
236
- {productInfo().options.map((option: any, i: number) => (
237
- <ProductOption key={option.id + i}>
238
- <OText size={10} color={theme.colors.textSecondary}>{option.name}</OText>
239
- {option.suboptions.map((suboption: any) => (
240
- <ProductSubOption key={suboption.id}>
241
- <OText size={10} color={theme.colors.textThird}>
242
- {getFormattedSubOptionName({
243
- quantity: suboption.quantity,
244
- name: suboption.name,
245
- position: (suboption.position !== 'whole') ? t(suboption.position.toUpperCase(), suboption.position) : '',
246
- price: parsePrice(suboption.price)
247
- })}
248
- </OText>
249
- </ProductSubOption>
250
- ))}
251
- </ProductOption>
252
- ))}
253
- </ProductOptionsList>
254
273
  )}
255
- {product.comment && (
256
- <ProductComment>
257
- <OText size={10} color={theme.colors.textSecondary}>{t('SPECIAL_COMMENT', 'Special Comment')}</OText>
258
- <OText size={10} color={theme.colors.textThird}>{product.comment}</OText>
259
- </ProductComment>
260
- )}
261
- </AccordionContent>
262
- </Animated.View>
263
- </View>
264
- </AccordionSection>
274
+ </Accordion>
275
+
276
+ <View style={{ display: isActive ? 'flex' : 'none', paddingStart: 40 }}>
277
+ <Animated.View>
278
+ <AccordionContent>
279
+ {productInfo().ingredients.length > 0 && productInfo().ingredients.some((ingredient: any) => !ingredient.selected) && (
280
+ <ProductOptionsList>
281
+ <OText size={10} color={theme.colors.textSecondary}>{t('INGREDIENTS', 'Ingredients')}</OText>
282
+ {productInfo().ingredients.map((ingredient: any) => !ingredient.selected && (
283
+ <OText size={10} color={theme.colors.textThird} key={ingredient.id} style={{ marginLeft: 10 }}>{t('NO', 'No')} {ingredient.name}</OText>
284
+ ))}
285
+ </ProductOptionsList>
286
+ )}
287
+ {productInfo().options.length > 0 && (
288
+ <ProductOptionsList>
289
+ {productInfo().options.map((option: any, i: number) => (
290
+ <ProductOption key={option.id + i}>
291
+ <OText size={10} color={theme.colors.textSecondary}>{option.name}</OText>
292
+ {option.suboptions.map((suboption: any) => (
293
+ <ProductSubOption key={suboption.id}>
294
+ <OText size={10} color={theme.colors.textThird}>
295
+ {getFormattedSubOptionName({
296
+ quantity: suboption.quantity,
297
+ name: suboption.name,
298
+ position: (suboption.position !== 'whole') ? t(suboption.position.toUpperCase(), suboption.position) : '',
299
+ price: parsePrice(suboption.price)
300
+ })}
301
+ </OText>
302
+ </ProductSubOption>
303
+ ))}
304
+ </ProductOption>
305
+ ))}
306
+ </ProductOptionsList>
307
+ )}
308
+ {product.comment && (
309
+ <ProductComment>
310
+ <OText size={10} color={theme.colors.textSecondary}>{t('SPECIAL_COMMENT', 'Special Comment')}</OText>
311
+ <OText size={10} color={theme.colors.textThird}>{product.comment}</OText>
312
+ </ProductComment>
313
+ )}
314
+ </AccordionContent>
315
+ </Animated.View>
316
+ </View>
317
+ </AccordionSection>
318
+ <OModal
319
+ open={isServiceOpen}
320
+ onClose={() => setIsServiceOpen(false)}
321
+ entireModal
322
+ >
323
+ <ServiceForm
324
+ isCartProduct
325
+ isService
326
+ businessId={product?.business_id}
327
+ categoryId={product?.category_id}
328
+ productId={product?.id}
329
+ productCart={product}
330
+ onSave={() => setIsServiceOpen(false)}
331
+ onClose={() => setIsServiceOpen(false)}
332
+ professionalSelected={product?.calendar_event?.professional}
333
+ />
334
+ </OModal>
335
+ </>
265
336
  )
266
337
  }
267
338
 
@@ -30,7 +30,7 @@ const ProductOptionUI = (props: any) => {
30
30
  return (
31
31
  <Container style={{ color: error ? 'orange' : theme.colors.white }}>
32
32
  <WrapHeader>
33
- <OText size={16} lineHeight={24} weight={'600'}>{option.name}</OText>
33
+ <OText size={16} lineHeight={24} weight={'600'} style={{ flex: 1 }}>{option.name}</OText>
34
34
  <OText color={theme.colors.red}>{maxMin}</OText>
35
35
  </WrapHeader>
36
36
  {children}
@@ -97,7 +97,8 @@ export const ProfessionalFilter = (props: ProfessionalFilterParams) => {
97
97
  />
98
98
  ) : (
99
99
  <OIcon
100
- src={theme?.images?.dummies?.product}
100
+ src={theme?.images?.general?.user}
101
+ cover={false}
101
102
  style={styles.photoStyle}
102
103
  />
103
104
  )}
@@ -6,7 +6,7 @@ import CalendarPicker from 'react-native-calendar-picker'
6
6
  import FeatherIcon from 'react-native-vector-icons/Feather';
7
7
  import moment from 'moment'
8
8
  import SelectDropdown from 'react-native-select-dropdown'
9
- import { OButton, OText } from '../shared'
9
+ import { OButton, OText, OIcon } from '../shared'
10
10
  import IconAntDesign from 'react-native-vector-icons/AntDesign'
11
11
  import { useSafeAreaInsets } from 'react-native-safe-area-context'
12
12
  import { ProfessionalProfileParams } from '../../types'
@@ -58,11 +58,14 @@ export const ProfessionalProfile = (props: ProfessionalProfileParams) => {
58
58
  height: 40,
59
59
  marginBottom: 30
60
60
  },
61
+ photoStyle: {
62
+ alignSelf: 'center'
63
+ }
61
64
  })
62
65
 
63
66
  const onDateChange = (date: any) => {
64
67
  setSelectedDate(date)
65
- dropdownRef.current.reset()
68
+ dropdownRef?.current && dropdownRef.current.reset()
66
69
  }
67
70
 
68
71
  const dropDownIcon = () => {
@@ -151,13 +154,21 @@ export const ProfessionalProfile = (props: ProfessionalProfileParams) => {
151
154
 
152
155
  return (
153
156
  <Container>
154
- <ProfessionalPhoto
155
- source={{
156
- uri:
157
- professional?.photo ||
158
- optimizeImage(theme.images.general.user, 'h_250,c_limit'),
159
- }}
160
- />
157
+ {!!professional?.photo ? (
158
+ <ProfessionalPhoto
159
+ source={{
160
+ uri: professional?.photo
161
+ }}
162
+ />
163
+ ) : (
164
+ <OIcon
165
+ src={theme.images.general.user}
166
+ style={styles.photoStyle}
167
+ cover={false}
168
+ width={200}
169
+ height={200}
170
+ />
171
+ )}
161
172
  <InfoWrapper>
162
173
  <OText
163
174
  size={20}
@@ -191,9 +202,9 @@ export const ProfessionalProfile = (props: ProfessionalProfileParams) => {
191
202
  {t('REQUIRED', 'Required')}
192
203
  </OText>
193
204
  </View>
194
- {(!!professional?.schedule && isEnabled) ? (
205
+ {!!professional?.schedule ? (
195
206
  <CalendarWrapper>
196
- {timeList?.length > 0 ? (
207
+ {(timeList?.length > 0 && isEnabled) ? (
197
208
  <SelectDropdown
198
209
  ref={dropdownRef}
199
210
  data={timeList}
@@ -237,11 +248,12 @@ export const ProfessionalProfile = (props: ProfessionalProfileParams) => {
237
248
  />
238
249
  ) : (
239
250
  <OText
240
- size={20}
251
+ size={12}
241
252
  style={{ marginBottom: 30 }}
242
- weight={Platform.OS === 'ios' ? '600' : 'bold'}
253
+ weight={'400'}
254
+ color={theme.colors?.danger5}
243
255
  >
244
- {t('NOT_AVAILABLE', 'Not available')}
256
+ {t('PROFESSIONAL_NOT_AVAILABLE', 'Professional is not available at the moment')}
245
257
  </OText>
246
258
  )}
247
259
 
@@ -44,7 +44,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
44
44
  photoWrapper: {
45
45
  shadowColor: theme.colors.black,
46
46
  shadowRadius: 3,
47
- shadowOffset: {width: 1, height: 4},
47
+ shadowOffset: { width: 1, height: 4 },
48
48
  elevation: 3,
49
49
  borderRadius: 8,
50
50
  shadowOpacity: 0.1,
@@ -86,11 +86,11 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
86
86
  const [alertState, setAlertState] = useState<{ open: boolean, content: Array<any>, success?: boolean }>({ open: false, content: [], success: false })
87
87
 
88
88
  const qualificationList = [
89
- { key: 1, text: t('TERRIBLE', 'Terrible'), percent: 0, parentStyle: { left: '0%' }, isInnerStyle: false, pointerColor: false },
89
+ { key: 1, text: t('TERRIBLE', 'Terrible'), percent: 0, parentStyle: { left: '0%' }, isInnerStyle: false, pointerColor: false },
90
90
  { key: 2, text: t('BAD', 'Bad'), percent: 0.25, parentStyle: { left: '25%' }, isInnerStyle: true, pointerColor: true },
91
91
  { key: 3, text: t('OKAY', 'Okay'), percent: 0.5, parentStyle: { left: '50%' }, isInnerStyle: true, pointerColor: true },
92
92
  { key: 4, text: t('GOOD', 'Good'), percent: 0.75, parentStyle: { left: '75%' }, isInnerStyle: true, pointerColor: true },
93
- { key: 5, text: t('GREAT', 'Great'), percent: 1, parentStyle: { right: '0%' }, isInnerStyle: false, pointerColor: false }
93
+ { key: 5, text: t('GREAT', 'Great'), percent: 1, parentStyle: { right: '0%' }, isInnerStyle: false, pointerColor: false }
94
94
  ]
95
95
 
96
96
  const commentsList = reviewCommentList('driver')
@@ -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={() => navigation?.canGoBack() && navigation.goBack()}
189
+ onActionLeft={() => onNavigationRedirect('BottomTab')}
190
190
  showCall={false}
191
191
  btnStyle={{ paddingLeft: 0 }}
192
192
  style={{ flexDirection: 'column', alignItems: 'flex-start' }}
@@ -204,7 +204,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
204
204
  <OIcon
205
205
  url={order?.driver?.photo}
206
206
  src={!order?.driver?.photo && theme.images.general.user}
207
- cover={order?.driver?.photo ? true: false}
207
+ cover={order?.driver?.photo ? true : false}
208
208
  width={80}
209
209
  height={80}
210
210
  />
@@ -212,7 +212,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
212
212
  <OText weight={500} style={{ marginVertical: 10 }} color={theme.colors.textNormal}>{order?.driver?.name} {order?.driver?.lastname}</OText>
213
213
  </DriverPhotoContainer>
214
214
 
215
- <View style={{flex: 1, justifyContent: 'flex-end'}}>
215
+ <View style={{ flex: 1, justifyContent: 'flex-end' }}>
216
216
  <FormReviews>
217
217
  <OText mBottom={13} color={theme.colors.textNormal}>{t('HOW_WAS_YOUR_DRIVER', 'How was your driver?')}</OText>
218
218
  <RatingBarContainer>
@@ -264,7 +264,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
264
264
  style={{ height: 35, paddingLeft: 5, paddingRight: 5, marginHorizontal: 3, marginVertical: 10 }}
265
265
  imgRightSrc={isSelectedComment(commentItem.key) ? theme.images.general.close : null}
266
266
  imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
267
- onClick={() => handleChangeComment(commentItem) }
267
+ onClick={() => handleChangeComment(commentItem)}
268
268
  />
269
269
  ))}
270
270
  </CommentsButtonGroup>
@@ -92,6 +92,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
92
92
  const [alertState, setAlertState] = useState<{ open: boolean, content: Array<any>, success?: boolean }>({ open: false, content: [], success: false })
93
93
  const [comments, setComments] = useState<Array<any>>([])
94
94
  const [extraComment, setExtraComment] = useState('')
95
+ const [enableProduct, setEnableProduct] = useState(true)
95
96
 
96
97
  const onSubmit = () => {
97
98
  if (Object.values(stars).some((value: any) => value === 0)) {
@@ -105,6 +106,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
105
106
  handleReviewState && handleReviewState(order?.id)
106
107
  setIsReviewed && setIsReviewed(true)
107
108
  setAlertState({ ...alertState, success: true })
109
+ !enableProduct && navigation?.canGoBack() && navigation.goBack()
108
110
  }
109
111
 
110
112
  const qualificationList = [
@@ -141,7 +143,16 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
141
143
  if (!order?.review) {
142
144
  onSubmit()
143
145
  } else {
144
- onNavigationRedirect('ReviewProducts', { order: order })
146
+ skipOrderReview()
147
+ }
148
+ }
149
+
150
+ const skipOrderReview = () => {
151
+ if (enableProduct) onNavigationRedirect('ReviewProducts', { order: order })
152
+ else if (order?.driver && !order?.user_review) {
153
+ onNavigationRedirect('ReviewDriver', { order: order })
154
+ } else {
155
+ navigation?.canGoBack() && navigation.goBack()
145
156
  }
146
157
  }
147
158
 
@@ -187,6 +198,10 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
187
198
  setStars({ ...stars, comments: _comment })
188
199
  }, [comments, extraComment])
189
200
 
201
+ useEffect(() => {
202
+ setEnableProduct(!order?.products.every(product => product?.deleted))
203
+ }, [order])
204
+
190
205
  return (
191
206
  <>
192
207
  <ReviewOrderContainer>
@@ -296,7 +311,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
296
311
  <FloatingBottomContainer>
297
312
  <ActionContainer>
298
313
  <SkipButton
299
- onPress={() => onNavigationRedirect('ReviewProducts', { order: order })}
314
+ onPress={() => skipOrderReview()}
300
315
  >
301
316
  <OText weight={700} size={18} color={theme.colors.textNormal}>{t('FRONT_VISUALS_SKIP', 'Skip')}</OText>
302
317
  </SkipButton>
@@ -318,7 +333,7 @@ export const ReviewOrder = (props: ReviewOrderParams) => {
318
333
  const reviewOrderProps = {
319
334
  ...props,
320
335
  UIComponent: ReviewOrderUI,
321
- defaultStar: 5
336
+ defaultStar: props?.defaultStar || 5
322
337
  }
323
338
  return <ReviewOrderController {...reviewOrderProps} />
324
339
  }
@@ -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')}
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}