ordering-ui-react-native 0.16.39 → 0.16.40-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 (202) hide show
  1. package/package.json +7 -5
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/ActiveOrders/index.tsx +61 -63
  4. package/src/components/ActiveOrders/styles.tsx +8 -14
  5. package/src/components/BusinessBasicInformation/index.tsx +11 -19
  6. package/src/components/BusinessInformation/index.tsx +33 -4
  7. package/src/components/BusinessInformation/styles.tsx +2 -2
  8. package/src/components/BusinessProductsList/index.tsx +10 -10
  9. package/src/components/BusinessesListing/index.tsx +1 -1
  10. package/src/components/Checkout/index.tsx +2 -1
  11. package/src/components/LanguageSelector/index.tsx +21 -16
  12. package/src/components/LoginForm/index.tsx +15 -0
  13. package/src/components/Messages/index.tsx +2 -2
  14. package/src/components/NotificationSetting/index.tsx +85 -0
  15. package/src/components/OrdersOption/index.tsx +54 -56
  16. package/src/components/PaymentOptions/index.tsx +298 -345
  17. package/src/components/PaymentOptionsWebView/index.tsx +120 -121
  18. package/src/components/ReviewDriver/index.tsx +1 -1
  19. package/src/components/ReviewOrder/index.tsx +1 -1
  20. package/src/components/ReviewProducts/index.tsx +11 -0
  21. package/src/components/SignupForm/index.tsx +15 -0
  22. package/src/components/SingleProductReview/index.tsx +8 -5
  23. package/src/components/StripeElementsForm/index.tsx +25 -16
  24. package/src/components/VerifyPhone/styles.tsx +1 -2
  25. package/src/components/shared/OBottomPopup.tsx +6 -2
  26. package/src/index.tsx +2 -0
  27. package/src/pages/BusinessesListing.tsx +7 -6
  28. package/src/pages/OrderDetails.tsx +1 -1
  29. package/src/pages/ReviewDriver.tsx +2 -2
  30. package/src/pages/ReviewOrder.tsx +2 -2
  31. package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
  32. package/src/utils/index.tsx +2 -1
  33. package/themes/business/src/components/BusinessController/index.tsx +2 -2
  34. package/themes/business/src/components/Chat/index.tsx +38 -30
  35. package/themes/business/src/components/DriverMap/index.tsx +7 -5
  36. package/themes/business/src/components/DriverSchedule/index.tsx +36 -19
  37. package/themes/business/src/components/LoginForm/index.tsx +111 -74
  38. package/themes/business/src/components/MapView/index.tsx +12 -1
  39. package/themes/business/src/components/MessagesOption/index.tsx +11 -1
  40. package/themes/business/src/components/NewOrderNotification/index.tsx +26 -41
  41. package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
  42. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +25 -19
  43. package/themes/business/src/components/OrdersListManager/index.tsx +10 -3
  44. package/themes/business/src/components/OrdersOption/index.tsx +65 -21
  45. package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
  46. package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
  47. package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
  48. package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
  49. package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
  50. package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
  51. package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
  52. package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
  53. package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
  54. package/themes/business/src/components/PreviousOrders/index.tsx +22 -24
  55. package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
  56. package/themes/business/src/components/ReviewCustomer/index.tsx +27 -13
  57. package/themes/business/src/components/ScheduleBlocked/index.tsx +2 -2
  58. package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
  59. package/themes/business/src/components/UserProfileForm/index.tsx +2 -0
  60. package/themes/business/src/components/shared/ODropDown.tsx +42 -8
  61. package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
  62. package/themes/business/src/types/index.tsx +15 -9
  63. package/themes/business/src/utils/index.tsx +10 -0
  64. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  65. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  66. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  67. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  68. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  69. package/themes/kiosk/src/components/LoginForm/index.tsx +121 -10
  70. package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
  71. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  72. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  73. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  74. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  75. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  76. package/themes/kiosk/src/types/index.d.ts +2 -0
  77. package/themes/original/index.tsx +4 -0
  78. package/themes/original/src/components/AddressDetails/index.tsx +10 -8
  79. package/themes/original/src/components/AddressForm/index.tsx +157 -140
  80. package/themes/original/src/components/AddressList/index.tsx +1 -1
  81. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  82. package/themes/original/src/components/BusinessBasicInformation/index.tsx +260 -176
  83. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +2 -2
  84. package/themes/original/src/components/BusinessController/index.tsx +216 -113
  85. package/themes/original/src/components/BusinessController/styles.tsx +1 -8
  86. package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
  87. package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
  88. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
  89. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
  90. package/themes/original/src/components/BusinessListingSearch/index.tsx +109 -139
  91. package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
  92. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
  93. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
  94. package/themes/original/src/components/BusinessProductsList/index.tsx +59 -60
  95. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  96. package/themes/original/src/components/BusinessProductsListing/index.tsx +179 -104
  97. package/themes/original/src/components/BusinessProductsListing/styles.tsx +18 -11
  98. package/themes/original/src/components/BusinessReviews/index.tsx +6 -1
  99. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
  100. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +37 -25
  101. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -4
  102. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +260 -109
  103. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +47 -10
  104. package/themes/original/src/components/BusinessesListing/index.tsx +95 -7
  105. package/themes/original/src/components/Cart/index.tsx +54 -16
  106. package/themes/original/src/components/Cart/styles.tsx +4 -0
  107. package/themes/original/src/components/CartContent/index.tsx +22 -16
  108. package/themes/original/src/components/Checkout/index.tsx +110 -116
  109. package/themes/original/src/components/Checkout/styles.tsx +4 -3
  110. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  111. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  112. package/themes/original/src/components/DriverTips/index.tsx +4 -4
  113. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  114. package/themes/original/src/components/FavoriteList/index.tsx +19 -0
  115. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  116. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  117. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  118. package/themes/original/src/components/GoogleMap/index.tsx +20 -12
  119. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +25 -10
  120. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +4 -0
  121. package/themes/original/src/components/HelpGuide/index.tsx +9 -8
  122. package/themes/original/src/components/HelpOrder/index.tsx +9 -8
  123. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  124. package/themes/original/src/components/LoginForm/Otp/index.tsx +95 -73
  125. package/themes/original/src/components/LoginForm/index.tsx +98 -41
  126. package/themes/original/src/components/LottieAnimation/index.tsx +69 -0
  127. package/themes/original/src/components/Messages/index.tsx +17 -17
  128. package/themes/original/src/components/MomentOption/index.tsx +8 -6
  129. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -92
  130. package/themes/original/src/components/MultiCheckout/index.tsx +6 -0
  131. package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -16
  132. package/themes/original/src/components/MyOrders/index.tsx +88 -22
  133. package/themes/original/src/components/NavBar/index.tsx +15 -9
  134. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  135. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  136. package/themes/original/src/components/Notifications/index.tsx +148 -0
  137. package/themes/original/src/components/Notifications/styles.tsx +17 -0
  138. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +167 -0
  139. package/themes/original/src/components/OrderDetails/index.tsx +200 -37
  140. package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
  141. package/themes/original/src/components/OrderItAgain/index.tsx +75 -0
  142. package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
  143. package/themes/original/src/components/OrderProgress/index.tsx +77 -66
  144. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  145. package/themes/original/src/components/OrderSummary/index.tsx +3 -36
  146. package/themes/original/src/components/OrderTypeSelector/index.tsx +85 -36
  147. package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
  148. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +97 -106
  149. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  150. package/themes/original/src/components/OrdersOption/index.tsx +71 -55
  151. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  152. package/themes/original/src/components/PaymentOptions/index.tsx +1 -2
  153. package/themes/original/src/components/PhoneInputNumber/index.tsx +5 -11
  154. package/themes/original/src/components/PlaceSpot/index.tsx +243 -47
  155. package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
  156. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  157. package/themes/original/src/components/ProductForm/index.tsx +639 -664
  158. package/themes/original/src/components/ProductForm/styles.tsx +10 -11
  159. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  160. package/themes/original/src/components/ProductOption/index.tsx +1 -1
  161. package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
  162. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +0 -1
  163. package/themes/original/src/components/ProfessionalFilter/index.tsx +2 -1
  164. package/themes/original/src/components/ProfessionalProfile/index.tsx +26 -14
  165. package/themes/original/src/components/Promotions/index.tsx +232 -219
  166. package/themes/original/src/components/Promotions/styles.tsx +7 -2
  167. package/themes/original/src/components/ReviewDriver/index.tsx +7 -7
  168. package/themes/original/src/components/ReviewOrder/index.tsx +18 -3
  169. package/themes/original/src/components/ReviewProducts/index.tsx +2 -2
  170. package/themes/original/src/components/ReviewTrigger/index.tsx +118 -0
  171. package/themes/original/src/components/ReviewTrigger/styles.tsx +34 -0
  172. package/themes/original/src/components/SearchBar/index.tsx +5 -3
  173. package/themes/original/src/components/ServiceForm/index.tsx +410 -258
  174. package/themes/original/src/components/SignupForm/index.tsx +184 -127
  175. package/themes/original/src/components/SingleOrderCard/index.tsx +229 -181
  176. package/themes/original/src/components/SingleOrderCard/styles.tsx +0 -7
  177. package/themes/original/src/components/SingleProductCard/index.tsx +198 -112
  178. package/themes/original/src/components/SingleProductCard/styles.tsx +3 -10
  179. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  180. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  181. package/themes/original/src/components/StripeElementsForm/index.tsx +18 -7
  182. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -5
  183. package/themes/original/src/components/UserDetails/index.tsx +5 -3
  184. package/themes/original/src/components/UserFormDetails/index.tsx +6 -48
  185. package/themes/original/src/components/UserProfile/index.tsx +56 -31
  186. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  187. package/themes/original/src/components/UserProfileForm/index.tsx +10 -10
  188. package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
  189. package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
  190. package/themes/original/src/components/Wallets/index.tsx +176 -164
  191. package/themes/original/src/components/Wallets/styles.tsx +12 -8
  192. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  193. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  194. package/themes/original/src/components/shared/OBottomPopup.tsx +48 -15
  195. package/themes/original/src/components/shared/OButton.tsx +10 -3
  196. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  197. package/themes/original/src/components/shared/OInput.tsx +13 -3
  198. package/themes/original/src/layouts/Container.tsx +13 -9
  199. package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
  200. package/themes/original/src/types/index.tsx +82 -29
  201. package/themes/original/src/utils/index.tsx +121 -10
  202. 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
-
50
+ padding: 0 40px;
53
51
  `
54
52
 
55
53
  export const SectionTitle = styled.View`
@@ -65,26 +63,23 @@ export const WrapperSubOption = styled.View`
65
63
  `
66
64
 
67
65
  export const ProductComment = styled.View`
68
- padding-bottom: 50px;
66
+ padding-bottom: ${(props: any) => props.pb || 60}px;
69
67
  `
70
68
 
71
69
  export const ProductActions = styled.View`
72
70
  position: absolute;
73
71
  bottom: 0px;
74
- min-height: 70px;
75
72
  padding-top: ${(props: any) => props.ios ? '20px' : '0'};
76
73
  padding-horizontal: 40px;
74
+ padding-vertical: 20px;
77
75
  width: 100%;
78
- flex-direction: row;
76
+ flex-direction: ${(props: any) => props.isColumn ? 'column' : 'row'};
79
77
  background-color: #FFF;
80
78
  z-index: 1000;
81
- align-items: center;
82
- justify-content: space-between;
83
79
  border-top-width: 1px;
84
80
  border-top-color: ${(props: any) => props.theme.colors.border};
85
81
  `
86
82
  export const ExtraOptionWrap = styled.ScrollView`
87
- margin-horizontal: -40px;
88
83
  `;
89
84
 
90
85
  export const WeightUnitSwitch = styled.View`
@@ -99,4 +94,8 @@ export const WeightUnitItem = styled.View`
99
94
  `}
100
95
  `
101
96
  export const ProductSummary = styled.View`
97
+ padding: 26px 40px 0;
98
+ position: relative;
99
+ background-color: white;
100
+ z-index: 100;
102
101
  `
@@ -4,6 +4,8 @@ import { useUtils, useLanguage, useOrder } from 'ordering-components/native'
4
4
  import { useTheme } from 'styled-components/native';
5
5
  import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons'
6
6
  import RNPickerSelect from 'react-native-picker-select'
7
+ import { ServiceForm } from '../ServiceForm';
8
+ import FastImage from 'react-native-fast-image'
7
9
 
8
10
  import {
9
11
  Accordion,
@@ -18,7 +20,7 @@ import {
18
20
  ProductSubOption,
19
21
  ProductComment
20
22
  } from './styles'
21
- import { OIcon, OText, OAlert } from '../shared'
23
+ import { OIcon, OText, OAlert, OModal } from '../shared'
22
24
 
23
25
  import { ProductItemAccordionParams } from '../../types'
24
26
 
@@ -68,9 +70,10 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
68
70
 
69
71
  const [, t] = useLanguage()
70
72
  const [orderState] = useOrder()
71
- const [{ parsePrice, optimizeImage }] = useUtils()
73
+ const [{ parsePrice, optimizeImage, parseDate }] = useUtils()
72
74
 
73
75
  const [isActive, setActiveState] = useState(false)
76
+ const [isServiceOpen, setIsServiceOpen] = useState(false)
74
77
  // const [setHeight, setHeightState] = useState({ height: new Animated.Value(0) })
75
78
  // const [setRotate, setRotateState] = useState({ angle: new Animated.Value(0) })
76
79
 
@@ -92,6 +95,14 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
92
95
  return product
93
96
  }
94
97
 
98
+ const handleEditProduct = (curProduct: any) => {
99
+ if (!curProduct?.calendar_event) {
100
+ onEditProduct && onEditProduct(curProduct)
101
+ return
102
+ }
103
+ setIsServiceOpen(true)
104
+ }
105
+
95
106
  /* const toggleAccordion = () => {
96
107
  if ((!product?.valid_menu && isCartProduct)) return
97
108
  if (isActive) {
@@ -133,135 +144,195 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
133
144
  })
134
145
 
135
146
  return (
136
- <AccordionSection>
137
- <Accordion
138
- isValid={product?.valid ?? true}
139
- onPress={() => (!product?.valid_menu && isCartProduct)
140
- ? {}
141
- : setActiveState(!isActive)}
142
- activeOpacity={1}
143
- >
144
- <View style={{ flexDirection: 'row', alignItems: 'flex-start' }}>
145
- <ContentInfo>
146
- {product?.images && (
147
- <ProductImage>
148
- {isFromCheckout ? (
149
- <OIcon url={optimizeImage(product?.images, 'h_100,c_limit')} style={{ ...styles.productImage, ...{ width: 82, height: 82 } }} />
150
- ) : (
151
- <OIcon url={optimizeImage(product?.images, 'h_100,c_limit')} style={styles.productImage} />
152
- )}
153
- </ProductImage>
154
- )}
155
- {isCartProduct && !isCartPending && getProductMax && (
156
- <ProductInfo>
157
- <RNPickerSelect
158
- items={productOptions}
159
- onValueChange={handleChangeQuantity}
160
- value={product.quantity.toString()}
161
- style={pickerStyle}
162
- useNativeAndroidPickerStyle={false}
163
- placeholder={{}}
164
- Icon={() => <View style={pickerStyle.icon}><OIcon src={theme.images.general.arrow_down} color={theme.colors.textNormal} width={8} /></View>}
165
- disabled={orderState.loading}
166
- />
167
- </ProductInfo>
168
- )}
169
- {isFromCheckout && (
170
- <ProductQuantity>
171
- <OText size={12} lineHeight={18}>
172
- {product?.quantity}
173
- </OText>
174
- </ProductQuantity>
175
- )}
176
- <View style={{ flex: 1 }}>
177
- <OText size={12} lineHeight={18} weight={'400'}>{product.name}</OText>
178
- </View>
179
- <View style={{ display: 'flex', flexDirection: 'column', flex: 1, alignItems: 'flex-end' }}>
180
- <View style={{ flexDirection: 'row' }}>
181
- <OText size={12} lineHeight={18} weight={'400'}>{parsePrice(product.total || product.price)}</OText>
182
- {(productInfo().ingredients.length > 0 || productInfo().options.length > 0 || product.comment) && (
183
- <MaterialCommunityIcon name='chevron-down' size={18} />
184
- )}
147
+ <>
148
+ <AccordionSection>
149
+ <Accordion
150
+ isValid={product?.valid ?? true}
151
+ onPress={() => (!product?.valid_menu && isCartProduct)
152
+ ? {}
153
+ : setActiveState(!isActive)}
154
+ activeOpacity={1}
155
+ >
156
+ <View style={{ flexDirection: 'row', alignItems: 'flex-start' }}>
157
+ <ContentInfo>
158
+ {(product?.images || theme?.images?.dummies?.product) && (
159
+ <ProductImage>
160
+ {isFromCheckout ? (
161
+ product?.images ? (
162
+ <FastImage
163
+ style={{ ...styles.productImage, ...{ width: 82, height: 82 } }}
164
+ source={{
165
+ uri: optimizeImage(product?.images, 'h_100,c_limit'),
166
+ priority: FastImage.priority.normal,
167
+ }}
168
+ resizeMode={FastImage.resizeMode.cover}
169
+ />
170
+ ) : (
171
+ <OIcon
172
+ src={theme?.images?.dummies?.product}
173
+ style={{ ...styles.productImage, ...{ width: 82, height: 82 } }}
174
+ />
175
+ )
176
+ ) : (
177
+ product?.images ? (
178
+ <FastImage
179
+ style={styles.productImage}
180
+ source={{
181
+ uri: optimizeImage(product?.images, 'h_100,c_limit'),
182
+ priority: FastImage.priority.normal,
183
+ }}
184
+ resizeMode={FastImage.resizeMode.cover}
185
+ />
186
+ ) : (
187
+ <OIcon
188
+ src={theme?.images?.dummies?.product}
189
+ style={styles.productImage}
190
+ />
191
+ )
192
+ )}
193
+ </ProductImage>
194
+ )}
195
+ {!!product?.calendar_event ? (
196
+ <View style={{ flex: 1, marginLeft: 10, flexDirection: 'column' }}>
197
+ <View>
198
+ <OText size={12} lineHeight={18} weight={'400'} numberOfLines={1}>{product?.name}</OText>
199
+ </View>
200
+ <OText size={10} color={theme.colors.textSecondary} style={{ marginTop: 3 }}>
201
+ {parseDate(product?.calendar_event?.start, { outputFormat: 'hh:mm a' })} - {parseDate(product?.calendar_event?.end, { outputFormat: 'hh:mm a' })}
202
+ </OText>
203
+ </View>
204
+ ) : (
205
+ <>
206
+ {isCartProduct && !isCartPending && getProductMax && (
207
+ <ProductInfo>
208
+ <RNPickerSelect
209
+ items={productOptions}
210
+ onValueChange={handleChangeQuantity}
211
+ value={product.quantity.toString()}
212
+ style={pickerStyle}
213
+ useNativeAndroidPickerStyle={false}
214
+ placeholder={{}}
215
+ Icon={() => <View style={pickerStyle.icon}><OIcon src={theme.images.general.arrow_down} color={theme.colors.textNormal} width={8} /></View>}
216
+ disabled={orderState.loading}
217
+ />
218
+ </ProductInfo>
219
+ )}
220
+ {isFromCheckout && (
221
+ <ProductQuantity>
222
+ <OText size={12} lineHeight={18}>
223
+ {product?.quantity}
224
+ </OText>
225
+ </ProductQuantity>
226
+ )}
227
+ <View style={{ flex: 1 }}>
228
+ <OText size={12} lineHeight={18} weight={'400'}>{product.name}</OText>
229
+ </View>
230
+ </>
231
+ )}
232
+ <View style={{ display: 'flex', flexDirection: 'column', flex: 1, alignItems: 'flex-end', maxWidth: 100 }}>
233
+ <View style={{ flexDirection: 'row' }}>
234
+ <OText size={12} lineHeight={18} weight={'400'}>{parsePrice(product.total || product.price)}</OText>
235
+ {(productInfo().ingredients.length > 0 || productInfo().options.length > 0 || product.comment) && (
236
+ <MaterialCommunityIcon name='chevron-down' size={18} />
237
+ )}
238
+ </View>
239
+ <View style={{ display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', 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
 
@@ -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}
@@ -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,
@@ -33,13 +34,16 @@ export const ProductOptionSubOptionUI = (props: any) => {
33
34
 
34
35
  const disableIncrement = option?.limit_suboptions_by_max ? balance === option?.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?.business_view?.components?.header?.components?.layout?.type === '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>
@@ -140,7 +144,11 @@ export const ProductOptionSubOptionUI = (props: any) => {
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
  }
@@ -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`
@@ -97,7 +97,8 @@ export const ProfessionalFilter = (props: ProfessionalFilterParams) => {
97
97
  />
98
98
  ) : (
99
99
  <OIcon
100
- src={theme?.images?.dummies?.product}
100
+ src={theme?.images?.general?.user}
101
+ cover={false}
101
102
  style={styles.photoStyle}
102
103
  />
103
104
  )}
@@ -6,7 +6,7 @@ import CalendarPicker from 'react-native-calendar-picker'
6
6
  import FeatherIcon from 'react-native-vector-icons/Feather';
7
7
  import moment from 'moment'
8
8
  import SelectDropdown from 'react-native-select-dropdown'
9
- import { OButton, OText } from '../shared'
9
+ import { OButton, OText, OIcon } from '../shared'
10
10
  import IconAntDesign from 'react-native-vector-icons/AntDesign'
11
11
  import { useSafeAreaInsets } from 'react-native-safe-area-context'
12
12
  import { ProfessionalProfileParams } from '../../types'
@@ -58,11 +58,14 @@ export const ProfessionalProfile = (props: ProfessionalProfileParams) => {
58
58
  height: 40,
59
59
  marginBottom: 30
60
60
  },
61
+ photoStyle: {
62
+ alignSelf: 'center'
63
+ }
61
64
  })
62
65
 
63
66
  const onDateChange = (date: any) => {
64
67
  setSelectedDate(date)
65
- dropdownRef.current.reset()
68
+ dropdownRef?.current && dropdownRef.current.reset()
66
69
  }
67
70
 
68
71
  const dropDownIcon = () => {
@@ -151,13 +154,21 @@ export const ProfessionalProfile = (props: ProfessionalProfileParams) => {
151
154
 
152
155
  return (
153
156
  <Container>
154
- <ProfessionalPhoto
155
- source={{
156
- uri:
157
- professional?.photo ||
158
- optimizeImage(theme.images.general.user, 'h_250,c_limit'),
159
- }}
160
- />
157
+ {!!professional?.photo ? (
158
+ <ProfessionalPhoto
159
+ source={{
160
+ uri: professional?.photo
161
+ }}
162
+ />
163
+ ) : (
164
+ <OIcon
165
+ src={theme.images.general.user}
166
+ style={styles.photoStyle}
167
+ cover={false}
168
+ width={200}
169
+ height={200}
170
+ />
171
+ )}
161
172
  <InfoWrapper>
162
173
  <OText
163
174
  size={20}
@@ -191,9 +202,9 @@ export const ProfessionalProfile = (props: ProfessionalProfileParams) => {
191
202
  {t('REQUIRED', 'Required')}
192
203
  </OText>
193
204
  </View>
194
- {(!!professional?.schedule && isEnabled) ? (
205
+ {!!professional?.schedule ? (
195
206
  <CalendarWrapper>
196
- {timeList?.length > 0 ? (
207
+ {(timeList?.length > 0 && isEnabled) ? (
197
208
  <SelectDropdown
198
209
  ref={dropdownRef}
199
210
  data={timeList}
@@ -237,11 +248,12 @@ export const ProfessionalProfile = (props: ProfessionalProfileParams) => {
237
248
  />
238
249
  ) : (
239
250
  <OText
240
- size={20}
251
+ size={12}
241
252
  style={{ marginBottom: 30 }}
242
- weight={Platform.OS === 'ios' ? '600' : 'bold'}
253
+ weight={'400'}
254
+ color={theme.colors?.danger5}
243
255
  >
244
- {t('NOT_AVAILABLE', 'Not available')}
256
+ {t('PROFESSIONAL_NOT_AVAILABLE', 'Professional is not available at the moment')}
245
257
  </OText>
246
258
  )}
247
259