ordering-ui-react-native 0.16.99 → 0.17.0-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 -5
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/ActiveOrders/styles.tsx +8 -14
  4. package/src/components/BusinessInformation/index.tsx +11 -4
  5. package/src/components/BusinessInformation/styles.tsx +2 -2
  6. package/src/components/BusinessProductsList/index.tsx +1 -1
  7. package/src/components/BusinessesListing/index.tsx +1 -1
  8. package/src/components/OrderCreating/index.tsx +1 -21
  9. package/src/components/OrdersOption/index.tsx +54 -56
  10. package/src/components/PaymentOptionsWebView/index.tsx +119 -120
  11. package/src/components/SingleProductReview/index.tsx +7 -4
  12. package/src/components/StripeMethodForm/index.tsx +1 -1
  13. package/src/components/VerifyPhone/styles.tsx +1 -2
  14. package/src/components/shared/OToast.tsx +4 -4
  15. package/src/utils/index.tsx +7 -1
  16. package/themes/business/index.tsx +2 -0
  17. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
  18. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  19. package/themes/business/src/components/BusinessController/index.tsx +0 -1
  20. package/themes/business/src/components/Chat/index.tsx +118 -107
  21. package/themes/business/src/components/DriverMap/index.tsx +22 -9
  22. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  23. package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
  24. package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
  25. package/themes/business/src/components/LoginForm/index.tsx +238 -80
  26. package/themes/business/src/components/LoginForm/styles.tsx +10 -0
  27. package/themes/business/src/components/MapView/index.tsx +18 -7
  28. package/themes/business/src/components/NewOrderNotification/index.tsx +33 -43
  29. package/themes/business/src/components/OrderDetails/Delivery.tsx +4 -3
  30. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +96 -50
  31. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +59 -62
  32. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
  33. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  34. package/themes/business/src/components/OrderMessage/index.tsx +18 -17
  35. package/themes/business/src/components/OrdersOption/index.tsx +33 -75
  36. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
  37. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  38. package/themes/business/src/components/PreviousOrders/index.tsx +445 -243
  39. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  40. package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
  41. package/themes/business/src/components/ReviewCustomer/index.tsx +41 -24
  42. package/themes/business/src/components/StoresList/index.tsx +2 -2
  43. package/themes/business/src/components/shared/OLink.tsx +33 -13
  44. package/themes/business/src/components/shared/OModal.tsx +16 -9
  45. package/themes/business/src/components/shared/OText.tsx +8 -2
  46. package/themes/business/src/types/index.tsx +33 -2
  47. package/themes/business/src/utils/index.tsx +51 -0
  48. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  49. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  50. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  51. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  52. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  53. package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
  54. package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
  55. package/themes/kiosk/src/components/LoginForm/index.tsx +473 -151
  56. package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
  57. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  58. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  59. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  60. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +3 -2
  61. package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
  62. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  63. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  64. package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
  65. package/themes/kiosk/src/layouts/Container.tsx +7 -1
  66. package/themes/kiosk/src/types/index.d.ts +13 -0
  67. package/themes/kiosk/src/utils/index.tsx +15 -0
  68. package/themes/original/index.tsx +8 -0
  69. package/themes/original/src/components/AddressDetails/index.tsx +29 -11
  70. package/themes/original/src/components/AddressForm/index.tsx +152 -117
  71. package/themes/original/src/components/AddressList/index.tsx +26 -21
  72. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  73. package/themes/original/src/components/AnalyticsSegment/index.tsx +189 -9
  74. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  75. package/themes/original/src/components/BusinessBasicInformation/index.tsx +125 -82
  76. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +9 -4
  77. package/themes/original/src/components/BusinessController/index.tsx +145 -68
  78. package/themes/original/src/components/BusinessController/styles.tsx +22 -9
  79. package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
  80. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
  81. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  82. package/themes/original/src/components/BusinessItemAccordion/index.tsx +24 -23
  83. package/themes/original/src/components/BusinessListingSearch/index.tsx +52 -24
  84. package/themes/original/src/components/BusinessPreorder/index.tsx +96 -15
  85. package/themes/original/src/components/BusinessProductsList/index.tsx +20 -11
  86. package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
  87. package/themes/original/src/components/BusinessProductsListing/index.tsx +617 -490
  88. package/themes/original/src/components/BusinessProductsListing/styles.tsx +7 -13
  89. package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
  90. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -3
  91. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  92. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +98 -78
  93. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  94. package/themes/original/src/components/BusinessesListing/index.tsx +5 -3
  95. package/themes/original/src/components/Cart/index.tsx +87 -43
  96. package/themes/original/src/components/CartContent/index.tsx +77 -15
  97. package/themes/original/src/components/CartContent/styles.tsx +11 -1
  98. package/themes/original/src/components/Checkout/index.tsx +294 -175
  99. package/themes/original/src/components/Checkout/styles.tsx +4 -2
  100. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  101. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  102. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  103. package/themes/original/src/components/DriverTips/index.tsx +52 -37
  104. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  105. package/themes/original/src/components/Favorite/index.tsx +7 -4
  106. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  107. package/themes/original/src/components/FavoriteList/index.tsx +70 -80
  108. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  109. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  110. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  111. package/themes/original/src/components/GoogleMap/index.tsx +10 -1
  112. package/themes/original/src/components/Help/index.tsx +8 -8
  113. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +11 -22
  114. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
  115. package/themes/original/src/components/HelpGuide/index.tsx +12 -16
  116. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  117. package/themes/original/src/components/HelpOrder/index.tsx +12 -25
  118. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  119. package/themes/original/src/components/Home/index.tsx +13 -4
  120. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  121. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  122. package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
  123. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  124. package/themes/original/src/components/LoginForm/index.tsx +43 -19
  125. package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
  126. package/themes/original/src/components/MessageListing/index.tsx +16 -42
  127. package/themes/original/src/components/Messages/index.tsx +32 -10
  128. package/themes/original/src/components/MomentOption/index.tsx +195 -88
  129. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  130. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +117 -96
  131. package/themes/original/src/components/MultiCheckout/index.tsx +247 -83
  132. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  133. package/themes/original/src/components/MultiOrdersDetails/index.tsx +67 -20
  134. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  135. package/themes/original/src/components/MyOrders/index.tsx +66 -17
  136. package/themes/original/src/components/NavBar/index.tsx +6 -11
  137. package/themes/original/src/components/NotFoundSource/index.tsx +1 -1
  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 +59 -0
  141. package/themes/original/src/components/OrderDetails/index.tsx +110 -221
  142. package/themes/original/src/components/OrderDetails/styles.tsx +10 -1
  143. package/themes/original/src/components/OrderItAgain/index.tsx +47 -43
  144. package/themes/original/src/components/OrderProgress/index.tsx +74 -112
  145. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  146. package/themes/original/src/components/OrderSummary/index.tsx +66 -29
  147. package/themes/original/src/components/OrderTypeSelector/index.tsx +4 -3
  148. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +28 -19
  149. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  150. package/themes/original/src/components/OrdersOption/index.tsx +76 -83
  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 +2 -2
  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 +240 -261
  160. package/themes/original/src/components/ProductForm/styles.tsx +4 -7
  161. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  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 -49
  166. package/themes/original/src/components/ProfessionalProfile/index.tsx +54 -14
  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 +43 -11
  171. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  172. package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
  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 +377 -270
  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 +79 -66
  181. package/themes/original/src/components/SingleOrderCard/index.tsx +126 -57
  182. package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
  183. package/themes/original/src/components/SingleProductCard/index.tsx +111 -49
  184. package/themes/original/src/components/SingleProductCard/styles.tsx +27 -13
  185. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  186. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  187. package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
  188. package/themes/original/src/components/StripeElementsForm/index.tsx +4 -1
  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 +58 -35
  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 +20 -19
  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 +45 -7
  208. package/themes/original/src/utils/index.tsx +364 -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,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 || 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
- {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', height: 20 }}>
240
+ {onEditProduct && isCartProduct && !isCartPending && product?.valid_menu && (
241
+ <TouchableOpacity onPress={() => handleEditProduct(product)} style={{ marginRight: 5 }}>
242
+ <MaterialCommunityIcon
243
+ name='pencil-outline'
244
+ size={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
+ <MaterialCommunityIcon
256
+ name='trash-can-outline'
257
+ size={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
 
@@ -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
+ }