ordering-ui-react-native 0.17.16 → 0.17.17-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 (209) hide show
  1. package/package.json +5 -7
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessesListing/index.tsx +1 -1
  4. package/src/components/OrderCreating/index.tsx +1 -21
  5. package/src/components/PaymentOptionsWebView/index.tsx +119 -120
  6. package/src/components/StripeMethodForm/index.tsx +108 -77
  7. package/src/components/VerifyPhone/styles.tsx +1 -2
  8. package/src/components/shared/OToast.tsx +4 -4
  9. package/src/types/index.tsx +5 -0
  10. package/src/utils/index.tsx +7 -1
  11. package/themes/business/index.tsx +2 -0
  12. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
  13. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  14. package/themes/business/src/components/BusinessController/index.tsx +0 -1
  15. package/themes/business/src/components/Chat/index.tsx +118 -107
  16. package/themes/business/src/components/DriverMap/index.tsx +17 -6
  17. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  18. package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
  19. package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
  20. package/themes/business/src/components/LoginForm/index.tsx +238 -80
  21. package/themes/business/src/components/LoginForm/styles.tsx +10 -0
  22. package/themes/business/src/components/MapView/index.tsx +10 -10
  23. package/themes/business/src/components/NewOrderNotification/index.tsx +43 -50
  24. package/themes/business/src/components/OrderDetails/Delivery.tsx +4 -3
  25. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +90 -47
  26. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +59 -62
  27. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
  28. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  29. package/themes/business/src/components/OrderMessage/index.tsx +18 -17
  30. package/themes/business/src/components/OrderSummary/index.tsx +113 -121
  31. package/themes/business/src/components/OrdersOption/index.tsx +32 -75
  32. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
  33. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  34. package/themes/business/src/components/PreviousOrders/index.tsx +445 -243
  35. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  36. package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
  37. package/themes/business/src/components/ReviewCustomer/index.tsx +41 -24
  38. package/themes/business/src/components/StoresList/index.tsx +2 -2
  39. package/themes/business/src/components/shared/OLink.tsx +33 -13
  40. package/themes/business/src/components/shared/OModal.tsx +16 -9
  41. package/themes/business/src/components/shared/OText.tsx +8 -2
  42. package/themes/business/src/types/index.tsx +32 -2
  43. package/themes/business/src/utils/index.tsx +44 -1
  44. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  45. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  46. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  47. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  48. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  49. package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
  50. package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
  51. package/themes/kiosk/src/components/LoginForm/index.tsx +473 -151
  52. package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
  53. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  54. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  55. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  56. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +3 -2
  57. package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
  58. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  59. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  60. package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
  61. package/themes/kiosk/src/layouts/Container.tsx +7 -1
  62. package/themes/kiosk/src/types/index.d.ts +13 -0
  63. package/themes/kiosk/src/utils/index.tsx +15 -0
  64. package/themes/original/index.tsx +10 -2
  65. package/themes/original/src/components/AddressDetails/index.tsx +29 -11
  66. package/themes/original/src/components/AddressForm/index.tsx +41 -16
  67. package/themes/original/src/components/AddressList/index.tsx +26 -21
  68. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  69. package/themes/original/src/components/AnalyticsSegment/index.tsx +195 -12
  70. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  71. package/themes/original/src/components/BusinessBasicInformation/index.tsx +166 -89
  72. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +9 -7
  73. package/themes/original/src/components/BusinessController/index.tsx +145 -68
  74. package/themes/original/src/components/BusinessController/styles.tsx +22 -9
  75. package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
  76. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
  77. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  78. package/themes/original/src/components/BusinessItemAccordion/index.tsx +23 -22
  79. package/themes/original/src/components/BusinessListingSearch/index.tsx +350 -323
  80. package/themes/original/src/components/BusinessPreorder/index.tsx +97 -16
  81. package/themes/original/src/components/BusinessProductsList/index.tsx +20 -11
  82. package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
  83. package/themes/original/src/components/BusinessProductsListing/index.tsx +617 -493
  84. package/themes/original/src/components/BusinessProductsListing/styles.tsx +7 -13
  85. package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
  86. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  87. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +105 -78
  88. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  89. package/themes/original/src/components/BusinessesListing/index.tsx +5 -3
  90. package/themes/original/src/components/Cart/index.tsx +88 -43
  91. package/themes/original/src/components/CartContent/index.tsx +110 -19
  92. package/themes/original/src/components/CartContent/styles.tsx +15 -1
  93. package/themes/original/src/components/Checkout/index.tsx +323 -178
  94. package/themes/original/src/components/Checkout/styles.tsx +4 -2
  95. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  96. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  97. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  98. package/themes/original/src/components/DriverTips/index.tsx +49 -34
  99. package/themes/original/src/components/Favorite/index.tsx +7 -4
  100. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  101. package/themes/original/src/components/FavoriteList/index.tsx +51 -80
  102. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  103. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  104. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  105. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +96 -0
  106. package/themes/original/src/components/GiftCard/GiftCardUI/styles.tsx +5 -0
  107. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +100 -0
  108. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +8 -0
  109. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +178 -0
  110. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +8 -0
  111. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +165 -0
  112. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +9 -0
  113. package/themes/original/src/components/Help/index.tsx +8 -8
  114. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +11 -22
  115. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
  116. package/themes/original/src/components/HelpGuide/index.tsx +12 -16
  117. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  118. package/themes/original/src/components/HelpOrder/index.tsx +12 -25
  119. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  120. package/themes/original/src/components/Home/index.tsx +13 -4
  121. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  122. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  123. package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
  124. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  125. package/themes/original/src/components/LoginForm/index.tsx +48 -19
  126. package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
  127. package/themes/original/src/components/MessageListing/index.tsx +16 -42
  128. package/themes/original/src/components/Messages/index.tsx +32 -10
  129. package/themes/original/src/components/MomentOption/index.tsx +195 -88
  130. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  131. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +195 -116
  132. package/themes/original/src/components/MultiCheckout/index.tsx +262 -83
  133. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  134. package/themes/original/src/components/MultiOrdersDetails/index.tsx +67 -20
  135. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  136. package/themes/original/src/components/MyOrders/index.tsx +55 -51
  137. package/themes/original/src/components/NavBar/index.tsx +6 -11
  138. package/themes/original/src/components/Notifications/index.tsx +144 -0
  139. package/themes/original/src/components/Notifications/styles.tsx +20 -0
  140. package/themes/original/src/components/OrderDetails/OrderEta.tsx +64 -0
  141. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +15 -3
  142. package/themes/original/src/components/OrderDetails/index.tsx +262 -347
  143. package/themes/original/src/components/OrderDetails/styles.tsx +10 -1
  144. package/themes/original/src/components/OrderItAgain/index.tsx +47 -43
  145. package/themes/original/src/components/OrderProgress/index.tsx +74 -112
  146. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  147. package/themes/original/src/components/OrderSummary/index.tsx +67 -29
  148. package/themes/original/src/components/OrderTypeSelector/index.tsx +3 -2
  149. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +24 -19
  150. package/themes/original/src/components/OrdersOption/index.tsx +96 -88
  151. package/themes/original/src/components/PageBanner/index.tsx +171 -0
  152. package/themes/original/src/components/PageBanner/styles.tsx +11 -0
  153. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  154. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  155. package/themes/original/src/components/PaymentOptions/index.tsx +34 -6
  156. package/themes/original/src/components/PhoneInputNumber/index.tsx +3 -3
  157. package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
  158. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  159. package/themes/original/src/components/ProductForm/index.tsx +231 -253
  160. package/themes/original/src/components/ProductForm/styles.tsx +4 -7
  161. package/themes/original/src/components/ProductItemAccordion/index.tsx +197 -138
  162. package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -10
  163. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
  164. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  165. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
  166. package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
  167. package/themes/original/src/components/Promotions/index.tsx +234 -220
  168. package/themes/original/src/components/Promotions/styles.tsx +10 -3
  169. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  170. package/themes/original/src/components/ReviewOrder/index.tsx +26 -9
  171. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  172. package/themes/original/src/components/ReviewProducts/index.tsx +7 -4
  173. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  174. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  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 +366 -288
  178. package/themes/original/src/components/Sessions/index.tsx +11 -8
  179. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  180. package/themes/original/src/components/SignupForm/index.tsx +82 -67
  181. package/themes/original/src/components/SingleOrderCard/index.tsx +148 -62
  182. package/themes/original/src/components/SingleOrderCard/styles.tsx +11 -9
  183. package/themes/original/src/components/SingleProductCard/index.tsx +99 -55
  184. package/themes/original/src/components/SingleProductCard/styles.tsx +27 -13
  185. package/themes/original/src/components/SingleProductReview/index.tsx +8 -2
  186. package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
  187. package/themes/original/src/components/StripeCardsList/index.tsx +9 -2
  188. package/themes/original/src/components/StripeElementsForm/index.tsx +28 -15
  189. package/themes/original/src/components/UpsellingProducts/index.tsx +238 -218
  190. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  191. package/themes/original/src/components/UserDetails/index.tsx +8 -4
  192. package/themes/original/src/components/UserFormDetails/index.tsx +53 -54
  193. package/themes/original/src/components/UserProfile/index.tsx +57 -41
  194. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  195. package/themes/original/src/components/UserProfileForm/index.tsx +21 -28
  196. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  197. package/themes/original/src/components/Wallets/index.tsx +31 -17
  198. package/themes/original/src/components/Wallets/styles.tsx +2 -0
  199. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  200. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  201. package/themes/original/src/components/shared/OBottomPopup.tsx +1 -1
  202. package/themes/original/src/components/shared/OButton.tsx +6 -2
  203. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  204. package/themes/original/src/components/shared/OInput.tsx +10 -1
  205. package/themes/original/src/components/shared/OModal.tsx +3 -3
  206. package/themes/original/src/layouts/Container.tsx +13 -9
  207. package/themes/original/src/types/index.tsx +41 -10
  208. package/themes/original/src/utils/index.tsx +375 -58
  209. 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`
@@ -44,12 +44,10 @@ export const ProductTitle = styled.View`
44
44
  padding-bottom: 7px;
45
45
  `
46
46
 
47
- export const ProductDescription = styled.View`
48
- margin-bottom: 20px;
49
- `
47
+ export const ProductDescription = styled.View``
50
48
 
51
49
  export const ProductEditions = styled.View`
52
- padding: 0 40px;
50
+ padding-vertical: 0;
53
51
  `
54
52
 
55
53
  export const SectionTitle = styled.View`
@@ -82,7 +80,6 @@ export const ProductActions = styled.View`
82
80
  border-top-color: ${(props: any) => props.theme.colors.border};
83
81
  `
84
82
  export const ExtraOptionWrap = styled.ScrollView`
85
- margin-horizontal: 30px;
86
83
  `;
87
84
 
88
85
  export const WeightUnitSwitch = styled.View`
@@ -97,7 +94,7 @@ export const WeightUnitItem = styled.View`
97
94
  `}
98
95
  `
99
96
  export const ProductSummary = styled.View`
100
- padding: 26px 40px;
97
+ padding: 26px ${(props: any) => props.ph}px 0;
101
98
  position: relative;
102
99
  background-color: white;
103
100
  z-index: 100;
@@ -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,13 +20,14 @@ 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
 
25
27
  export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
26
28
 
27
29
  const {
30
+ isDisabledEdit,
28
31
  isCartPending,
29
32
  isCartProduct,
30
33
  product,
@@ -71,6 +74,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
71
74
  const [{ parsePrice, optimizeImage, parseDate }] = useUtils()
72
75
 
73
76
  const [isActive, setActiveState] = useState(false)
77
+ const [isServiceOpen, setIsServiceOpen] = useState(false)
74
78
  // const [setHeight, setHeightState] = useState({ height: new Animated.Value(0) })
75
79
  // const [setRotate, setRotateState] = useState({ angle: new Animated.Value(0) })
76
80
 
@@ -92,6 +96,14 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
92
96
  return product
93
97
  }
94
98
 
99
+ const handleEditProduct = (curProduct: any) => {
100
+ if (!curProduct?.calendar_event) {
101
+ onEditProduct && onEditProduct(curProduct)
102
+ return
103
+ }
104
+ setIsServiceOpen(true)
105
+ }
106
+
95
107
  /* const toggleAccordion = () => {
96
108
  if ((!product?.valid_menu && isCartProduct)) return
97
109
  if (isActive) {
@@ -133,148 +145,195 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
133
145
  })
134
146
 
135
147
  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 || theme?.images?.dummies?.product) && (
147
- <ProductImage>
148
- {isFromCheckout ? (
149
- <OIcon url={optimizeImage(product?.images || theme?.images?.dummies?.product, 'h_100,c_limit')} style={{ ...styles.productImage, ...{ width: 82, height: 82 } }} />
150
- ) : (
151
- <OIcon url={optimizeImage(product?.images || theme?.images?.dummies?.product, 'h_100,c_limit')} style={styles.productImage} />
152
- )}
153
- </ProductImage>
154
- )}
155
- {!!product?.calendar_event ? (
156
- <View style={{ flex: 1, marginLeft: 10, flexDirection: 'column' }}>
157
- <View>
158
- <OText size={12} lineHeight={18} weight={'400'} numberOfLines={1}>{product?.name}</OText>
148
+ <>
149
+ <AccordionSection>
150
+ <Accordion
151
+ isValid={product?.valid ?? true}
152
+ onPress={() => (!product?.valid_menu && isCartProduct)
153
+ ? {}
154
+ : setActiveState(!isActive)}
155
+ activeOpacity={1}
156
+ >
157
+ <View style={{ flexDirection: 'row', alignItems: 'flex-start' }}>
158
+ <ContentInfo>
159
+ {(product?.images || theme?.images?.dummies?.product) && (
160
+ <ProductImage>
161
+ {isFromCheckout ? (
162
+ product?.images ? (
163
+ <FastImage
164
+ style={{ ...styles.productImage, ...{ width: 82, height: 82 } }}
165
+ source={{
166
+ uri: optimizeImage(product?.images, 'h_100,c_limit'),
167
+ priority: FastImage.priority.normal,
168
+ }}
169
+ resizeMode={FastImage.resizeMode.cover}
170
+ />
171
+ ) : (
172
+ <OIcon
173
+ src={theme?.images?.dummies?.product}
174
+ style={{ ...styles.productImage, ...{ width: 82, height: 82 } }}
175
+ />
176
+ )
177
+ ) : (
178
+ product?.images ? (
179
+ <FastImage
180
+ style={styles.productImage}
181
+ source={{
182
+ uri: optimizeImage(product?.images, 'h_100,c_limit'),
183
+ priority: FastImage.priority.normal,
184
+ }}
185
+ resizeMode={FastImage.resizeMode.cover}
186
+ />
187
+ ) : (
188
+ <OIcon
189
+ src={theme?.images?.dummies?.product}
190
+ style={styles.productImage}
191
+ />
192
+ )
193
+ )}
194
+ </ProductImage>
195
+ )}
196
+ {!!product?.calendar_event ? (
197
+ <View style={{ flex: 1, marginLeft: 10, flexDirection: 'column' }}>
198
+ <View>
199
+ <OText size={12} lineHeight={18} weight={'400'} numberOfLines={1}>{product?.name}</OText>
200
+ </View>
201
+ <OText size={10} color={theme.colors.textSecondary} style={{ marginTop: 3 }}>
202
+ {parseDate(product?.calendar_event?.start, { outputFormat: 'hh:mm a' })} - {parseDate(product?.calendar_event?.end, { outputFormat: 'hh:mm a' })}
203
+ </OText>
159
204
  </View>
160
- <OText size={10} color={theme.colors.textSecondary} style={{ marginTop: 3 }}>
161
- {parseDate(product?.calendar_event?.start, { outputFormat: 'hh:mm a' })} - {parseDate(product?.calendar_event?.end, { outputFormat: 'hh:mm a' })}
162
- </OText>
163
- </View>
164
- ): (
165
- <>
166
- {isCartProduct && !isCartPending && getProductMax && (
167
- <ProductInfo>
168
- <RNPickerSelect
169
- items={productOptions}
170
- onValueChange={handleChangeQuantity}
171
- value={product.quantity.toString()}
172
- style={pickerStyle}
173
- useNativeAndroidPickerStyle={false}
174
- placeholder={{}}
175
- Icon={() => <View style={pickerStyle.icon}><OIcon src={theme.images.general.arrow_down} color={theme.colors.textNormal} width={8} /></View>}
176
- disabled={orderState.loading}
177
- />
178
- </ProductInfo>
179
- )}
180
- {isFromCheckout && (
181
- <ProductQuantity>
182
- <OText size={12} lineHeight={18}>
183
- {product?.quantity}
184
- </OText>
185
- </ProductQuantity>
186
- )}
187
- <View style={{ flex: 1 }}>
188
- <OText size={12} lineHeight={18} weight={'400'}>{product.name}</OText>
205
+ ) : (
206
+ <>
207
+ {!isDisabledEdit && isCartProduct && !isCartPending && getProductMax && (
208
+ <ProductInfo>
209
+ <RNPickerSelect
210
+ items={productOptions}
211
+ onValueChange={handleChangeQuantity}
212
+ value={product.quantity.toString()}
213
+ style={pickerStyle}
214
+ useNativeAndroidPickerStyle={false}
215
+ placeholder={{}}
216
+ Icon={() => <View style={pickerStyle.icon}><OIcon src={theme.images.general.arrow_down} color={theme.colors.textNormal} width={8} /></View>}
217
+ disabled={orderState.loading}
218
+ />
219
+ </ProductInfo>
220
+ )}
221
+ {isFromCheckout && (
222
+ <ProductQuantity>
223
+ <OText size={12} lineHeight={18}>
224
+ {product?.quantity}
225
+ </OText>
226
+ </ProductQuantity>
227
+ )}
228
+ <View style={{ flex: 1 }}>
229
+ <OText size={12} lineHeight={18} weight={'400'} mLeft={8}>{product.name}</OText>
230
+ </View>
231
+ </>
232
+ )}
233
+ <View style={{ display: 'flex', flexDirection: 'column', flex: 1, alignItems: 'flex-end', maxWidth: 100 }}>
234
+ <View style={{ flexDirection: 'row' }}>
235
+ <OText size={12} lineHeight={18} weight={'400'}>{parsePrice(product.total || product.price)}</OText>
236
+ {(productInfo().ingredients.length > 0 || productInfo().options.length > 0 || !!product.comment) && (
237
+ <MaterialCommunityIcon name='chevron-down' size={18} />
238
+ )}
239
+ </View>
240
+ <View style={{ display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', height: 20 }}>
241
+ {!isDisabledEdit && onEditProduct && isCartProduct && !isCartPending && product?.valid_menu && (
242
+ <TouchableOpacity onPress={() => handleEditProduct(product)} style={{ marginRight: 5 }}>
243
+ <MaterialCommunityIcon
244
+ name='pencil-outline'
245
+ size={20}
246
+ color={theme.colors.textSecondary}
247
+ />
248
+ </TouchableOpacity>
249
+ )}
250
+ {onDeleteProduct && isCartProduct && !isCartPending && (
251
+ <OAlert
252
+ title={t('DELETE_PRODUCT', 'Delete Product')}
253
+ message={t('QUESTION_DELETE_PRODUCT', 'Are you sure that you want to delete the product?')}
254
+ onAccept={() => onDeleteProduct(product)}
255
+ >
256
+ <MaterialCommunityIcon
257
+ name='trash-can-outline'
258
+ size={20}
259
+ color={theme.colors.textSecondary}
260
+ />
261
+ </OAlert>
262
+ )}
189
263
  </View>
190
- </>
191
- )}
192
- <View style={{ display: 'flex', flexDirection: 'column', flex: 1, alignItems: 'flex-end', maxWidth: 100 }}>
193
- <View style={{ flexDirection: 'row' }}>
194
- <OText size={12} lineHeight={18} weight={'400'}>{parsePrice(product.total || product.price)}</OText>
195
- {(productInfo().ingredients.length > 0 || productInfo().options.length > 0 || product.comment) && (
196
- <MaterialCommunityIcon name='chevron-down' size={18} />
197
- )}
198
264
  </View>
199
- <View style={{ display: 'flex', flexDirection: 'row', justifyContent: 'flex-start' }}>
200
- {onEditProduct && isCartProduct && !isCartPending && product?.valid_menu && (
201
- <TouchableOpacity onPress={() => onEditProduct(product)} style={{ marginEnd: 7 }}>
202
- <OIcon
203
- src={theme.images.general.pencil}
204
- width={16}
205
- color={theme.colors.textSecondary}
206
- />
207
- </TouchableOpacity>
208
- )}
209
- {onDeleteProduct && isCartProduct && !isCartPending && (
210
- <OAlert
211
- title={t('DELETE_PRODUCT', 'Delete Product')}
212
- message={t('QUESTION_DELETE_PRODUCT', 'Are you sure that you want to delete the product?')}
213
- onAccept={() => onDeleteProduct(product)}
214
- >
215
- <OIcon
216
- src={theme.images.general.trash}
217
- width={17}
218
- color={theme.colors.textSecondary}
219
- />
220
- </OAlert>
221
- )}
265
+ </ContentInfo>
266
+ </View>
267
+ {((isCartProduct && !isCartPending && product?.valid_menu && !product?.valid_quantity) ||
268
+ (!product?.valid_menu && isCartProduct && !isCartPending)) && (
269
+ <View style={{ alignItems: 'flex-end', width: '100%', }}>
270
+ <OText size={14} color={theme.colors.red} style={{ textAlign: 'right', marginTop: 5 }}>
271
+ {t('NOT_AVAILABLE', 'Not available')}
272
+ </OText>
222
273
  </View>
223
- </View>
224
- </ContentInfo>
225
- </View>
226
- {((isCartProduct && !isCartPending && product?.valid_menu && !product?.valid_quantity) ||
227
- (!product?.valid_menu && isCartProduct && !isCartPending)) && (
228
- <View style={{ alignItems: 'flex-end', width: '100%', }}>
229
- <OText size={14} color={theme.colors.red} style={{ textAlign: 'right', marginTop: 5 }}>
230
- {t('NOT_AVAILABLE', 'Not available')}
231
- </OText>
232
- </View>
233
- )}
234
- </Accordion>
235
-
236
- <View style={{ display: isActive ? 'flex' : 'none', paddingStart: 40 }}>
237
- <Animated.View>
238
- <AccordionContent>
239
- {productInfo().ingredients.length > 0 && productInfo().ingredients.some((ingredient: any) => !ingredient.selected) && (
240
- <ProductOptionsList>
241
- <OText size={10} color={theme.colors.textSecondary}>{t('INGREDIENTS', 'Ingredients')}</OText>
242
- {productInfo().ingredients.map((ingredient: any) => !ingredient.selected && (
243
- <OText size={10} color={theme.colors.textThird} key={ingredient.id} style={{ marginLeft: 10 }}>{t('NO', 'No')} {ingredient.name}</OText>
244
- ))}
245
- </ProductOptionsList>
246
- )}
247
- {productInfo().options.length > 0 && (
248
- <ProductOptionsList>
249
- {productInfo().options.map((option: any, i: number) => (
250
- <ProductOption key={option.id + i}>
251
- <OText size={10} color={theme.colors.textSecondary}>{option.name}</OText>
252
- {option.suboptions.map((suboption: any) => (
253
- <ProductSubOption key={suboption.id}>
254
- <OText size={10} color={theme.colors.textThird}>
255
- {getFormattedSubOptionName({
256
- quantity: suboption.quantity,
257
- name: suboption.name,
258
- position: (suboption.position !== 'whole') ? t(suboption.position.toUpperCase(), suboption.position) : '',
259
- price: parsePrice(suboption.price)
260
- })}
261
- </OText>
262
- </ProductSubOption>
263
- ))}
264
- </ProductOption>
265
- ))}
266
- </ProductOptionsList>
267
274
  )}
268
- {product.comment && (
269
- <ProductComment>
270
- <OText size={10} color={theme.colors.textSecondary}>{t('SPECIAL_COMMENT', 'Special Comment')}</OText>
271
- <OText size={10} color={theme.colors.textThird}>{product.comment}</OText>
272
- </ProductComment>
273
- )}
274
- </AccordionContent>
275
- </Animated.View>
276
- </View>
277
- </AccordionSection>
275
+ </Accordion>
276
+
277
+ <View style={{ display: isActive ? 'flex' : 'none', paddingStart: 40 }}>
278
+ <Animated.View>
279
+ <AccordionContent>
280
+ {productInfo().ingredients.length > 0 && productInfo().ingredients.some((ingredient: any) => !ingredient.selected) && (
281
+ <ProductOptionsList>
282
+ <OText size={10} color={theme.colors.textSecondary}>{t('INGREDIENTS', 'Ingredients')}</OText>
283
+ {productInfo().ingredients.map((ingredient: any) => !ingredient.selected && (
284
+ <OText size={10} color={theme.colors.textThird} key={ingredient.id} style={{ marginLeft: 10 }}>{t('NO', 'No')} {ingredient.name}</OText>
285
+ ))}
286
+ </ProductOptionsList>
287
+ )}
288
+ {productInfo().options.length > 0 && (
289
+ <ProductOptionsList>
290
+ {productInfo().options.map((option: any, i: number) => (
291
+ <ProductOption key={option.id + i}>
292
+ <OText size={10} color={theme.colors.textSecondary}>{option.name}</OText>
293
+ {option.suboptions.map((suboption: any) => (
294
+ <ProductSubOption key={suboption.id}>
295
+ <OText size={10} color={theme.colors.textThird}>
296
+ {getFormattedSubOptionName({
297
+ quantity: suboption.quantity,
298
+ name: suboption.name,
299
+ position: (suboption.position !== 'whole') ? t(suboption.position.toUpperCase(), suboption.position) : '',
300
+ price: parsePrice(suboption.price)
301
+ })}
302
+ </OText>
303
+ </ProductSubOption>
304
+ ))}
305
+ </ProductOption>
306
+ ))}
307
+ </ProductOptionsList>
308
+ )}
309
+ {!!product.comment && (
310
+ <ProductComment>
311
+ <OText size={10} color={theme.colors.textSecondary}>{t('SPECIAL_COMMENT', 'Special Comment')}</OText>
312
+ <OText size={10} color={theme.colors.textThird}>{product.comment}</OText>
313
+ </ProductComment>
314
+ )}
315
+ </AccordionContent>
316
+ </Animated.View>
317
+ </View>
318
+ </AccordionSection>
319
+ <OModal
320
+ open={isServiceOpen}
321
+ onClose={() => setIsServiceOpen(false)}
322
+ entireModal
323
+ >
324
+ <ServiceForm
325
+ isCartProduct
326
+ isService
327
+ businessId={product?.business_id}
328
+ categoryId={product?.category_id}
329
+ productId={product?.id}
330
+ productCart={product}
331
+ onSave={() => setIsServiceOpen(false)}
332
+ onClose={() => setIsServiceOpen(false)}
333
+ professionalSelected={product?.calendar_event?.professional}
334
+ />
335
+ </OModal>
336
+ </>
278
337
  )
279
338
  }
280
339
 
@@ -6,6 +6,7 @@ import {
6
6
  } from 'ordering-components/native'
7
7
  import { useTheme } from 'styled-components/native';
8
8
  import { StyleSheet, View } from 'react-native'
9
+ import IconAntDesign from 'react-native-vector-icons/AntDesign';
9
10
 
10
11
  import {
11
12
  Container,
@@ -31,15 +32,18 @@ export const ProductOptionSubOptionUI = (props: any) => {
31
32
  setIsScrollAvailable
32
33
  } = props
33
34
 
34
- const disableIncrement = option?.limit_suboptions_by_max ? balance === option?.max : state.quantity === suboption?.max || (!state.selected && balance === option?.max)
35
+ const disableIncrement = option?.limit_suboptions_by_max ? balance === option?.max || state.quantity === suboption?.max : state.quantity === suboption?.max || (!state.selected && balance === option?.max)
35
36
  const price = option?.with_half_option && suboption?.half_price && state.position !== 'whole' ? suboption?.half_price : suboption?.price
36
-
37
+
37
38
  const theme = useTheme();
38
39
  const [, t] = useLanguage()
39
40
  const [{ parsePrice }] = useUtils()
40
41
  const [showMessage, setShowMessage] = useState(false)
41
42
  const [isDirty, setIsDirty] = useState(false)
42
43
 
44
+ const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
45
+ const iconsSize = isChewLayout ? 20 : 16
46
+
43
47
  const handleSuboptionClick = () => {
44
48
  toggleSelect()
45
49
  setIsDirty(true)
@@ -87,9 +91,9 @@ export const ProductOptionSubOptionUI = (props: any) => {
87
91
  {option?.allow_suboption_quantity && state?.selected && (
88
92
  <>
89
93
  <Checkbox disabled={disabled || state.quantity === 0} onPress={decrement}>
90
- <OIcon
91
- src={theme.images.general.minus}
92
- width={16}
94
+ <IconAntDesign
95
+ name='minuscircleo'
96
+ size={iconsSize}
93
97
  color={state.quantity === 0 || disabled ? theme.colors.disabled : theme.colors.primary}
94
98
  />
95
99
  </Checkbox>
@@ -97,9 +101,9 @@ export const ProductOptionSubOptionUI = (props: any) => {
97
101
  {state.quantity}
98
102
  </OText>
99
103
  <Checkbox disabled={disabled || disableIncrement} onPress={increment}>
100
- <OIcon
101
- src={theme.images.general.plus}
102
- width={16}
104
+ <IconAntDesign
105
+ name='pluscircleo'
106
+ size={iconsSize}
103
107
  color={disableIncrement || disabled ? theme.colors.disabled : theme.colors.primary}
104
108
  />
105
109
  </Checkbox>
@@ -135,12 +139,16 @@ export const ProductOptionSubOptionUI = (props: any) => {
135
139
  )}
136
140
  </PositionControl>
137
141
  {price > 0 && (
138
- <OText size={12} lineHeight={18} color={theme.colors.textSecondary}>
142
+ <OText size={12} lineHeight={18} color={theme.colors.textSecondary} style={{ paddingRight: 10 }}>
139
143
  + {parsePrice(price)}
140
144
  </OText>
141
145
  )}
142
146
  </Container>
143
- {showMessage && <OText size={10} mLeft={4} mRight={4} style={{ flex: 1, textAlign: 'center' }} color={theme.colors.primary}>{`${t('OPTIONS_MAX_LIMIT', 'Maximum options to choose')}: ${option?.max}`}</OText>}
147
+ {showMessage && (
148
+ <OText size={10} mLeft={4} mRight={4} style={{ flex: 1, textAlign: 'center' }} color={theme.colors.primary}>
149
+ {`${t('OPTIONS_MAX_LIMIT', 'Maximum options to choose')}: ${option?.max}`}
150
+ </OText>
151
+ )}
144
152
  </View>
145
153
  )
146
154
  }
@@ -4,12 +4,12 @@ export const Container = styled.TouchableOpacity`
4
4
  flex-direction: row;
5
5
  align-items: center;
6
6
  justify-content: space-between;
7
- padding: 10px;
8
7
  width: 100%;
9
8
  `
10
9
 
11
10
  export const IconControl = styled.TouchableOpacity`
12
11
  flex-direction: row;
12
+ padding: 10px;
13
13
  width: 45%;
14
14
  align-items: center;
15
15
  `
@@ -21,7 +21,6 @@ export const QuantityControl = styled.View`
21
21
  margin-horizontal: 5px;
22
22
  flex: 1;
23
23
  width: 60px;
24
-
25
24
  `
26
25
 
27
26
  export const PositionControl = styled.View`
@@ -0,0 +1,108 @@
1
+ import React from 'react'
2
+ import {
3
+ useSession,
4
+ useUtils,
5
+ SingleProfessionalCard as SingleProfessionalCardController
6
+ } from 'ordering-components/native'
7
+ import { useTheme } from 'styled-components/native'
8
+ import { StyleSheet, TouchableOpacity, View } from 'react-native'
9
+ import FastImage from 'react-native-fast-image'
10
+ import { OIcon, OText } from '../../shared'
11
+ import IconAntDesign from 'react-native-vector-icons/AntDesign';
12
+
13
+ const SingleProfessionalCardUI = (props) => {
14
+ const {
15
+ professional,
16
+ handleFavoriteProfessional,
17
+ active,
18
+ handleProfessionalClick
19
+ } = props
20
+
21
+ const theme = useTheme()
22
+ const [{ auth }] = useSession()
23
+ const [{ optimizeImage }] = useUtils()
24
+
25
+ const handleChangeFavorite = () => {
26
+ if (auth) {
27
+ handleFavoriteProfessional && handleFavoriteProfessional(!professional?.favorite)
28
+ }
29
+ }
30
+
31
+ const styles = StyleSheet.create({
32
+ professionalItem: {
33
+ flexDirection: 'row',
34
+ alignItems: 'center',
35
+ borderRadius: 7.6,
36
+ padding: 11,
37
+ borderWidth: 1,
38
+ marginRight: 12,
39
+ minHeight: 64
40
+ },
41
+ photoStyle: {
42
+ width: 42,
43
+ height: 42,
44
+ borderRadius: 7.6
45
+ },
46
+ favoriteIconStyle: {
47
+ width: 16,
48
+ height: 16,
49
+ },
50
+ })
51
+
52
+ return (
53
+ <TouchableOpacity
54
+ onPress={() => handleProfessionalClick(professional)}
55
+ >
56
+ <View
57
+ style={{
58
+ ...styles.professionalItem,
59
+ borderColor: active
60
+ ? theme.colors.primary
61
+ : theme.colors.border
62
+ }}
63
+ >
64
+ {professional?.photo ? (
65
+ <FastImage
66
+ style={styles.photoStyle}
67
+ source={{
68
+ uri: optimizeImage(professional?.photo, 'h_250,c_limit'),
69
+ priority: FastImage.priority.normal,
70
+ }}
71
+ resizeMode={FastImage.resizeMode.cover}
72
+ />
73
+ ) : (
74
+ <OIcon
75
+ src={theme?.images?.general?.user}
76
+ cover={false}
77
+ style={styles.photoStyle}
78
+ />
79
+ )}
80
+ <View style={{ marginLeft: 12 }}>
81
+ <OText
82
+ size={12}
83
+ weight={'400'}
84
+ >
85
+ {professional?.name} {professional?.lastname}
86
+ </OText>
87
+
88
+ <TouchableOpacity
89
+ onPress={() => handleChangeFavorite()}
90
+ >
91
+ {professional?.favorite
92
+ ? <IconAntDesign name='heart' size={16} color={theme.colors.danger5} />
93
+ : <IconAntDesign name='hearto' size={16} color={theme.colors.danger5} />
94
+ }
95
+ </TouchableOpacity>
96
+ </View>
97
+ </View>
98
+ </TouchableOpacity>
99
+ )
100
+ }
101
+
102
+ export const SingleProfessionalCard = (props) => {
103
+ const singleProfessionalCardProps = {
104
+ ...props,
105
+ UIComponent: SingleProfessionalCardUI
106
+ }
107
+ return <SingleProfessionalCardController {...singleProfessionalCardProps} />
108
+ }