ordering-ui-react-native 0.15.33 → 0.15.35-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 (182) hide show
  1. package/package.json +4 -2
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessController/index.tsx +8 -2
  4. package/src/components/BusinessTypeFilter/index.tsx +4 -1
  5. package/src/components/BusinessesListing/index.tsx +1 -1
  6. package/src/components/Checkout/index.tsx +23 -3
  7. package/src/components/DriverTips/index.tsx +11 -6
  8. package/src/components/LanguageSelector/index.tsx +7 -2
  9. package/src/components/LoginForm/index.tsx +3 -1
  10. package/src/components/OrderDetails/index.tsx +2 -2
  11. package/src/components/PaymentOptions/index.tsx +9 -16
  12. package/src/components/PaymentOptionsWebView/index.tsx +123 -124
  13. package/src/components/SignupForm/index.tsx +3 -1
  14. package/src/components/SingleProductCard/index.tsx +16 -4
  15. package/src/components/StripeElementsForm/index.tsx +27 -48
  16. package/src/components/UpsellingProducts/index.tsx +1 -1
  17. package/src/components/UserProfileForm/index.tsx +63 -6
  18. package/src/components/UserProfileForm/styles.tsx +8 -0
  19. package/src/components/VerifyPhone/styles.tsx +1 -2
  20. package/src/components/shared/OModal.tsx +1 -1
  21. package/src/config.json +0 -2
  22. package/src/hooks/useCountdownTimer.tsx +26 -0
  23. package/src/navigators/CheckoutNavigator.tsx +6 -0
  24. package/src/navigators/HomeNavigator.tsx +12 -0
  25. package/src/pages/BusinessProductsList.tsx +1 -0
  26. package/src/pages/BusinessesListing.tsx +1 -1
  27. package/src/pages/Checkout.tsx +1 -1
  28. package/src/pages/MultiCheckout.tsx +31 -0
  29. package/src/pages/MultiOrdersDetails.tsx +27 -0
  30. package/src/pages/Sessions.tsx +22 -0
  31. package/src/types/index.tsx +5 -11
  32. package/src/utils/index.tsx +68 -1
  33. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +103 -15
  34. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -0
  35. package/themes/business/src/components/Chat/index.tsx +38 -86
  36. package/themes/business/src/components/DriverMap/index.tsx +6 -5
  37. package/themes/business/src/components/Home/index.tsx +128 -55
  38. package/themes/business/src/components/Home/styles.tsx +8 -1
  39. package/themes/business/src/components/LoginForm/index.tsx +89 -2
  40. package/themes/business/src/components/LoginForm/styles.tsx +6 -0
  41. package/themes/business/src/components/LogoutButton/index.tsx +1 -1
  42. package/themes/business/src/components/NewOrderNotification/index.tsx +79 -105
  43. package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
  44. package/themes/business/src/components/OrderDetails/Delivery.tsx +32 -15
  45. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +157 -89
  46. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +6 -0
  47. package/themes/business/src/components/OrderDetails/styles.tsx +7 -0
  48. package/themes/business/src/components/OrdersListManager/index.tsx +52 -49
  49. package/themes/business/src/components/OrdersOption/index.tsx +57 -50
  50. package/themes/business/src/components/PreviousOrders/index.tsx +50 -14
  51. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  52. package/themes/business/src/components/shared/OModal.tsx +1 -1
  53. package/themes/business/src/types/index.tsx +5 -1
  54. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  55. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  56. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  57. package/themes/kiosk/src/components/Cart/index.tsx +99 -25
  58. package/themes/kiosk/src/components/Cart/styles.tsx +6 -0
  59. package/themes/kiosk/src/components/Checkout/index.tsx +34 -22
  60. package/themes/kiosk/src/components/CustomerName/index.tsx +0 -6
  61. package/themes/kiosk/src/components/Intro/index.tsx +12 -12
  62. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  63. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  64. package/themes/kiosk/src/components/OrderDetails/index.tsx +165 -65
  65. package/themes/kiosk/src/components/OrderDetails/styles.tsx +5 -0
  66. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +10 -12
  67. package/themes/kiosk/src/components/PaymentOptions/index.tsx +1 -1
  68. package/themes/kiosk/src/components/ProductForm/index.tsx +2 -2
  69. package/themes/kiosk/src/components/UpsellingProducts/index.tsx +48 -34
  70. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  71. package/themes/kiosk/src/types/index.d.ts +2 -0
  72. package/themes/original/index.tsx +188 -1
  73. package/themes/original/src/components/ActiveOrders/index.tsx +15 -132
  74. package/themes/original/src/components/ActiveOrders/styles.tsx +0 -54
  75. package/themes/original/src/components/AddressForm/index.tsx +15 -10
  76. package/themes/original/src/components/AddressList/index.tsx +56 -18
  77. package/themes/original/src/components/AppleLogin/index.tsx +117 -78
  78. package/themes/original/src/components/BusinessBasicInformation/index.tsx +96 -45
  79. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +28 -1
  80. package/themes/original/src/components/BusinessController/index.tsx +56 -16
  81. package/themes/original/src/components/BusinessController/styles.tsx +27 -0
  82. package/themes/original/src/components/BusinessFeaturedController/index.tsx +20 -1
  83. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +23 -0
  84. package/themes/original/src/components/BusinessItemAccordion/index.tsx +4 -3
  85. package/themes/original/src/components/BusinessItemAccordion/styles.tsx +3 -1
  86. package/themes/original/src/components/BusinessListingSearch/index.tsx +125 -7
  87. package/themes/original/src/components/BusinessListingSearch/styles.tsx +14 -1
  88. package/themes/original/src/components/BusinessMenuList/index.tsx +11 -4
  89. package/themes/original/src/components/BusinessPreorder/index.tsx +142 -122
  90. package/themes/original/src/components/BusinessProductsCategories/index.tsx +9 -7
  91. package/themes/original/src/components/BusinessProductsList/CategoryDescription/index.tsx +44 -0
  92. package/themes/original/src/components/BusinessProductsList/index.tsx +139 -36
  93. package/themes/original/src/components/BusinessProductsList/styles.tsx +29 -2
  94. package/themes/original/src/components/BusinessProductsListing/index.tsx +125 -21
  95. package/themes/original/src/components/BusinessProductsListing/styles.tsx +22 -0
  96. package/themes/original/src/components/BusinessReviews/index.tsx +4 -25
  97. package/themes/original/src/components/BusinessTypeFilter/index.tsx +1 -2
  98. package/themes/original/src/components/BusinessesListing/index.tsx +85 -45
  99. package/themes/original/src/components/Cart/index.tsx +60 -43
  100. package/themes/original/src/components/CartContent/index.tsx +2 -2
  101. package/themes/original/src/components/Checkout/index.tsx +59 -48
  102. package/themes/original/src/components/DriverTips/index.tsx +17 -12
  103. package/themes/original/src/components/Favorite/index.tsx +91 -0
  104. package/themes/original/src/components/Favorite/styles.tsx +22 -0
  105. package/themes/original/src/components/FavoriteList/index.tsx +287 -0
  106. package/themes/original/src/components/FavoriteList/styles.tsx +5 -0
  107. package/themes/original/src/components/ForgotPasswordForm/index.tsx +84 -4
  108. package/themes/original/src/components/GPSButton/index.tsx +15 -8
  109. package/themes/original/src/components/GoogleMap/index.tsx +1 -0
  110. package/themes/original/src/components/Help/index.tsx +21 -4
  111. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +18 -1
  112. package/themes/original/src/components/Home/index.tsx +1 -1
  113. package/themes/original/src/components/LastOrders/index.tsx +12 -1
  114. package/themes/original/src/components/LoginForm/Otp/index.tsx +90 -0
  115. package/themes/original/src/components/LoginForm/Otp/styles.tsx +7 -0
  116. package/themes/original/src/components/LoginForm/index.tsx +394 -155
  117. package/themes/original/src/components/LoginForm/styles.tsx +7 -4
  118. package/themes/original/src/components/LogoutButton/index.tsx +7 -1
  119. package/themes/original/src/components/MessageListing/index.tsx +10 -1
  120. package/themes/original/src/components/Messages/index.tsx +6 -1
  121. package/themes/original/src/components/Messages/styles.tsx +1 -3
  122. package/themes/original/src/components/MomentOption/index.tsx +10 -1
  123. package/themes/original/src/components/MomentOption/styles.tsx +1 -1
  124. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +243 -0
  125. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/styles.tsx +46 -0
  126. package/themes/original/src/components/MultiCheckout/index.tsx +298 -0
  127. package/themes/original/src/components/MultiCheckout/styles.tsx +59 -0
  128. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +372 -0
  129. package/themes/original/src/components/MultiOrdersDetails/index.tsx +258 -0
  130. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +50 -0
  131. package/themes/original/src/components/OrderDetails/index.tsx +56 -33
  132. package/themes/original/src/components/OrderDetails/styles.tsx +1 -2
  133. package/themes/original/src/components/OrderProgress/index.tsx +3 -3
  134. package/themes/original/src/components/OrderProgress/styles.tsx +1 -0
  135. package/themes/original/src/components/OrderSummary/index.tsx +3 -3
  136. package/themes/original/src/components/OrderTypeSelector/index.tsx +4 -2
  137. package/themes/original/src/components/OrdersOption/index.tsx +57 -56
  138. package/themes/original/src/components/OrdersOption/styles.tsx +0 -6
  139. package/themes/original/src/components/PaymentOptionCash/index.tsx +2 -2
  140. package/themes/original/src/components/PaymentOptionWallet/index.tsx +22 -24
  141. package/themes/original/src/components/PaymentOptionWallet/styles.tsx +1 -1
  142. package/themes/original/src/components/PaymentOptions/index.tsx +9 -21
  143. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  144. package/themes/original/src/components/PreviousOrders/index.tsx +18 -145
  145. package/themes/original/src/components/ProductForm/index.tsx +76 -61
  146. package/themes/original/src/components/ProductForm/styles.tsx +0 -1
  147. package/themes/original/src/components/ProductItemAccordion/index.tsx +2 -2
  148. package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -12
  149. package/themes/original/src/components/Promotions/index.tsx +250 -0
  150. package/themes/original/src/components/Promotions/styles.tsx +60 -0
  151. package/themes/original/src/components/SearchBar/index.tsx +4 -1
  152. package/themes/original/src/components/Sessions/index.tsx +160 -0
  153. package/themes/original/src/components/Sessions/styles.tsx +15 -0
  154. package/themes/original/src/components/SignupForm/index.tsx +9 -4
  155. package/themes/original/src/components/SingleOrderCard/index.tsx +282 -0
  156. package/themes/original/src/components/SingleOrderCard/styles.tsx +54 -0
  157. package/themes/original/src/components/SingleProductCard/index.tsx +82 -30
  158. package/themes/original/src/components/SingleProductCard/styles.tsx +28 -1
  159. package/themes/original/src/components/StripeElementsForm/index.tsx +10 -2
  160. package/themes/original/src/components/StripeElementsForm/naked.tsx +2 -2
  161. package/themes/original/src/components/TaxInformation/index.tsx +10 -4
  162. package/themes/original/src/components/UpsellingProducts/index.tsx +86 -74
  163. package/themes/original/src/components/UserDetails/index.tsx +5 -96
  164. package/themes/original/src/components/UserFormDetails/index.tsx +34 -24
  165. package/themes/original/src/components/UserProfile/index.tsx +62 -8
  166. package/themes/original/src/components/UserProfileForm/index.tsx +20 -18
  167. package/themes/original/src/components/UserVerification/index.tsx +178 -192
  168. package/themes/original/src/components/VerifyPhone/index.tsx +10 -7
  169. package/themes/original/src/components/VerifyPhone/styles.tsx +2 -1
  170. package/themes/original/src/components/Wallets/index.tsx +76 -9
  171. package/themes/original/src/components/Wallets/styles.tsx +21 -0
  172. package/themes/original/src/components/shared/HeaderTitle.tsx +21 -0
  173. package/themes/original/src/components/shared/OModal.tsx +4 -2
  174. package/themes/original/src/components/shared/index.tsx +2 -0
  175. package/themes/original/src/config/constants.tsx +6 -6
  176. package/themes/original/src/types/index.tsx +107 -9
  177. package/themes/original/src/utils/index.tsx +28 -2
  178. package/themes/single-business/src/components/AddressList/index.tsx +1 -1
  179. package/themes/single-business/src/components/OrderTypeSelector/index.tsx +6 -6
  180. package/themes/single-business/src/components/UserProfile/index.tsx +1 -1
  181. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  182. package/src/components/StripeMethodForm/index.tsx +0 -174
@@ -9,7 +9,7 @@ import { useTheme } from 'styled-components/native';
9
9
  import { OIcon, OText } from '../shared';
10
10
  import { StyleSheet, useWindowDimensions, View } from 'react-native';
11
11
  import { BusinessControllerParams } from '../../types';
12
- import { convertHoursToMinutes } from '../../utils';
12
+ import { convertHoursToMinutes, shape } from '../../utils';
13
13
  import {
14
14
  Card,
15
15
  BusinessHero,
@@ -20,6 +20,7 @@ import {
20
20
  BusinessState,
21
21
  BusinessLogo,
22
22
  Reviews,
23
+ RibbonBox
23
24
  } from './styles';
24
25
 
25
26
  export const BusinessFeaturedCtrlUI = (props: BusinessControllerParams) => {
@@ -97,6 +98,24 @@ export const BusinessFeaturedCtrlUI = (props: BusinessControllerParams) => {
97
98
 
98
99
  return (
99
100
  <Card activeOpacity={1} onPress={() => handleClick(business)}>
101
+ {business?.ribbon?.enabled && (
102
+ <RibbonBox
103
+ bgColor={business?.ribbon?.color}
104
+ isRoundRect={business?.ribbon?.shape === shape?.rectangleRound}
105
+ isCapsule={business?.ribbon?.shape === shape?.capsuleShape}
106
+ >
107
+ <OText
108
+ size={10}
109
+ weight={'400'}
110
+ color={theme.colors.white}
111
+ numberOfLines={2}
112
+ ellipsizeMode='tail'
113
+ lineHeight={13}
114
+ >
115
+ {business?.ribbon?.text}
116
+ </OText>
117
+ </RibbonBox>
118
+ )}
100
119
  <BusinessHero>
101
120
  <BusinessLogo>
102
121
  <OIcon
@@ -4,6 +4,7 @@ export const Card = styled.TouchableOpacity`
4
4
  margin-vertical: 4px;
5
5
  height: 60px;
6
6
  overflow: hidden;
7
+ position: relative;
7
8
  `;
8
9
 
9
10
  export const BusinessHero = styled.View`
@@ -48,3 +49,25 @@ export const BusinessLogo = styled.View`
48
49
  export const Reviews = styled.View`
49
50
  flex-direction: row;
50
51
  `
52
+
53
+ export const RibbonBox = styled.View`
54
+ position: absolute;
55
+ z-index: 1;
56
+ top: 0px;
57
+ right: 5px;
58
+ background-color: ${(props: any) => props.theme.colors.primary};
59
+ padding: 1px 8px;
60
+ max-width: 160px;
61
+
62
+ ${(props: any) => props.bgColor && css`
63
+ background-color: ${props.bgColor};
64
+ `}
65
+
66
+ ${(props: any) => props.isRoundRect && css`
67
+ border-radius: 7.6px;
68
+ `}
69
+
70
+ ${(props: any) => props.isCapsule && css`
71
+ border-radius: 50px;
72
+ `}
73
+ `
@@ -21,7 +21,8 @@ export const BusinessItemAccordion = (props: any) => {
21
21
  singleBusiness,
22
22
  handleClearProducts,
23
23
  handleClickCheckout,
24
- checkoutButtonDisabled
24
+ checkoutButtonDisabled,
25
+ isMultiCheckout
25
26
  } = props
26
27
 
27
28
  const [orderState] = useOrder();
@@ -44,7 +45,7 @@ export const BusinessItemAccordion = (props: any) => {
44
45
  }, [orderState?.carts])
45
46
 
46
47
  return (
47
- <BIContainer isClosed={isClosed} checkoutVisible={!isActive && !isClosed && !!isProducts && !checkoutButtonDisabled}>
48
+ <BIContainer isClosed={isClosed} isMultiCheckout={isMultiCheckout} checkoutVisible={!isActive && !isClosed && !!isProducts && !checkoutButtonDisabled}>
48
49
  <BIHeader
49
50
  isClosed={isClosed}
50
51
  onPress={() => !isClosed ? setActiveState(!isActive) : isClosed}
@@ -139,7 +140,7 @@ export const BusinessItemAccordion = (props: any) => {
139
140
  )}
140
141
  </BIActions>
141
142
  </BIHeader>
142
- {!isActive && !isClosed && !!isProducts && (
143
+ {!isActive && !isClosed && !!isProducts && !isMultiCheckout && (
143
144
  <PriceContainer>
144
145
  <OText>{parsePrice(cart?.total)}</OText>
145
146
  {cart?.valid_products && (
@@ -7,7 +7,9 @@ export const BIContainer = styled.View`
7
7
  opacity: 1;
8
8
  border-radius: 7.6px;
9
9
  overflow: hidden;
10
- min-height: 120px;
10
+ ${(props: any) => !props.isMultiCheckout && css`
11
+ min-height: 120px;
12
+ `}
11
13
  ${(props: any) => props.isClosed && css`
12
14
  opacity: 0.5;
13
15
  min-height: 60px;
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect, useState } from 'react'
2
2
  import { useLanguage, BusinessSearchList, useOrder, useUtils } from 'ordering-components/native'
3
- import { ScrollView, StyleSheet, TouchableOpacity, Platform, View } from 'react-native'
3
+ import { ScrollView, StyleSheet, TouchableOpacity, Platform, View, Dimensions } from 'react-native'
4
4
  import { useSafeAreaInsets } from 'react-native-safe-area-context'
5
5
  import { useTheme } from 'styled-components/native'
6
6
  import { OButton, OIcon, OModal, OText } from '../shared'
@@ -22,15 +22,18 @@ import {
22
22
  ProgressContentWrapper,
23
23
  ProgressBar,
24
24
  TagsContainer,
25
- SortContainer
25
+ SortContainer,
26
+ BrandContainer,
27
+ BrandItem,
28
+ PriceFilterWrapper
26
29
  } from './styles'
27
30
  import FastImage from 'react-native-fast-image'
28
31
  import { convertHoursToMinutes } from '../../utils'
29
32
  import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder'
30
33
  import { BusinessSearchParams } from '../../types'
31
34
 
32
- export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
33
35
 
36
+ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
34
37
  const {
35
38
  navigation,
36
39
  businessesSearchList,
@@ -42,9 +45,13 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
42
45
  handleChangeFilters,
43
46
  filters,
44
47
  businessTypes,
45
- setFilters
48
+ setFilters,
49
+ brandList,
50
+ handleUpdateBusinessList,
51
+ handleUpdateProducts
46
52
  } = props
47
-
53
+
54
+ const screenHeight = Dimensions.get('window').height;
48
55
  const theme = useTheme()
49
56
  const [orderState] = useOrder()
50
57
  const { top } = useSafeAreaInsets();
@@ -63,11 +70,24 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
63
70
  { text: t('PICKUP_TIME', 'Pickup time'), value: 'pickup_time' }
64
71
  ]
65
72
 
73
+ const priceList = [
74
+ { level: '1', content: '$' },
75
+ { level: '2', content: '$$' },
76
+ { level: '3', content: '$$$' },
77
+ { level: '4', content: '$$$$' },
78
+ { level: '5', content: '$$$$$' }
79
+ ]
80
+
66
81
  const styles = StyleSheet.create({
67
82
  container: {
68
83
  paddingHorizontal: 40,
69
84
  width: '100%'
70
85
  },
86
+ filterContainer: {
87
+ maxHeight: screenHeight - 150,
88
+ paddingHorizontal: 40,
89
+ width: '100%'
90
+ },
71
91
  searchInput: {
72
92
  fontSize: 10,
73
93
  },
@@ -84,6 +104,12 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
84
104
  flexWrap: 'wrap',
85
105
  justifyContent: 'center'
86
106
  },
107
+ priceContainer: {
108
+ width: '100%',
109
+ flexDirection: 'row',
110
+ flexWrap: 'wrap',
111
+ justifyContent: 'space-between'
112
+ },
87
113
  categoryStyle: {
88
114
  marginRight: 10,
89
115
  marginTop: 10,
@@ -95,6 +121,16 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
95
121
  height: 28,
96
122
  borderWidth: 0
97
123
  },
124
+ priceItem: {
125
+ marginRight: 10,
126
+ marginTop: 10,
127
+ borderRadius: 50,
128
+ paddingVertical: 4,
129
+ paddingLeft: 5,
130
+ paddingRight: 5,
131
+ height: 27,
132
+ borderWidth: 0
133
+ },
98
134
  applyButton: {
99
135
  paddingHorizontal: 40,
100
136
  width: '100%',
@@ -107,7 +143,7 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
107
143
  }
108
144
 
109
145
  const handleCloseFilters = () => {
110
- setFilters({ business_types: [], orderBy: 'default' })
146
+ setFilters({ business_types: [], orderBy: 'default', franchise_ids: [], price_level: null })
111
147
  setOpenFilters(false)
112
148
  }
113
149
 
@@ -126,6 +162,18 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
126
162
  }
127
163
  }
128
164
 
165
+ const handleChangeBrandFilter = (brandId: number) => {
166
+ let franchiseIds = [...filters?.franchise_ids]
167
+ if (filters?.franchise_ids?.includes(brandId)) franchiseIds = filters?.franchise_ids?.filter((item: any) => item !== brandId)
168
+ else franchiseIds.push(brandId)
169
+ handleChangeFilters && handleChangeFilters('franchise_ids', franchiseIds)
170
+ }
171
+
172
+ const handleChangePriceRange = (value: string) => {
173
+ if (value === filters?.price_level) handleChangeFilters('price_level', null)
174
+ else handleChangeFilters('price_level', value)
175
+ }
176
+
129
177
  const handleApplyFilters = () => {
130
178
  handleSearchbusinessAndProducts(true)
131
179
  setOpenFilters(false)
@@ -137,6 +185,10 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
137
185
  }
138
186
  }, [filters, openFilters])
139
187
 
188
+ useEffect(() => {
189
+ handleSearchbusinessAndProducts(true)
190
+ }, [])
191
+
140
192
  const MaxSectionItem = ({ title, options, filter }: any) => {
141
193
  const parseValue = (option: number) => {
142
194
  return filter === 'max_distance'
@@ -214,6 +266,7 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
214
266
  business={business}
215
267
  isBusinessOpen={business.open}
216
268
  handleCustomClick={() => onBusinessClick(business)}
269
+ handleUpdateBusinessList={handleUpdateBusinessList}
217
270
  orderType={orderState?.options?.type}
218
271
  style={{ width: 320, marginRight: (businessesSearchList.loading || i !== businessesSearchList.businesses?.length - 1) ? 20 : 0 }}
219
272
  />
@@ -334,6 +387,7 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
334
387
  businessId={business?.id}
335
388
  onProductClick={() => { }}
336
389
  productAddedToCartLength={0}
390
+ handleUpdateProducts={(productId: number, changes: any) => handleUpdateProducts(productId, category?.id, business?.id, changes)}
337
391
  style={{ width: 320, marginRight: i === category?.products?.length - 1 ? 0 : 20 }}
338
392
  />
339
393
  )))}
@@ -384,7 +438,7 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
384
438
  onCancel={() => handleCloseFilters()}
385
439
  onClose={() => handleCloseFilters()}
386
440
  >
387
- <ScrollView style={styles.container}>
441
+ <ScrollView style={styles.filterContainer}>
388
442
  <OText
389
443
  size={20}
390
444
  mBottom={15}
@@ -411,6 +465,70 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
411
465
  </TouchableOpacity>
412
466
  ))}
413
467
  </SortContainer>
468
+ <BrandContainer>
469
+ <OText
470
+ size={16}
471
+ weight='bold'
472
+ lineHeight={24}
473
+ style={{ marginBottom: 10 }}
474
+ >
475
+ {t('BRANDS', 'Brands')}
476
+ </OText>
477
+ {!brandList?.loading && !brandList?.error && brandList?.brands?.length > 0 && (
478
+ <ScrollView
479
+ style={{ maxHeight: 300, marginBottom: 10 }}
480
+ showsVerticalScrollIndicator={true}
481
+ nestedScrollEnabled={true}
482
+ >
483
+ {brandList?.brands.map((brand: any, i: number) => brand?.enabled && (
484
+ <BrandItem
485
+ key={i}
486
+ onPress={() => handleChangeBrandFilter(brand?.id)}
487
+ >
488
+ <OText
489
+ size={14}
490
+ weight={'400'}
491
+ lineHeight={24}
492
+ >
493
+ {brand?.name}
494
+ </OText>
495
+ {filters?.franchise_ids?.includes(brand?.id) && (
496
+ <AntDesignIcon
497
+ name='check'
498
+ color={theme.colors.success500}
499
+ size={16}
500
+ />
501
+ )}
502
+ </BrandItem>
503
+ ))}
504
+ </ScrollView>
505
+ )}
506
+ {!brandList?.loading && ((brandList?.brands?.filter((brand: any) => brand?.enabled))?.length === 0) && (
507
+ <OText size={14} weight='400'>{t('NO_RESULTS_FOUND', 'Sorry, no results found')}</OText>
508
+ )}
509
+ </BrandContainer>
510
+ <PriceFilterWrapper>
511
+ <OText
512
+ size={16}
513
+ weight='bold'
514
+ lineHeight={24}
515
+ style={{ marginBottom: 5 }}
516
+ >
517
+ {t('PRICE_RANGE', 'Price range')}
518
+ </OText>
519
+ <View style={styles.priceContainer}>
520
+ {priceList.map((price: any, i: number) => (
521
+ <OButton
522
+ key={i}
523
+ bgColor={(filters?.price_level === price?.level) ? theme.colors.primary : theme.colors.backgroundGray200}
524
+ onClick={() => handleChangePriceRange(price?.level)}
525
+ text={`${price.content} ${(filters?.price_level === price?.level) ? ' X' : ''}`}
526
+ style={styles.priceItem}
527
+ textStyle={{ fontSize: 10, color: (filters?.price_level === price?.level) ? theme.colors.backgroundLight : theme.colors.textNormal }}
528
+ />
529
+ ))}
530
+ </View>
531
+ </PriceFilterWrapper>
414
532
  {orderState?.options?.type === 1 && (
415
533
  <MaxSectionItem
416
534
  title={t('MAX_DELIVERY_FEE', 'Max delivery fee')}
@@ -68,9 +68,22 @@ export const ProgressContentWrapper = styled.View`
68
68
  `
69
69
 
70
70
  export const TagsContainer = styled.View`
71
-
71
+ padding-bottom: 10px;
72
72
  `
73
73
 
74
74
  export const SortContainer = styled.View`
75
75
  margin-bottom: 10px;
76
76
  `
77
+
78
+ export const BrandContainer = styled.View``
79
+
80
+ export const BrandItem = styled.TouchableOpacity`
81
+ flex-direction: row;
82
+ justify-content: space-between;
83
+ margin-bottom: 4px;
84
+ align-items: center;
85
+ `
86
+
87
+ export const PriceFilterWrapper = styled.View`
88
+ margin-bottom: 20px;
89
+ `
@@ -1,4 +1,4 @@
1
- import React from 'react'
1
+ import React, { useEffect } from 'react'
2
2
  import { useLanguage, BusinessMenuListing } from 'ordering-components/native'
3
3
  import { OText } from '../shared'
4
4
  import { BusinessMenuListParams } from '../../types'
@@ -19,7 +19,7 @@ const BusinessMenuListUI = (props: BusinessMenuListParams) => {
19
19
 
20
20
  const [, t] = useLanguage()
21
21
  const theme = useTheme()
22
- const {top} = useSafeAreaInsets()
22
+ const { top } = useSafeAreaInsets()
23
23
 
24
24
  const styles = StyleSheet.create({
25
25
  container: {
@@ -36,7 +36,7 @@ const BusinessMenuListUI = (props: BusinessMenuListParams) => {
36
36
  height: 44,
37
37
  width: '100%'
38
38
  }
39
- })
39
+ })
40
40
 
41
41
  const dropDownIcon = () => {
42
42
  return (
@@ -48,12 +48,18 @@ const BusinessMenuListUI = (props: BusinessMenuListParams) => {
48
48
  )
49
49
  }
50
50
 
51
+ useEffect(() => {
52
+ if (!businessMenuList?.loading && businessMenuList?.menus?.length === 1){
53
+ setMenu(businessMenuList?.menus[0])
54
+ }
55
+ }, [businessMenuList?.menus])
56
+
51
57
  return (
52
58
  <>
53
59
  {businessMenuList.loading ? (
54
60
  <Placeholder Animation={Fade}>
55
61
  <View>
56
- <PlaceholderLine height={44}/>
62
+ <PlaceholderLine height={44} />
57
63
  </View>
58
64
  </Placeholder>
59
65
  ) : (
@@ -67,6 +73,7 @@ const BusinessMenuListUI = (props: BusinessMenuListParams) => {
67
73
  onSelect={(selectedItem, index) => {
68
74
  setMenu(selectedItem)
69
75
  }}
76
+ defaultValue={businessMenuList?.menus?.length === 1 && businessMenuList?.menus[0]}
70
77
  buttonTextAfterSelection={(selectedItem, index) => {
71
78
  return selectedItem.name
72
79
  }}