ordering-ui-react-native 0.16.13 → 0.16.14-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 (213) hide show
  1. package/package.json +7 -4
  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/AddressForm/index.tsx +18 -2
  6. package/src/components/BusinessBasicInformation/index.tsx +11 -19
  7. package/src/components/BusinessController/index.tsx +10 -8
  8. package/src/components/BusinessInformation/index.tsx +22 -0
  9. package/src/components/BusinessProductsList/index.tsx +10 -10
  10. package/src/components/BusinessTypeFilter/index.tsx +1 -2
  11. package/src/components/BusinessesListing/index.tsx +1 -1
  12. package/src/components/Checkout/index.tsx +2 -1
  13. package/src/components/LanguageSelector/index.tsx +21 -16
  14. package/src/components/LoginForm/index.tsx +118 -30
  15. package/src/components/LoginForm/styles.tsx +6 -0
  16. package/src/components/Messages/index.tsx +2 -2
  17. package/src/components/NotificationSetting/index.tsx +85 -0
  18. package/src/components/OrderDetails/index.tsx +7 -21
  19. package/src/components/OrdersOption/index.tsx +54 -56
  20. package/src/components/PaymentOptions/index.tsx +335 -365
  21. package/src/components/PaymentOptionsWebView/index.tsx +120 -121
  22. package/src/components/ReviewDriver/index.tsx +1 -1
  23. package/src/components/ReviewOrder/index.tsx +2 -1
  24. package/src/components/ReviewProducts/index.tsx +11 -0
  25. package/src/components/SignupForm/index.tsx +143 -61
  26. package/src/components/SingleProductReview/index.tsx +8 -5
  27. package/src/components/StripeElementsForm/index.tsx +25 -16
  28. package/src/components/VerifyPhone/styles.tsx +1 -2
  29. package/src/components/shared/OBottomPopup.tsx +6 -2
  30. package/src/index.tsx +2 -0
  31. package/src/navigators/CheckoutNavigator.tsx +6 -0
  32. package/src/navigators/HomeNavigator.tsx +6 -0
  33. package/src/pages/BusinessesListing.tsx +7 -6
  34. package/src/pages/MultiCheckout.tsx +31 -0
  35. package/src/pages/MultiOrdersDetails.tsx +27 -0
  36. package/src/pages/OrderDetails.tsx +1 -1
  37. package/src/pages/ReviewDriver.tsx +2 -2
  38. package/src/pages/ReviewOrder.tsx +2 -2
  39. package/src/theme.json +0 -1
  40. package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
  41. package/src/types/index.tsx +13 -9
  42. package/src/utils/index.tsx +0 -1
  43. package/themes/business/index.tsx +4 -0
  44. package/themes/business/src/components/BusinessController/index.tsx +2 -2
  45. package/themes/business/src/components/Chat/index.tsx +42 -34
  46. package/themes/business/src/components/DriverMap/index.tsx +7 -5
  47. package/themes/business/src/components/DriverSchedule/index.tsx +71 -0
  48. package/themes/business/src/components/DriverSchedule/styles.tsx +6 -0
  49. package/themes/business/src/components/LoginForm/index.tsx +111 -74
  50. package/themes/business/src/components/MapView/index.tsx +1 -1
  51. package/themes/business/src/components/MessagesOption/index.tsx +11 -1
  52. package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
  53. package/themes/business/src/components/OrderDetails/Delivery.tsx +3 -3
  54. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +19 -18
  55. package/themes/business/src/components/OrdersListManager/index.tsx +10 -3
  56. package/themes/business/src/components/OrdersOption/index.tsx +65 -21
  57. package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
  58. package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
  59. package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
  60. package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
  61. package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
  62. package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
  63. package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
  64. package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
  65. package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
  66. package/themes/business/src/components/PreviousOrders/index.tsx +21 -23
  67. package/themes/business/src/components/ProductItemAccordion/index.tsx +5 -4
  68. package/themes/business/src/components/ReviewCustomer/index.tsx +1 -1
  69. package/themes/business/src/components/ScheduleBlocked/index.tsx +53 -0
  70. package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
  71. package/themes/business/src/components/UserProfileForm/index.tsx +28 -4
  72. package/themes/business/src/components/shared/ODropDown.tsx +42 -8
  73. package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
  74. package/themes/business/src/components/shared/OModal.tsx +40 -37
  75. package/themes/business/src/types/index.tsx +14 -9
  76. package/themes/business/src/utils/index.tsx +10 -0
  77. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  78. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  79. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  80. package/themes/kiosk/src/components/BusinessMenu/index.tsx +2 -1
  81. package/themes/kiosk/src/components/CartItem/index.tsx +4 -3
  82. package/themes/kiosk/src/components/CategoriesMenu/index.tsx +1 -0
  83. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  84. package/themes/kiosk/src/components/DrawerView/index.tsx +1 -0
  85. package/themes/kiosk/src/components/DrawerView/styles.tsx +2 -2
  86. package/themes/kiosk/src/components/LoginForm/index.tsx +121 -10
  87. package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
  88. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  89. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  90. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  91. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  92. package/themes/kiosk/src/types/index.d.ts +2 -0
  93. package/themes/original/index.tsx +16 -0
  94. package/themes/original/src/components/AddressForm/index.tsx +136 -133
  95. package/themes/original/src/components/AddressList/index.tsx +1 -1
  96. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  97. package/themes/original/src/components/BusinessBasicInformation/index.tsx +302 -160
  98. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +6 -2
  99. package/themes/original/src/components/BusinessController/index.tsx +173 -108
  100. package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -9
  101. package/themes/original/src/components/BusinessItemAccordion/styles.tsx +3 -1
  102. package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
  103. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
  104. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
  105. package/themes/original/src/components/BusinessListingSearch/index.tsx +106 -126
  106. package/themes/original/src/components/BusinessListingSearch/styles.tsx +18 -13
  107. package/themes/original/src/components/BusinessProductsList/CategoryDescription/index.tsx +1 -1
  108. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
  109. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
  110. package/themes/original/src/components/BusinessProductsList/index.tsx +53 -53
  111. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  112. package/themes/original/src/components/BusinessProductsListing/index.tsx +290 -181
  113. package/themes/original/src/components/BusinessProductsListing/styles.tsx +18 -0
  114. package/themes/original/src/components/BusinessReviews/index.tsx +6 -1
  115. package/themes/original/src/components/BusinessTypeFilter/index.tsx +109 -40
  116. package/themes/original/src/components/BusinessTypeFilter/styles.tsx +2 -0
  117. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +561 -0
  118. package/themes/original/src/components/BusinessesListing/{styles.tsx → Layout/Appointment/styles.tsx} +24 -2
  119. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +676 -0
  120. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +137 -0
  121. package/themes/original/src/components/BusinessesListing/index.tsx +100 -495
  122. package/themes/original/src/components/Cart/index.tsx +81 -36
  123. package/themes/original/src/components/Cart/styles.tsx +4 -0
  124. package/themes/original/src/components/CartContent/index.tsx +22 -16
  125. package/themes/original/src/components/Checkout/index.tsx +106 -66
  126. package/themes/original/src/components/Checkout/styles.tsx +0 -1
  127. package/themes/original/src/components/DriverTips/index.tsx +4 -4
  128. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  129. package/themes/original/src/components/Favorite/index.tsx +1 -0
  130. package/themes/original/src/components/Favorite/styles.tsx +1 -0
  131. package/themes/original/src/components/FavoriteList/index.tsx +143 -94
  132. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  133. package/themes/original/src/components/GoogleMap/index.tsx +20 -12
  134. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +8 -3
  135. package/themes/original/src/components/HelpGuide/index.tsx +8 -3
  136. package/themes/original/src/components/HelpOrder/index.tsx +8 -3
  137. package/themes/original/src/components/LoginForm/Otp/index.tsx +3 -2
  138. package/themes/original/src/components/LoginForm/index.tsx +79 -42
  139. package/themes/original/src/components/Messages/index.tsx +17 -17
  140. package/themes/original/src/components/MomentSelector/index.tsx +197 -0
  141. package/themes/original/src/components/MomentSelector/styles.tsx +6 -0
  142. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +243 -0
  143. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/styles.tsx +46 -0
  144. package/themes/original/src/components/MultiCheckout/index.tsx +304 -0
  145. package/themes/original/src/components/MultiCheckout/styles.tsx +59 -0
  146. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +372 -0
  147. package/themes/original/src/components/MultiOrdersDetails/index.tsx +262 -0
  148. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +50 -0
  149. package/themes/original/src/components/MyOrders/index.tsx +177 -27
  150. package/themes/original/src/components/MyOrders/styles.tsx +8 -1
  151. package/themes/original/src/components/NavBar/index.tsx +11 -5
  152. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  153. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  154. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +167 -0
  155. package/themes/original/src/components/OrderDetails/index.tsx +187 -49
  156. package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
  157. package/themes/original/src/components/OrderItAgain/index.tsx +75 -0
  158. package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
  159. package/themes/original/src/components/OrderProgress/index.tsx +8 -2
  160. package/themes/original/src/components/OrderSummary/index.tsx +1 -34
  161. package/themes/original/src/components/OrderTypeSelector/index.tsx +84 -36
  162. package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
  163. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +144 -0
  164. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +6 -0
  165. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +56 -0
  166. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +6 -0
  167. package/themes/original/src/components/OrdersOption/index.tsx +126 -37
  168. package/themes/original/src/components/OrdersOption/styles.tsx +4 -1
  169. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  170. package/themes/original/src/components/PaymentOptions/index.tsx +57 -37
  171. package/themes/original/src/components/PhoneInputNumber/index.tsx +4 -10
  172. package/themes/original/src/components/PlaceSpot/index.tsx +243 -47
  173. package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
  174. package/themes/original/src/components/ProductForm/index.tsx +712 -655
  175. package/themes/original/src/components/ProductForm/styles.tsx +9 -7
  176. package/themes/original/src/components/ProductItemAccordion/index.tsx +170 -128
  177. package/themes/original/src/components/ProductOption/index.tsx +1 -1
  178. package/themes/original/src/components/ProfessionalFilter/index.tsx +129 -0
  179. package/themes/original/src/components/ProfessionalFilter/styles.tsx +0 -0
  180. package/themes/original/src/components/ProfessionalProfile/index.tsx +309 -0
  181. package/themes/original/src/components/ProfessionalProfile/styles.tsx +46 -0
  182. package/themes/original/src/components/ReviewDriver/index.tsx +6 -6
  183. package/themes/original/src/components/ReviewOrder/index.tsx +18 -3
  184. package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
  185. package/themes/original/src/components/ReviewTrigger/index.tsx +118 -0
  186. package/themes/original/src/components/ReviewTrigger/styles.tsx +34 -0
  187. package/themes/original/src/components/SearchBar/index.tsx +10 -5
  188. package/themes/original/src/components/ServiceForm/index.tsx +631 -0
  189. package/themes/original/src/components/ServiceForm/styles.tsx +50 -0
  190. package/themes/original/src/components/SignupForm/index.tsx +301 -158
  191. package/themes/original/src/components/SingleOrderCard/index.tsx +213 -177
  192. package/themes/original/src/components/SingleProductCard/index.tsx +198 -110
  193. package/themes/original/src/components/SingleProductCard/styles.tsx +2 -2
  194. package/themes/original/src/components/SingleProductReview/index.tsx +30 -3
  195. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  196. package/themes/original/src/components/StripeElementsForm/index.tsx +25 -9
  197. package/themes/original/src/components/StripeElementsForm/naked.tsx +2 -2
  198. package/themes/original/src/components/UpsellingProducts/index.tsx +14 -4
  199. package/themes/original/src/components/UserDetails/index.tsx +32 -18
  200. package/themes/original/src/components/UserFormDetails/index.tsx +107 -73
  201. package/themes/original/src/components/UserProfile/index.tsx +8 -1
  202. package/themes/original/src/components/UserProfileForm/index.tsx +15 -10
  203. package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
  204. package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
  205. package/themes/original/src/components/Wallets/index.tsx +174 -162
  206. package/themes/original/src/components/Wallets/styles.tsx +10 -8
  207. package/themes/original/src/components/shared/OBottomPopup.tsx +47 -14
  208. package/themes/original/src/components/shared/OButton.tsx +10 -3
  209. package/themes/original/src/components/shared/OInput.tsx +3 -2
  210. package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
  211. package/themes/original/src/types/index.tsx +163 -47
  212. package/themes/original/src/utils/index.tsx +77 -0
  213. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -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,24 @@ 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;
85
+ margin-horizontal: 30px;
88
86
  `;
89
87
 
90
88
  export const WeightUnitSwitch = styled.View`
@@ -99,4 +97,8 @@ export const WeightUnitItem = styled.View`
99
97
  `}
100
98
  `
101
99
  export const ProductSummary = styled.View`
100
+ padding: 26px 40px;
101
+ position: relative;
102
+ background-color: white;
103
+ z-index: 100;
102
104
  `
@@ -4,6 +4,7 @@ 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';
7
8
 
8
9
  import {
9
10
  Accordion,
@@ -18,7 +19,7 @@ import {
18
19
  ProductSubOption,
19
20
  ProductComment
20
21
  } from './styles'
21
- import { OIcon, OText, OAlert } from '../shared'
22
+ import { OIcon, OText, OAlert, OModal } from '../shared'
22
23
 
23
24
  import { ProductItemAccordionParams } from '../../types'
24
25
 
@@ -68,9 +69,10 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
68
69
 
69
70
  const [, t] = useLanguage()
70
71
  const [orderState] = useOrder()
71
- const [{ parsePrice, optimizeImage }] = useUtils()
72
+ const [{ parsePrice, optimizeImage, parseDate }] = useUtils()
72
73
 
73
74
  const [isActive, setActiveState] = useState(false)
75
+ const [isServiceOpen, setIsServiceOpen] = useState(false)
74
76
  // const [setHeight, setHeightState] = useState({ height: new Animated.Value(0) })
75
77
  // const [setRotate, setRotateState] = useState({ angle: new Animated.Value(0) })
76
78
 
@@ -92,6 +94,14 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
92
94
  return product
93
95
  }
94
96
 
97
+ const handleEditProduct = (curProduct: any) => {
98
+ if (!curProduct?.calendar_event) {
99
+ onEditProduct && onEditProduct(curProduct)
100
+ return
101
+ }
102
+ setIsServiceOpen(true)
103
+ }
104
+
95
105
  /* const toggleAccordion = () => {
96
106
  if ((!product?.valid_menu && isCartProduct)) return
97
107
  if (isActive) {
@@ -133,135 +143,167 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
133
143
  })
134
144
 
135
145
  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
- )}
146
+ <>
147
+ <AccordionSection>
148
+ <Accordion
149
+ isValid={product?.valid ?? true}
150
+ onPress={() => (!product?.valid_menu && isCartProduct)
151
+ ? {}
152
+ : setActiveState(!isActive)}
153
+ activeOpacity={1}
154
+ >
155
+ <View style={{ flexDirection: 'row', alignItems: 'flex-start' }}>
156
+ <ContentInfo>
157
+ {(product?.images || theme?.images?.dummies?.product) && (
158
+ <ProductImage>
159
+ {isFromCheckout ? (
160
+ <OIcon url={optimizeImage(product?.images || theme?.images?.dummies?.product, 'h_100,c_limit')} style={{ ...styles.productImage, ...{ width: 82, height: 82 } }} />
161
+ ) : (
162
+ <OIcon url={optimizeImage(product?.images || theme?.images?.dummies?.product, 'h_100,c_limit')} style={styles.productImage} />
163
+ )}
164
+ </ProductImage>
165
+ )}
166
+ {!!product?.calendar_event ? (
167
+ <View style={{ flex: 1, marginLeft: 10, flexDirection: 'column' }}>
168
+ <View>
169
+ <OText size={12} lineHeight={18} weight={'400'} numberOfLines={1}>{product?.name}</OText>
170
+ </View>
171
+ <OText size={10} color={theme.colors.textSecondary} style={{ marginTop: 3 }}>
172
+ {parseDate(product?.calendar_event?.start, { outputFormat: 'hh:mm a' })} - {parseDate(product?.calendar_event?.end, { outputFormat: 'hh:mm a' })}
173
+ </OText>
174
+ </View>
175
+ ): (
176
+ <>
177
+ {isCartProduct && !isCartPending && getProductMax && (
178
+ <ProductInfo>
179
+ <RNPickerSelect
180
+ items={productOptions}
181
+ onValueChange={handleChangeQuantity}
182
+ value={product.quantity.toString()}
183
+ style={pickerStyle}
184
+ useNativeAndroidPickerStyle={false}
185
+ placeholder={{}}
186
+ Icon={() => <View style={pickerStyle.icon}><OIcon src={theme.images.general.arrow_down} color={theme.colors.textNormal} width={8} /></View>}
187
+ disabled={orderState.loading}
188
+ />
189
+ </ProductInfo>
190
+ )}
191
+ {isFromCheckout && (
192
+ <ProductQuantity>
193
+ <OText size={12} lineHeight={18}>
194
+ {product?.quantity}
195
+ </OText>
196
+ </ProductQuantity>
197
+ )}
198
+ <View style={{ flex: 1 }}>
199
+ <OText size={12} lineHeight={18} weight={'400'}>{product.name}</OText>
200
+ </View>
201
+ </>
202
+ )}
203
+ <View style={{ display: 'flex', flexDirection: 'column', flex: 1, alignItems: 'flex-end', maxWidth: 100 }}>
204
+ <View style={{ flexDirection: 'row' }}>
205
+ <OText size={12} lineHeight={18} weight={'400'}>{parsePrice(product.total || product.price)}</OText>
206
+ {(productInfo().ingredients.length > 0 || productInfo().options.length > 0 || product.comment) && (
207
+ <MaterialCommunityIcon name='chevron-down' size={18} />
208
+ )}
209
+ </View>
210
+ <View style={{ display: 'flex', flexDirection: 'row', justifyContent: 'flex-start' }}>
211
+ {onEditProduct && isCartProduct && !isCartPending && product?.valid_menu && (
212
+ <TouchableOpacity onPress={() => handleEditProduct(product)} style={{ marginEnd: 7 }}>
213
+ <OIcon
214
+ src={theme.images.general.pencil}
215
+ width={16}
216
+ color={theme.colors.textSecondary}
217
+ />
218
+ </TouchableOpacity>
219
+ )}
220
+ {onDeleteProduct && isCartProduct && !isCartPending && (
221
+ <OAlert
222
+ title={t('DELETE_PRODUCT', 'Delete Product')}
223
+ message={t('QUESTION_DELETE_PRODUCT', 'Are you sure that you want to delete the product?')}
224
+ onAccept={() => onDeleteProduct(product)}
225
+ >
226
+ <OIcon
227
+ src={theme.images.general.trash}
228
+ width={17}
229
+ color={theme.colors.textSecondary}
230
+ />
231
+ </OAlert>
232
+ )}
233
+ </View>
185
234
  </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
- )}
235
+ </ContentInfo>
236
+ </View>
237
+ {((isCartProduct && !isCartPending && product?.valid_menu && !product?.valid_quantity) ||
238
+ (!product?.valid_menu && isCartProduct && !isCartPending)) && (
239
+ <View style={{ alignItems: 'flex-end', width: '100%', }}>
240
+ <OText size={14} color={theme.colors.red} style={{ textAlign: 'right', marginTop: 5 }}>
241
+ {t('NOT_AVAILABLE', 'Not available')}
242
+ </OText>
209
243
  </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
244
  )}
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>
245
+ </Accordion>
246
+
247
+ <View style={{ display: isActive ? 'flex' : 'none', paddingStart: 40 }}>
248
+ <Animated.View>
249
+ <AccordionContent>
250
+ {productInfo().ingredients.length > 0 && productInfo().ingredients.some((ingredient: any) => !ingredient.selected) && (
251
+ <ProductOptionsList>
252
+ <OText size={10} color={theme.colors.textSecondary}>{t('INGREDIENTS', 'Ingredients')}</OText>
253
+ {productInfo().ingredients.map((ingredient: any) => !ingredient.selected && (
254
+ <OText size={10} color={theme.colors.textThird} key={ingredient.id} style={{ marginLeft: 10 }}>{t('NO', 'No')} {ingredient.name}</OText>
255
+ ))}
256
+ </ProductOptionsList>
257
+ )}
258
+ {productInfo().options.length > 0 && (
259
+ <ProductOptionsList>
260
+ {productInfo().options.map((option: any, i: number) => (
261
+ <ProductOption key={option.id + i}>
262
+ <OText size={10} color={theme.colors.textSecondary}>{option.name}</OText>
263
+ {option.suboptions.map((suboption: any) => (
264
+ <ProductSubOption key={suboption.id}>
265
+ <OText size={10} color={theme.colors.textThird}>
266
+ {getFormattedSubOptionName({
267
+ quantity: suboption.quantity,
268
+ name: suboption.name,
269
+ position: (suboption.position !== 'whole') ? t(suboption.position.toUpperCase(), suboption.position) : '',
270
+ price: parsePrice(suboption.price)
271
+ })}
272
+ </OText>
273
+ </ProductSubOption>
274
+ ))}
275
+ </ProductOption>
276
+ ))}
277
+ </ProductOptionsList>
278
+ )}
279
+ {product.comment && (
280
+ <ProductComment>
281
+ <OText size={10} color={theme.colors.textSecondary}>{t('SPECIAL_COMMENT', 'Special Comment')}</OText>
282
+ <OText size={10} color={theme.colors.textThird}>{product.comment}</OText>
283
+ </ProductComment>
284
+ )}
285
+ </AccordionContent>
286
+ </Animated.View>
287
+ </View>
288
+ </AccordionSection>
289
+ <OModal
290
+ open={isServiceOpen}
291
+ onClose={() => setIsServiceOpen(false)}
292
+ entireModal
293
+ >
294
+ <ServiceForm
295
+ isCartProduct
296
+ isService
297
+ businessId={product?.business_id}
298
+ categoryId={product?.category_id}
299
+ productId={product?.id}
300
+ productCart={product}
301
+ onSave={() => setIsServiceOpen(false)}
302
+ onClose={() => setIsServiceOpen(false)}
303
+ professionalSelected={product?.calendar_event?.professional}
304
+ />
305
+ </OModal>
306
+ </>
265
307
  )
266
308
  }
267
309
 
@@ -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}
@@ -0,0 +1,129 @@
1
+ import React, { useState } from 'react'
2
+ import { ScrollView, TouchableOpacity, View, StyleSheet, Platform } from 'react-native'
3
+ import { useUtils, useLanguage } from 'ordering-components/native'
4
+ import { useTheme } from 'styled-components/native'
5
+ import FastImage from 'react-native-fast-image'
6
+ import { OIcon, OText, OModal } from '../shared'
7
+ import { ProfessionalProfile } from '../ProfessionalProfile'
8
+ import { ProfessionalFilterParams } from '../../types'
9
+
10
+ export const ProfessionalFilter = (props: ProfessionalFilterParams) => {
11
+ const {
12
+ professionals,
13
+ professionalSelected,
14
+ handleChangeProfessionalSelected
15
+ } = props
16
+
17
+ const theme = useTheme()
18
+ const [{ optimizeImage }] = useUtils()
19
+ const [, t] = useLanguage()
20
+ const [open, setOpen] = useState(false)
21
+ const [currentProfessional, setCurrentProfessional] = useState(null)
22
+
23
+ const handleOpenProfile = (professional: any) => {
24
+ setCurrentProfessional(professional)
25
+ setOpen(true)
26
+ }
27
+
28
+ const handleCloseProfile = () => {
29
+ setCurrentProfessional(null)
30
+ setOpen(false)
31
+ }
32
+
33
+ const styles = StyleSheet.create({
34
+ professionalItem: {
35
+ flexDirection: 'row',
36
+ alignItems: 'center',
37
+ borderRadius: 7.6,
38
+ padding: 11,
39
+ borderWidth: 1,
40
+ marginRight: 12,
41
+ minHeight: 64
42
+ },
43
+ photoStyle: {
44
+ width: 42,
45
+ height: 42,
46
+ borderRadius: 7.6
47
+ }
48
+ })
49
+
50
+ return (
51
+ <>
52
+ <ScrollView
53
+ horizontal
54
+ showsVerticalScrollIndicator={false}
55
+ showsHorizontalScrollIndicator={false}
56
+ >
57
+ <TouchableOpacity
58
+ onPress={() => handleChangeProfessionalSelected(null)}
59
+ >
60
+ <View
61
+ style={{
62
+ ...styles.professionalItem,
63
+ borderColor: !professionalSelected
64
+ ? theme.colors.primary
65
+ : theme.colors.border
66
+ }}
67
+ >
68
+ <OText
69
+ size={12}
70
+ weight={'400'}
71
+ >
72
+ {t('ANY_PROFESSIONAL_MEMBER', 'Any professional member')}
73
+ </OText>
74
+ </View>
75
+ </TouchableOpacity>
76
+ {professionals.map((professional: any, i: number) => (
77
+ <TouchableOpacity
78
+ key={i}
79
+ onPress={() => handleOpenProfile(professional)}
80
+ >
81
+ <View
82
+ style={{
83
+ ...styles.professionalItem,
84
+ borderColor: (professional?.id === professionalSelected?.id)
85
+ ? theme.colors.primary
86
+ : theme.colors.border
87
+ }}
88
+ >
89
+ {professional?.photo ? (
90
+ <FastImage
91
+ style={styles.photoStyle}
92
+ source={{
93
+ uri: optimizeImage(professional?.photo, 'h_250,c_limit'),
94
+ priority: FastImage.priority.normal,
95
+ }}
96
+ resizeMode={FastImage.resizeMode.cover}
97
+ />
98
+ ) : (
99
+ <OIcon
100
+ src={theme?.images?.general?.user}
101
+ cover={false}
102
+ style={styles.photoStyle}
103
+ />
104
+ )}
105
+ <OText
106
+ size={12}
107
+ style={{ marginLeft: 12 }}
108
+ weight={'400'}
109
+ >
110
+ {professional?.name} {professional?.lastname}
111
+ </OText>
112
+ </View>
113
+ </TouchableOpacity>
114
+ ))}
115
+ </ScrollView>
116
+ <OModal
117
+ open={open}
118
+ onClose={() => handleCloseProfile()}
119
+ entireModal
120
+ >
121
+ <ProfessionalProfile
122
+ professional={currentProfessional}
123
+ onClose={() => handleCloseProfile()}
124
+ handleChangeProfessionalSelected={handleChangeProfessionalSelected}
125
+ />
126
+ </OModal>
127
+ </>
128
+ )
129
+ }