ordering-ui-react-native 0.21.7 → 0.21.8-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 (239) hide show
  1. package/package.json +6 -5
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessInformation/index.tsx +10 -9
  4. package/src/components/BusinessesListing/index.tsx +1 -1
  5. package/src/components/PaymentOptionsWebView/index.tsx +1 -0
  6. package/src/components/StripeMethodForm/index.tsx +4 -4
  7. package/src/components/VerifyPhone/styles.tsx +1 -2
  8. package/src/components/shared/OToast.tsx +3 -2
  9. package/src/types/index.tsx +2 -1
  10. package/src/utils/index.tsx +2 -2
  11. package/themes/business/index.tsx +4 -0
  12. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -2
  13. package/themes/business/src/components/BusinessController/index.tsx +19 -17
  14. package/themes/business/src/components/BusinessProductList/AccordionDropdown.tsx +63 -0
  15. package/themes/business/src/components/BusinessProductList/IterateCategories.tsx +108 -0
  16. package/themes/business/src/components/BusinessProductList/ProductList.tsx +196 -0
  17. package/themes/business/src/components/BusinessProductList/index.tsx +196 -0
  18. package/themes/business/src/components/BusinessProductList/styles.tsx +10 -0
  19. package/themes/business/src/components/Chat/index.tsx +41 -13
  20. package/themes/business/src/components/DriverMap/index.tsx +4 -2
  21. package/themes/business/src/components/DriverSchedule/index.tsx +5 -5
  22. package/themes/business/src/components/FloatingButton/index.tsx +34 -31
  23. package/themes/business/src/components/Home/index.tsx +5 -1
  24. package/themes/business/src/components/MapView/index.tsx +11 -7
  25. package/themes/business/src/components/MessagesOption/index.tsx +22 -94
  26. package/themes/business/src/components/NewOrderNotification/index.tsx +161 -106
  27. package/themes/business/src/components/OrderDetails/Business.tsx +47 -1
  28. package/themes/business/src/components/OrderDetails/Delivery.tsx +21 -11
  29. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +56 -50
  30. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +54 -23
  31. package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
  32. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +6 -1
  33. package/themes/business/src/components/OrderSummary/index.tsx +240 -76
  34. package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
  35. package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
  36. package/themes/business/src/components/OrdersOption/index.tsx +125 -48
  37. package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
  38. package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
  39. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +27 -35
  40. package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
  41. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
  42. package/themes/business/src/components/PreviousOrders/index.tsx +192 -220
  43. package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
  44. package/themes/business/src/components/PrinterSettings/index.tsx +279 -0
  45. package/themes/business/src/components/PrinterSettings/styles.tsx +17 -0
  46. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  47. package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
  48. package/themes/business/src/components/SearchBar/index.tsx +2 -1
  49. package/themes/business/src/components/Sessions/index.tsx +187 -0
  50. package/themes/business/src/components/Sessions/styles.tsx +20 -0
  51. package/themes/business/src/components/StoresList/index.tsx +5 -3
  52. package/themes/business/src/components/UserProfileForm/index.tsx +98 -44
  53. package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
  54. package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
  55. package/themes/business/src/components/shared/OInput.tsx +2 -0
  56. package/themes/business/src/hooks/useLocation.tsx +5 -4
  57. package/themes/business/src/types/index.tsx +21 -1
  58. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  59. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  60. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  61. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  62. package/themes/kiosk/src/components/LoginForm/index.tsx +124 -96
  63. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  64. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  65. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  66. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  67. package/themes/original/index.tsx +9 -4
  68. package/themes/original/src/components/AddressDetails/index.tsx +20 -10
  69. package/themes/original/src/components/AddressForm/index.tsx +2 -2
  70. package/themes/original/src/components/AddressForm/styles.tsx +1 -1
  71. package/themes/original/src/components/AddressList/index.tsx +4 -7
  72. package/themes/original/src/components/AddressList/styles.tsx +4 -4
  73. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  74. package/themes/original/src/components/BusinessBasicInformation/index.tsx +4 -4
  75. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
  76. package/themes/original/src/components/BusinessController/index.tsx +18 -10
  77. package/themes/original/src/components/BusinessController/styles.tsx +8 -7
  78. package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
  79. package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
  80. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
  81. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
  82. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
  83. package/themes/original/src/components/BusinessListingSearch/index.tsx +56 -361
  84. package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
  85. package/themes/original/src/components/BusinessPreorder/index.tsx +2 -3
  86. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
  87. package/themes/original/src/components/BusinessProductsList/index.tsx +3 -3
  88. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  89. package/themes/original/src/components/BusinessProductsListing/index.tsx +43 -20
  90. package/themes/original/src/components/BusinessProductsListing/styles.tsx +3 -4
  91. package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
  92. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  93. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
  94. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
  95. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
  96. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
  97. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +30 -404
  98. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  99. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  100. package/themes/original/src/components/Cart/index.tsx +32 -9
  101. package/themes/original/src/components/CartContent/index.tsx +96 -58
  102. package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
  103. package/themes/original/src/components/Checkout/index.tsx +190 -66
  104. package/themes/original/src/components/Checkout/styles.tsx +17 -0
  105. package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
  106. package/themes/original/src/components/DatePicker/index.tsx +17 -0
  107. package/themes/original/src/components/DatePicker/styles.tsx +20 -0
  108. package/themes/original/src/components/Favorite/index.tsx +4 -9
  109. package/themes/original/src/components/Favorite/styles.tsx +0 -2
  110. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  111. package/themes/original/src/components/GPSButton/index.tsx +1 -1
  112. package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
  113. package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
  114. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
  115. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
  116. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
  117. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +67 -4
  118. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
  119. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
  120. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
  121. package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
  122. package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
  123. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +83 -0
  124. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
  125. package/themes/original/src/components/GoogleMap/index.tsx +6 -5
  126. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +2 -2
  127. package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
  128. package/themes/original/src/components/Home/index.tsx +1 -1
  129. package/themes/original/src/components/LastOrder/index.tsx +2 -1
  130. package/themes/original/src/components/LastOrders/index.tsx +2 -1
  131. package/themes/original/src/components/LoginForm/Otp/index.tsx +53 -47
  132. package/themes/original/src/components/LoginForm/index.tsx +6 -1
  133. package/themes/original/src/components/Messages/index.tsx +9 -4
  134. package/themes/original/src/components/Messages/styles.tsx +1 -1
  135. package/themes/original/src/components/MomentOption/index.tsx +3 -3
  136. package/themes/original/src/components/MultiCart/index.tsx +1 -1
  137. package/themes/original/src/components/MultiCheckout/index.tsx +251 -53
  138. package/themes/original/src/components/MultiCheckout/styles.tsx +17 -0
  139. package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -15
  140. package/themes/original/src/components/MyOrders/index.tsx +24 -29
  141. package/themes/original/src/components/NavBar/index.tsx +3 -1
  142. package/themes/original/src/components/NetworkError/index.tsx +2 -3
  143. package/themes/original/src/components/NetworkError/styles.tsx +2 -2
  144. package/themes/original/src/components/Notifications/index.tsx +4 -8
  145. package/themes/original/src/components/Notifications/styles.tsx +0 -1
  146. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +7 -3
  147. package/themes/original/src/components/OrderDetails/index.tsx +716 -667
  148. package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
  149. package/themes/original/src/components/OrderProgress/index.tsx +28 -9
  150. package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
  151. package/themes/original/src/components/OrderSummary/index.tsx +3 -1
  152. package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -6
  153. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
  154. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
  155. package/themes/original/src/components/OrdersOption/index.tsx +3 -5
  156. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  157. package/themes/original/src/components/PageBanner/index.tsx +3 -0
  158. package/themes/original/src/components/PaymentOptionCard/index.tsx +4 -2
  159. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
  160. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  161. package/themes/original/src/components/PaymentOptions/index.tsx +72 -6
  162. package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -1
  163. package/themes/original/src/components/ProductForm/ActionButton.tsx +120 -0
  164. package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
  165. package/themes/original/src/components/ProductForm/index.tsx +75 -166
  166. package/themes/original/src/components/ProductItemAccordion/index.tsx +13 -9
  167. package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -1
  168. package/themes/original/src/components/ProductOptionSubOption/index.tsx +123 -82
  169. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +6 -1
  170. package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
  171. package/themes/original/src/components/Promotions/index.tsx +4 -4
  172. package/themes/original/src/components/Promotions/styles.tsx +0 -2
  173. package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
  174. package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
  175. package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
  176. package/themes/original/src/components/ServiceForm/index.tsx +2 -2
  177. package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
  178. package/themes/original/src/components/SingleOrderCard/index.tsx +5 -4
  179. package/themes/original/src/components/SingleProductCard/index.tsx +2 -2
  180. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
  181. package/themes/original/src/components/StripeCardsList/index.tsx +17 -36
  182. package/themes/original/src/components/StripeElementsForm/index.tsx +9 -4
  183. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
  184. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +86 -0
  185. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
  186. package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
  187. package/themes/original/src/components/UserFormDetails/index.tsx +53 -7
  188. package/themes/original/src/components/UserProfile/index.tsx +3 -2
  189. package/themes/original/src/components/UserProfileForm/index.tsx +30 -36
  190. package/themes/original/src/components/UserVerification/index.tsx +55 -50
  191. package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
  192. package/themes/original/src/components/Wallets/index.tsx +8 -9
  193. package/themes/original/src/components/Wallets/styles.tsx +1 -1
  194. package/themes/original/src/components/WebsocketStatus/index.tsx +172 -0
  195. package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
  196. package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
  197. package/themes/original/src/components/shared/OButton.tsx +5 -5
  198. package/themes/original/src/components/shared/OInput.tsx +1 -4
  199. package/themes/original/src/components/shared/OModal.tsx +12 -14
  200. package/themes/original/src/layouts/Container.tsx +5 -3
  201. package/themes/original/src/types/index.tsx +6 -1
  202. package/themes/original/src/utils/index.tsx +124 -0
  203. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  204. package/src/navigators/BottomNavigator.tsx +0 -117
  205. package/src/navigators/CheckoutNavigator.tsx +0 -66
  206. package/src/navigators/HomeNavigator.tsx +0 -202
  207. package/src/navigators/NavigationRef.tsx +0 -7
  208. package/src/navigators/RootNavigator.tsx +0 -269
  209. package/src/pages/Account.tsx +0 -34
  210. package/src/pages/AddressForm.tsx +0 -62
  211. package/src/pages/AddressList.tsx +0 -24
  212. package/src/pages/BusinessProductsList.tsx +0 -81
  213. package/src/pages/BusinessesListing.tsx +0 -43
  214. package/src/pages/CartList.tsx +0 -49
  215. package/src/pages/Checkout.tsx +0 -101
  216. package/src/pages/ForgotPassword.tsx +0 -24
  217. package/src/pages/Help.tsx +0 -23
  218. package/src/pages/HelpAccountAndPayment.tsx +0 -23
  219. package/src/pages/HelpGuide.tsx +0 -23
  220. package/src/pages/HelpOrder.tsx +0 -23
  221. package/src/pages/Home.tsx +0 -36
  222. package/src/pages/IntroductoryTutorial.tsx +0 -170
  223. package/src/pages/Login.tsx +0 -47
  224. package/src/pages/MomentOption.tsx +0 -30
  225. package/src/pages/MultiCheckout.tsx +0 -31
  226. package/src/pages/MultiOrdersDetails.tsx +0 -27
  227. package/src/pages/MyOrders.tsx +0 -40
  228. package/src/pages/NetworkError.tsx +0 -24
  229. package/src/pages/NotFound.tsx +0 -22
  230. package/src/pages/OrderDetails.tsx +0 -25
  231. package/src/pages/ProductDetails.tsx +0 -55
  232. package/src/pages/Profile.tsx +0 -36
  233. package/src/pages/ReviewDriver.tsx +0 -30
  234. package/src/pages/ReviewOrder.tsx +0 -32
  235. package/src/pages/ReviewProducts.tsx +0 -30
  236. package/src/pages/Sessions.tsx +0 -22
  237. package/src/pages/Signup.tsx +0 -53
  238. package/src/pages/SpinnerLoader.tsx +0 -10
  239. package/src/pages/Splash.tsx +0 -21
@@ -40,7 +40,6 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
40
40
 
41
41
  const theme = useTheme();
42
42
 
43
-
44
43
  const pickerStyle = StyleSheet.create({
45
44
  inputAndroid: {
46
45
  width: 34,
@@ -75,9 +74,9 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
75
74
 
76
75
  const [isActive, setActiveState] = useState(false)
77
76
  const [isServiceOpen, setIsServiceOpen] = useState(false)
77
+ const [productQuantityState, setProductQuantityState] = useState(product.quantity.toString())
78
78
  // const [setHeight, setHeightState] = useState({ height: new Animated.Value(0) })
79
79
  // const [setRotate, setRotateState] = useState({ angle: new Animated.Value(0) })
80
- const [productQuantity, setProductQuantity] = useState(product.quantity.toString())
81
80
 
82
81
  const productInfo = () => {
83
82
  if (isCartProduct) {
@@ -121,7 +120,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
121
120
 
122
121
  const handleChangeQuantity = (value: string) => {
123
122
  if (!orderState.loading) {
124
- setProductQuantity(value)
123
+ setProductQuantityState(value)
125
124
  if (parseInt(value) === 0) {
126
125
  onDeleteProduct && onDeleteProduct(product)
127
126
  } else {
@@ -211,10 +210,15 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
211
210
  <RNPickerSelect
212
211
  items={productOptions}
213
212
  onValueChange={handleChangeQuantity}
214
- value={productQuantity}
213
+ value={productQuantityState}
215
214
  style={pickerStyle}
216
215
  useNativeAndroidPickerStyle={false}
217
216
  placeholder={{}}
217
+ touchableWrapperProps={{
218
+ style: {
219
+ width: 40,
220
+ }
221
+ }}
218
222
  Icon={() => <View style={pickerStyle.icon}><OIcon src={theme.images.general.arrow_down} color={theme.colors.textNormal} width={8} /></View>}
219
223
  disabled={orderState.loading}
220
224
  />
@@ -276,21 +280,21 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
276
280
  )}
277
281
  </Accordion>
278
282
 
279
- <View style={{ display: isActive ? 'flex' : 'none', paddingStart: 40 }}>
283
+ <View style={{ display: isActive ? 'flex' : 'none', paddingStart: isFromCheckout ? 100 : 40, marginTop: isFromCheckout ? -80 : -30 }}>
280
284
  <Animated.View>
281
285
  <AccordionContent>
282
286
  {productInfo().ingredients.length > 0 && productInfo().ingredients.some((ingredient: any) => !ingredient.selected) && (
283
287
  <ProductOptionsList>
284
288
  <OText size={10} color={theme.colors.textSecondary}>{t('INGREDIENTS', 'Ingredients')}</OText>
285
- {productInfo().ingredients.map((ingredient: any) => !ingredient.selected && (
286
- <OText size={10} color={theme.colors.textThird} key={ingredient.id} style={{ marginLeft: 10 }}>{t('NO', 'No')} {ingredient.name}</OText>
289
+ {productInfo().ingredients.map((ingredient: any, i) => !ingredient.selected && (
290
+ <OText size={10} color={theme.colors.textThird} key={ingredient.id + i} style={{ marginLeft: 10 }}>{t('NO', 'No')} {ingredient.name}</OText>
287
291
  ))}
288
292
  </ProductOptionsList>
289
293
  )}
290
294
  {productInfo().options.length > 0 && (
291
295
  <ProductOptionsList>
292
- {productInfo().options.sort((a: any, b: any) => a.rank - b.rank).map((option: any, i: number) => (
293
- <ProductOption key={option.id + i}>
296
+ {productInfo().options.sort((a: any, b: any) => a.rank - b.rank).map((option: any) => (
297
+ <ProductOption key={option.id}>
294
298
  <OText size={10} color={theme.colors.textSecondary}>{option.name}</OText>
295
299
  {option.suboptions.map((suboption: any) => (
296
300
  <ProductSubOption key={suboption.id}>
@@ -54,4 +54,6 @@ export const ProductSubOption = styled.View`
54
54
  margin-left: 0px;
55
55
  `
56
56
 
57
- export const ProductComment = styled.View``
57
+ export const ProductComment = styled.View`
58
+ margin-left: 20px;
59
+ `
@@ -7,6 +7,7 @@ import {
7
7
  import { useTheme } from 'styled-components/native';
8
8
  import { StyleSheet, View } from 'react-native'
9
9
  import IconAntDesign from 'react-native-vector-icons/AntDesign';
10
+ import FastImage from 'react-native-fast-image';
10
11
 
11
12
  import {
12
13
  Container,
@@ -14,9 +15,12 @@ import {
14
15
  QuantityControl,
15
16
  Checkbox,
16
17
  PositionControl,
17
- Circle
18
+ Circle,
19
+ Logo
18
20
  } from './styles'
19
21
  import { OIcon, OText } from '../shared'
22
+ import { InView } from 'react-native-intersection-observer'
23
+ import { Placeholder, PlaceholderLine } from 'rn-placeholder';
20
24
 
21
25
  export const ProductOptionSubOptionUI = (props: any) => {
22
26
  const {
@@ -29,7 +33,9 @@ export const ProductOptionSubOptionUI = (props: any) => {
29
33
  toggleSelect,
30
34
  changePosition,
31
35
  disabled,
32
- setIsScrollAvailable
36
+ setIsScrollAvailable,
37
+ image,
38
+ enableIntersection
33
39
  } = props
34
40
 
35
41
  const disableIncrement = option?.limit_suboptions_by_max ? balance === option?.max || state.quantity === suboption?.max : state.quantity === suboption?.max || (!state.selected && balance === option?.max)
@@ -37,12 +43,25 @@ export const ProductOptionSubOptionUI = (props: any) => {
37
43
 
38
44
  const theme = useTheme();
39
45
  const [, t] = useLanguage()
40
- const [{ parsePrice }] = useUtils()
46
+ const [{ parsePrice, optimizeImage }] = useUtils()
41
47
  const [showMessage, setShowMessage] = useState(false)
42
48
  const [isDirty, setIsDirty] = useState(false)
49
+ const [isIntersectionObserver, setIsIntersectionObserver] = useState(!enableIntersection)
43
50
 
44
51
  const iconsSize = 20
45
52
 
53
+ const styles = StyleSheet.create({
54
+ icon: {
55
+ borderRadius: 7.6,
56
+ width: 60,
57
+ height: 60
58
+ },
59
+ logo: {
60
+ borderRadius: 10,
61
+ marginLeft: 3,
62
+ },
63
+ });
64
+
46
65
  const handleSuboptionClick = () => {
47
66
  toggleSelect()
48
67
  setIsDirty(true)
@@ -52,6 +71,10 @@ export const ProductOptionSubOptionUI = (props: any) => {
52
71
  }
53
72
  }
54
73
 
74
+ const handleChangeInterSection = (inView: boolean) => {
75
+ setIsIntersectionObserver(inView)
76
+ }
77
+
55
78
  useEffect(() => {
56
79
  if (balance === option?.max && state?.selected && isDirty) {
57
80
  setIsDirty(false)
@@ -66,92 +89,110 @@ export const ProductOptionSubOptionUI = (props: any) => {
66
89
  }, [balance])
67
90
 
68
91
  return (
69
- <View>
70
- <Container onPress={!(option?.with_half_option || option?.allow_suboption_quantity) ? () => handleSuboptionClick() : null}>
71
- <IconControl disabled={disabled} onPress={() => handleSuboptionClick()}>
72
- {((option?.min === 0 && option?.max === 1) || option?.max > 1) ? (
73
- state?.selected ? (
74
- <OIcon src={theme.images.general.check_act} color={theme.colors.primary} width={16} />
75
- ) : (
76
- <OIcon src={theme.images.general.check_nor} color={theme.colors.disabled} width={16} />
77
- )
78
- ) : (
79
- state?.selected ? (
80
- <OIcon src={theme.images.general.radio_act} color={theme.colors.primary} width={16} />
92
+ <InView onChange={(inView: boolean) => handleChangeInterSection(inView)} triggerOnce={true}>
93
+ {isIntersectionObserver ? (
94
+ <Container onPress={!((option?.with_half_option || option?.allow_suboption_quantity) && state?.selected) ? () => handleSuboptionClick() : null}>
95
+ <IconControl disabled={disabled} onPress={() => handleSuboptionClick()}>
96
+ {((option?.min === 0 && option?.max === 1) || option?.max > 1) ? (
97
+ state?.selected ? (
98
+ <OIcon src={theme.images.general.check_act} color={theme.colors.primary} width={16} />
99
+ ) : (
100
+ <OIcon src={theme.images.general.check_nor} color={theme.colors.disabled} width={16} />
101
+ )
81
102
  ) : (
82
- <OIcon src={theme.images.general.radio_nor} color={theme.colors.disabled} width={16} />
83
- )
84
- )}
85
- <OText size={12} lineHeight={18} color={theme.colors.textSecondary} mLeft={5} style={{ flex: 1 }}>
86
- {suboption?.name}
87
- </OText>
88
- </IconControl>
89
- {option?.allow_suboption_quantity && state?.selected && (
90
- <QuantityControl>
91
- <>
92
- <Checkbox disabled={disabled || state.quantity === 0} onPress={decrement}>
93
- <IconAntDesign
94
- name='minuscircleo'
95
- size={iconsSize}
96
- color={state.quantity === 0 || disabled ? theme.colors.disabled : theme.colors.primary}
97
- />
98
- </Checkbox>
99
- <OText size={12}>
100
- {state.quantity}
101
- </OText>
102
- <Checkbox disabled={disabled || disableIncrement} onPress={increment}>
103
- <IconAntDesign
104
- name='pluscircleo'
105
- size={iconsSize}
106
- color={disableIncrement || disabled ? theme.colors.disabled : theme.colors.primary}
107
- />
108
- </Checkbox>
109
- </>
110
- </QuantityControl>
111
- )}
112
- {option?.with_half_option && state?.selected && (
113
- <PositionControl>
114
- <>
115
- <Circle disabled={disabled} onPress={() => changePosition('left')}>
116
- <OIcon
117
- src={theme.images.general.half_l}
118
- color={state.selected && state.position === 'left' ? theme.colors.primary : '#cbcbcb'}
119
- width={20}
120
- height={20}
121
- style={styles.inverse}
103
+ state?.selected ? (
104
+ <OIcon src={theme.images.general.radio_act} color={theme.colors.primary} width={16} />
105
+ ) : (
106
+ <OIcon src={theme.images.general.radio_nor} color={theme.colors.disabled} width={16} />
107
+ )
108
+ )}
109
+ {image && (
110
+ <Logo style={styles.logo}>
111
+ <FastImage
112
+ style={styles.icon}
113
+ source={{
114
+ uri: optimizeImage(image, 'h_100,c_limit'),
115
+ priority: FastImage.priority.normal,
116
+ }}
117
+ resizeMode={FastImage.resizeMode.cover}
122
118
  />
123
- </Circle>
124
- <Circle disabled={disabled} onPress={() => changePosition('whole')}>
125
- <OIcon
126
- src={theme.images.general.half_f}
127
- color={state.selected && state.position === 'whole' ? theme.colors.primary : '#cbcbcb'}
128
- width={20}
129
- height={20}
130
- />
131
- </Circle>
132
- <Circle disabled={disabled} onPress={() => changePosition('right')}>
133
- <OIcon
134
- src={theme.images.general.half_r}
135
- color={state.selected && state.position === 'right' ? theme.colors.primary : '#cbcbcb'}
136
- width={20}
137
- height={20}
138
- />
139
- </Circle>
140
- </>
141
- </PositionControl>
142
- )}
143
- {price > 0 && (
144
- <OText size={12} lineHeight={18} color={theme.colors.textSecondary} style={{width: 70, maxWidth: 70}}>
145
- + {parsePrice(price)}
146
- </OText>
147
- )}
148
- </Container>
119
+ </Logo>
120
+ )}
121
+ <OText size={12} lineHeight={18} color={theme.colors.textSecondary} mLeft={5} style={{ flex: 1 }}>
122
+ {suboption?.name}
123
+ </OText>
124
+ </IconControl>
125
+ {option?.allow_suboption_quantity && state?.selected && (
126
+ <QuantityControl>
127
+ <>
128
+ <Checkbox disabled={disabled || state.quantity === 0} onPress={decrement}>
129
+ <IconAntDesign
130
+ name='minuscircleo'
131
+ size={iconsSize}
132
+ color={state.quantity === 0 || disabled ? theme.colors.disabled : theme.colors.primary}
133
+ />
134
+ </Checkbox>
135
+ <OText size={12}>
136
+ {state.quantity}
137
+ </OText>
138
+ <Checkbox disabled={disabled || disableIncrement} onPress={increment}>
139
+ <IconAntDesign
140
+ name='pluscircleo'
141
+ size={iconsSize}
142
+ color={disableIncrement || disabled ? theme.colors.disabled : theme.colors.primary}
143
+ />
144
+ </Checkbox>
145
+ </>
146
+ </QuantityControl>
147
+ )}
148
+ {option?.with_half_option && state?.selected && (
149
+ <PositionControl>
150
+ <>
151
+ <Circle disabled={disabled} onPress={() => changePosition('left')}>
152
+ <OIcon
153
+ src={theme.images.general.half_l}
154
+ color={state.selected && state.position === 'left' ? theme.colors.primary : '#cbcbcb'}
155
+ width={20}
156
+ height={20}
157
+ style={styles.inverse}
158
+ />
159
+ </Circle>
160
+ <Circle disabled={disabled} onPress={() => changePosition('whole')}>
161
+ <OIcon
162
+ src={theme.images.general.half_f}
163
+ color={state.selected && state.position === 'whole' ? theme.colors.primary : '#cbcbcb'}
164
+ width={20}
165
+ height={20}
166
+ />
167
+ </Circle>
168
+ <Circle disabled={disabled} onPress={() => changePosition('right')}>
169
+ <OIcon
170
+ src={theme.images.general.half_r}
171
+ color={state.selected && state.position === 'right' ? theme.colors.primary : '#cbcbcb'}
172
+ width={20}
173
+ height={20}
174
+ />
175
+ </Circle>
176
+ </>
177
+ </PositionControl>
178
+ )}
179
+ {price > 0 && (
180
+ <OText size={12} lineHeight={18} color={theme.colors.textSecondary} style={{ width: 70, maxWidth: 70 }}>
181
+ + {parsePrice(price)}
182
+ </OText>
183
+ )}
184
+ </Container>
185
+ ) : (
186
+ <Placeholder>
187
+ <PlaceholderLine height={25} />
188
+ </Placeholder>
189
+ )}
149
190
  {showMessage && (
150
191
  <OText size={10} mLeft={4} mRight={4} style={{ flex: 1, textAlign: 'center' }} color={theme.colors.primary}>
151
192
  {`${t('OPTIONS_MAX_LIMIT', 'Maximum options to choose')}: ${option?.max}`}
152
193
  </OText>
153
194
  )}
154
- </View>
195
+ </InView>
155
196
  )
156
197
  }
157
198
 
@@ -10,7 +10,7 @@ export const Container = styled.TouchableOpacity`
10
10
  export const IconControl = styled.TouchableOpacity`
11
11
  flex-direction: row;
12
12
  padding: 10px 0 10px 10px;
13
- width: 35%;
13
+ width: 50%;
14
14
  align-items: center;
15
15
  `
16
16
 
@@ -32,3 +32,8 @@ export const Checkbox = styled.TouchableOpacity`
32
32
  export const Circle = styled.TouchableOpacity`
33
33
  margin: 0 1.5px;
34
34
  `
35
+
36
+ export const Logo = styled.View`
37
+ height: 65px;
38
+ width: 65px;
39
+ `;
@@ -12,7 +12,7 @@ export const ProfessionalPhoto = styled.ImageBackground`
12
12
 
13
13
  export const InfoWrapper = styled.View`
14
14
  margin-vertical: 30px;
15
- padding-horizontal: 40px;
15
+ padding-horizontal: 20px;
16
16
  `
17
17
 
18
18
  export const Divider = styled.View`
@@ -22,7 +22,7 @@ export const Divider = styled.View`
22
22
  `
23
23
 
24
24
  export const ScheduleWrapper = styled.View`
25
- padding-horizontal: 40px;
25
+ padding-horizontal: 20px;
26
26
  margin-top: 30px;
27
27
  `
28
28
 
@@ -43,4 +43,4 @@ export const CalendarWrapper = styled.View`
43
43
  border-color: ${(props: any) => props.theme.colors.backgroundGray200};
44
44
  border-radius: 7.6px;
45
45
  padding: 15px;
46
- `
46
+ `
@@ -19,7 +19,7 @@ import { useTheme } from 'styled-components/native';
19
19
  import { OButton, OIcon, OModal, OText } from '../shared'
20
20
  import { Placeholder, PlaceholderLine } from 'rn-placeholder'
21
21
  import { NotFoundSource } from '../NotFoundSource'
22
- import { View, StyleSheet, ScrollView, RefreshControl } from 'react-native'
22
+ import { View, StyleSheet, ScrollView, RefreshControl, Platform } from 'react-native'
23
23
  import { PromotionParams } from '../../types'
24
24
  import { Container } from '../../layouts/Container'
25
25
 
@@ -98,8 +98,6 @@ const PromotionsUI = (props: PromotionParams) => {
98
98
 
99
99
  return (
100
100
  <Container
101
- noPadding
102
- pt={20}
103
101
  refreshControl={
104
102
  <RefreshControl
105
103
  refreshing={refreshing}
@@ -112,7 +110,9 @@ const PromotionsUI = (props: PromotionParams) => {
112
110
  titleAlign={'center'}
113
111
  onActionLeft={() => navigation.goBack()}
114
112
  showCall={false}
115
- style={{ paddingVertical: 0, marginLeft: 20 }}
113
+ paddingTop={Platform.OS === 'ios' ? 20 : 10}
114
+ style={{ paddingVertical: 0 }}
115
+ btnStyle={{ paddingLeft: 0 }}
116
116
  />
117
117
  <PromotionsContainer>
118
118
  <SearchBarContainer>
@@ -2,8 +2,6 @@ import styled, { css } from 'styled-components/native'
2
2
 
3
3
  export const PromotionsContainer = styled.View`
4
4
  width: 100%;
5
- padding-left: 40px;
6
- padding-right: 40px;
7
5
  `
8
6
 
9
7
  export const WrapperSingleOffer = styled.View`
@@ -1,7 +1,7 @@
1
1
  import styled from 'styled-components/native'
2
2
 
3
3
  export const ReviewDriverContainer = styled.ScrollView`
4
- padding: 20px 40px;
4
+ padding: 20px;
5
5
  margin-bottom: 100px;
6
6
  `
7
7
 
@@ -1,7 +1,7 @@
1
1
  import styled from 'styled-components/native'
2
2
 
3
3
  export const ReviewOrderContainer = styled.ScrollView`
4
- padding: 20px 40px;
4
+ padding: 20px;
5
5
  margin-bottom: 100px;
6
6
  `
7
7
 
@@ -1,7 +1,7 @@
1
1
  import styled from 'styled-components/native'
2
2
 
3
3
  export const ReviewProductsContainer = styled.ScrollView`
4
- padding: 20px 40px;
4
+ padding: 20px;
5
5
  margin-bottom: 100px;
6
6
  `
7
7
 
@@ -116,7 +116,7 @@ const ServiceFormUI = (props: ServiceFormParams) => {
116
116
  marginHorizontal: 0
117
117
  },
118
118
  professionalList: {
119
- paddingHorizontal: 40,
119
+ paddingHorizontal: 20,
120
120
  paddingVertical: 30,
121
121
  }
122
122
  })
@@ -602,7 +602,7 @@ const ServiceFormUI = (props: ServiceFormParams) => {
602
602
  <PlaceholderLine width={60} height={20} />
603
603
  </Placeholder>
604
604
  ) : (
605
- <OText color={theme.colors.primary} size={13}>{t('WITH_GUEST_USER', 'With Guest user')}</OText>
605
+ <OText color={theme.colors.primary} size={13}>{t('AS_GUEST_USER', 'As guest user')}</OText>
606
606
  )}
607
607
  </TouchableOpacity>
608
608
  )}
@@ -11,7 +11,7 @@ export const ProfessionalPhoto = styled.ImageBackground`
11
11
  `;
12
12
 
13
13
  export const InfoWrapper = styled.View`
14
- padding-horizontal: 40px;
14
+ padding-horizontal: 20px;
15
15
  margin-vertical: 30px;
16
16
  `
17
17
 
@@ -22,7 +22,7 @@ export const Divider = styled.View`
22
22
  `
23
23
 
24
24
  export const ProfessionalWrapper = styled.View`
25
- padding-horizontal: 40px;
25
+ padding-horizontal: 20px;
26
26
  margin-top: 30px;
27
27
  `
28
28
 
@@ -41,10 +41,10 @@ export const ButtonWrapper = styled.View`
41
41
  align-items: center;
42
42
  flex-direction: row;
43
43
  padding-vertical: 13px;
44
- padding-horizontal: 40px;
44
+ padding-horizontal: 20px;
45
45
  margin-top: 30px;
46
46
  margin-bottom: 40px;
47
47
  width: 100%;
48
48
  border-top-width: 1px;
49
49
  border-top-color: ${(props: any) => props.theme.colors.backgroundGray200};
50
- `
50
+ `
@@ -53,6 +53,7 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
53
53
  const [isPressed, setIsPressed] = useState(false)
54
54
 
55
55
  const allowedOrderStatus = [1, 2, 5, 6, 10, 11, 12, 15];
56
+ const isGiftCardOrder = !order?.business_id
56
57
 
57
58
  const styles = StyleSheet.create({
58
59
  container: {
@@ -284,17 +285,17 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
284
285
  ) : (
285
286
  <Price>
286
287
  <OText size={12} lineHeight={18}>
287
- {parsePrice(order?.summary?.total || order?.total)}
288
+ {parsePrice(order?.total)}
288
289
  </OText>
289
290
  </Price>
290
291
  )}
291
292
  </>
292
293
  )}
293
- {!!pastOrders && (
294
+ {!!pastOrders && !isGiftCardOrder && (
294
295
  <ButtonWrapper>
295
296
  {!hideReviewOrderButton &&
296
297
  allowedOrderStatus.includes(parseInt(order?.status)) &&
297
- !order.review && (
298
+ !order.review && order?.cart && (
298
299
  <TouchableOpacity
299
300
  onPress={() => handleClickOrderReview(order)}
300
301
  style={styles.reviewButton}>
@@ -303,7 +304,7 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
303
304
  </OText>
304
305
  </TouchableOpacity>
305
306
  )}
306
- {!hideReorderButton && typeof order?.id === 'number' && (
307
+ {!hideReorderButton && typeof order?.id === 'number' && order?.cart && (
307
308
  <OButton
308
309
  text={t('REORDER', 'Reorder')}
309
310
  imgRightSrc={''}
@@ -169,7 +169,7 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
169
169
  }
170
170
 
171
171
  return (
172
- <InView style={{ minHeight: hideAddButton ? 125 : 190, marginLeft: logoPosition === 'left' ? 12.5 : 0 }} triggerOnce={true} onChange={(inView: boolean) => handleChangeIntersection()}>
172
+ <View style={{ minHeight: hideAddButton ? 125 : 190, marginLeft: logoPosition === 'left' ? 12.5 : 0 }}>
173
173
  {isIntersectionObserver ? (
174
174
  <CardAnimation
175
175
  onClick={() => handleClickproduct()}
@@ -340,7 +340,7 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
340
340
  </Placeholder>
341
341
  </View>
342
342
  )}
343
- </InView>
343
+ </View>
344
344
  );
345
345
  }, SingleProductCardPropsAreEqual);
346
346
 
@@ -49,15 +49,12 @@ export const RibbonBox = styled.View`
49
49
  background-color: ${(props: any) => props.theme.colors.primary};
50
50
  padding: 1px 8px;
51
51
  max-width: 60px;
52
-
53
52
  ${(props: any) => props.bgColor && css`
54
53
  background-color: ${props.bgColor};
55
54
  `}
56
-
57
55
  ${(props: any) => props.isRoundRect && css`
58
56
  border-radius: 7.6px;
59
57
  `}
60
-
61
58
  ${(props: any) => props.isCapsule && css`
62
59
  border-radius: 50px;
63
60
  `}