ordering-ui-react-native 0.16.46 → 0.16.49
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.
- package/package.json +1 -1
- package/src/components/BusinessBasicInformation/index.tsx +11 -19
- package/src/components/ReviewDriver/index.tsx +1 -1
- package/src/components/ReviewOrder/index.tsx +2 -2
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
- package/themes/business/src/components/PreviousOrders/index.tsx +5 -5
- package/themes/original/src/components/BusinessController/index.tsx +115 -107
- package/themes/original/src/components/BusinessListingSearch/index.tsx +26 -2
- package/themes/original/src/components/BusinessProductsListing/index.tsx +4 -2
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +20 -19
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +2 -1
- package/themes/original/src/components/BusinessesListing/index.tsx +3 -2
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +167 -0
- package/themes/original/src/components/OrderDetails/index.tsx +54 -5
- package/themes/original/src/components/OrdersOption/index.tsx +10 -3
- package/themes/original/src/components/SingleOrderCard/index.tsx +89 -96
- package/themes/original/src/components/SingleProductCard/index.tsx +102 -93
package/package.json
CHANGED
|
@@ -56,22 +56,14 @@ export const BusinessBasicInformation = (props: BusinessBasicInformationParams)
|
|
|
56
56
|
}
|
|
57
57
|
source={{ uri: header || optimizeImage(businessState?.business?.header, 'h_400,c_limit') }}
|
|
58
58
|
>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
<
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
!isBusinessInfoShow && (
|
|
68
|
-
<OIcon
|
|
69
|
-
url={logo || optimizeImage(businessState?.business?.logo, 'h_300,c_limit')}
|
|
70
|
-
style={styles.businessLogo}
|
|
71
|
-
/>
|
|
72
|
-
)
|
|
73
|
-
)}
|
|
74
|
-
</BusinessLogo>
|
|
59
|
+
{!isBusinessInfoShow && (
|
|
60
|
+
<BusinessLogo>
|
|
61
|
+
<OIcon
|
|
62
|
+
url={logo || optimizeImage(businessState?.business?.logo, 'h_300,c_limit')}
|
|
63
|
+
style={styles.businessLogo}
|
|
64
|
+
/>
|
|
65
|
+
</BusinessLogo>
|
|
66
|
+
)}
|
|
75
67
|
</BusinessHeader>
|
|
76
68
|
<BusinessInfo
|
|
77
69
|
style={styles.businessInfo}
|
|
@@ -117,7 +109,7 @@ export const BusinessBasicInformation = (props: BusinessBasicInformationParams)
|
|
|
117
109
|
<PlaceholderLine width={10} />
|
|
118
110
|
</Placeholder>
|
|
119
111
|
) : (
|
|
120
|
-
<View style={{width: '75%'}}>
|
|
112
|
+
<View style={{ width: '75%' }}>
|
|
121
113
|
<OText color={theme.colors.textSecondary}>{getBusinessType()}</OText>
|
|
122
114
|
</View>
|
|
123
115
|
)}
|
|
@@ -187,7 +179,7 @@ export const BusinessBasicInformation = (props: BusinessBasicInformationParams)
|
|
|
187
179
|
titleSectionStyle={styles.modalTitleSectionStyle}
|
|
188
180
|
open={openBusinessInformation}
|
|
189
181
|
onClose={() => setOpenBusinessInformation(false)}
|
|
190
|
-
styleCloseButton={{color: theme.colors.white, backgroundColor: 'rgba(0,0,0,0.3)'}}
|
|
182
|
+
styleCloseButton={{ color: theme.colors.white, backgroundColor: 'rgba(0,0,0,0.3)' }}
|
|
191
183
|
isNotDecoration
|
|
192
184
|
>
|
|
193
185
|
<BusinessInformation
|
|
@@ -199,7 +191,7 @@ export const BusinessBasicInformation = (props: BusinessBasicInformationParams)
|
|
|
199
191
|
titleSectionStyle={styles.modalTitleSectionStyle}
|
|
200
192
|
open={openBusinessReviews}
|
|
201
193
|
onClose={() => setOpenBusinessReviews(false)}
|
|
202
|
-
styleCloseButton={{color: theme.colors.white, backgroundColor: 'rgba(0,0,0,0.3)'}}
|
|
194
|
+
styleCloseButton={{ color: theme.colors.white, backgroundColor: 'rgba(0,0,0,0.3)' }}
|
|
203
195
|
isNotDecoration
|
|
204
196
|
>
|
|
205
197
|
<BusinessReviews
|
|
@@ -218,7 +218,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
|
|
|
218
218
|
<RatingBarContainer>
|
|
219
219
|
<LinearGradient
|
|
220
220
|
start={{ x: 0.0, y: 0.0 }}
|
|
221
|
-
end={{ x: qualificationList[dirverReviews?.qualification - 1]?.percent || 0, y: 0 }}
|
|
221
|
+
end={{ x: qualificationList[dirverReviews?.qualification - 1]?.percent || 0.0001, y: 0 }}
|
|
222
222
|
locations={[.9999, .9999]}
|
|
223
223
|
colors={[theme.colors.primary, theme.colors.lightGray]}
|
|
224
224
|
style={styles.statusBar}
|
|
@@ -106,7 +106,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
const qualificationList = [
|
|
109
|
-
{ key: 1, text: t('TERRIBLE', 'Terrible'), percent: 0
|
|
109
|
+
{ key: 1, text: t('TERRIBLE', 'Terrible'), percent: 0, parentStyle: { left: '0%' }, isInnerStyle: false, pointerColor: false },
|
|
110
110
|
{ key: 2, text: t('BAD', 'Bad'), percent: 0.25, parentStyle: { left: '25%' }, isInnerStyle: true, pointerColor: true },
|
|
111
111
|
{ key: 3, text: t('OKAY', 'Okay'), percent: 0.5, parentStyle: { left: '50%' }, isInnerStyle: true, pointerColor: true },
|
|
112
112
|
{ key: 4, text: t('GOOD', 'Good'), percent: 0.75, parentStyle: { left: '75%' }, isInnerStyle: true, pointerColor: true },
|
|
@@ -238,7 +238,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
|
238
238
|
<RatingBarContainer>
|
|
239
239
|
<LinearGradient
|
|
240
240
|
start={{ x: 0.0, y: 0.0 }}
|
|
241
|
-
end={{ x: qualificationList[stars.quality - 1]?.percent || 0.
|
|
241
|
+
end={{ x: qualificationList[stars.quality - 1]?.percent || 0.0001, y: 0.0 }}
|
|
242
242
|
locations={[.9999, .9999]}
|
|
243
243
|
colors={[theme.colors.primary, theme.colors.lightGray]}
|
|
244
244
|
style={styles.statusBar}
|
|
@@ -439,7 +439,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
439
439
|
<>
|
|
440
440
|
<OrderContentComponent order={order} />
|
|
441
441
|
{(order?.status === 7 || order?.status === 4) &&
|
|
442
|
-
order?.delivery_type === 1 && (
|
|
442
|
+
order?.delivery_type === 1 && configs?.assign_driver_enabled?.value === '1' && (
|
|
443
443
|
<AssignDriver>
|
|
444
444
|
<OText style={{ marginBottom: 5 }} size={16} weight="600">
|
|
445
445
|
{t('ASSIGN_DRIVER', 'Assign driver')}
|
|
@@ -104,8 +104,8 @@ export const PreviousOrders = (props: any) => {
|
|
|
104
104
|
const offset = 300
|
|
105
105
|
const cdtToutc = moment(order?.delivery_datetime).add(offset, 'minutes').format('YYYY-MM-DD HH:mm:ss')
|
|
106
106
|
const _delivery = order?.delivery_datetime_utc
|
|
107
|
-
? parseDate(order?.delivery_datetime_utc)
|
|
108
|
-
: parseDate(cdtToutc)
|
|
107
|
+
? parseDate(order?.delivery_datetime_utc, { outputFormat: 'YYYY-MM-DD hh:mm A' })
|
|
108
|
+
: parseDate(cdtToutc, { outputFormat: 'YYYY-MM-DD hh:mm A' })
|
|
109
109
|
const _eta = order?.eta_time
|
|
110
110
|
const diffTimeAsSeconds = moment(_delivery, 'YYYY-MM-DD hh:mm A').add(_eta, 'minutes').diff(moment().utc(), 'seconds')
|
|
111
111
|
return Math.ceil(diffTimeAsSeconds / 60)
|
|
@@ -178,9 +178,9 @@ export const PreviousOrders = (props: any) => {
|
|
|
178
178
|
activeOpacity={1}
|
|
179
179
|
>
|
|
180
180
|
<Card key={order.id}>
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
181
|
+
{allowColumns?.slaBar && (
|
|
182
|
+
<Timestatus style={{ backgroundColor: getStatusClassName(getDelayMinutes(order)) === 'in_time' ? '#00D27A' : getStatusClassName(getDelayMinutes(order)) === 'at_risk' ? '#FFC700' : getStatusClassName(getDelayMinutes(order)) === 'delayed' ? '#E63757' : '' }} />
|
|
183
|
+
)}
|
|
184
184
|
{
|
|
185
185
|
!!order.business?.logo && (
|
|
186
186
|
<Logo style={styles.logo}>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
BusinessController as BusinessSingleCard,
|
|
4
4
|
useUtils,
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
} from 'ordering-components/native';
|
|
9
9
|
import { OIcon, OText } from '../shared';
|
|
10
10
|
import { StyleSheet, TouchableOpacity, View } from 'react-native';
|
|
11
|
+
import { InView } from 'react-native-intersection-observer'
|
|
11
12
|
import { BusinessControllerParams } from '../../types';
|
|
12
13
|
import { convertHoursToMinutes, shape } from '../../utils';
|
|
13
14
|
import {
|
|
@@ -50,6 +51,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
50
51
|
const [configState] = useConfig();
|
|
51
52
|
const [, t] = useLanguage();
|
|
52
53
|
const theme = useTheme()
|
|
54
|
+
const [isIntersectionObserver, setIsIntersectionObserver] = useState(false)
|
|
53
55
|
const styles = StyleSheet.create({
|
|
54
56
|
headerStyle: {
|
|
55
57
|
borderTopLeftRadius: 7.6,
|
|
@@ -123,126 +125,132 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
123
125
|
}
|
|
124
126
|
}
|
|
125
127
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
128
|
+
const handleChangeFavorite = () => {
|
|
129
|
+
handleFavoriteBusiness && handleFavoriteBusiness(!business?.favorite)
|
|
130
|
+
}
|
|
129
131
|
|
|
130
132
|
return (
|
|
131
|
-
<
|
|
132
|
-
{
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
<OText
|
|
139
|
-
size={10}
|
|
140
|
-
weight={'400'}
|
|
141
|
-
color={theme.colors.white}
|
|
142
|
-
numberOfLines={2}
|
|
143
|
-
ellipsizeMode='tail'
|
|
144
|
-
lineHeight={13}
|
|
133
|
+
<InView triggerOnce={true} onChange={(inView: boolean) => setIsIntersectionObserver(inView)}>
|
|
134
|
+
<Card activeOpacity={1} onPress={() => handleBusinessClick(business)} style={style}>
|
|
135
|
+
{business?.ribbon?.enabled && (
|
|
136
|
+
<RibbonBox
|
|
137
|
+
bgColor={business?.ribbon?.color}
|
|
138
|
+
isRoundRect={business?.ribbon?.shape === shape?.rectangleRound}
|
|
139
|
+
isCapsule={business?.ribbon?.shape === shape?.capsuleShape}
|
|
145
140
|
>
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
resizeMode={FastImage.resizeMode.cover}
|
|
158
|
-
/>
|
|
159
|
-
{(businessFeatured ?? business?.featured) && (
|
|
160
|
-
<View style={styles.featured}>
|
|
161
|
-
<FontAwesomeIcon name="crown" size={26} color="gold" />
|
|
162
|
-
</View>
|
|
141
|
+
<OText
|
|
142
|
+
size={10}
|
|
143
|
+
weight={'400'}
|
|
144
|
+
color={theme.colors.white}
|
|
145
|
+
numberOfLines={2}
|
|
146
|
+
ellipsizeMode='tail'
|
|
147
|
+
lineHeight={13}
|
|
148
|
+
>
|
|
149
|
+
{business?.ribbon?.text}
|
|
150
|
+
</OText>
|
|
151
|
+
</RibbonBox>
|
|
163
152
|
)}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
<View style={styles.businessStateView}>
|
|
167
|
-
<OText
|
|
168
|
-
color={theme.colors.textThird}
|
|
169
|
-
size={10}
|
|
170
|
-
style={styles.businessStateText}>
|
|
171
|
-
{t('PREORDER', 'PREORDER')}
|
|
172
|
-
</OText>
|
|
173
|
-
</View>
|
|
174
|
-
)}
|
|
175
|
-
</BusinessState>
|
|
176
|
-
</BusinessHero>
|
|
177
|
-
<BusinessContent>
|
|
178
|
-
<BusinessInfo>
|
|
179
|
-
<BusinessLogo style={styles.businessLogo}>
|
|
153
|
+
{isIntersectionObserver && (
|
|
154
|
+
<BusinessHero>
|
|
180
155
|
<FastImage
|
|
181
|
-
style={{
|
|
156
|
+
style={{ height: 120 }}
|
|
182
157
|
source={{
|
|
183
|
-
uri: optimizeImage(
|
|
158
|
+
uri: optimizeImage(businessHeader || business?.header, 'h_500,c_limit'),
|
|
184
159
|
priority: FastImage.priority.normal,
|
|
185
160
|
}}
|
|
186
161
|
resizeMode={FastImage.resizeMode.cover}
|
|
187
162
|
/>
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
<OIcon src={theme.images.general.star} width={12} style={styles.starIcon} />
|
|
193
|
-
<OText size={10} style={{ lineHeight: 15 }}>
|
|
194
|
-
{parseNumber(businessReviews?.reviews?.total ?? business?.reviews?.total, { separator: '.' })}
|
|
195
|
-
</OText>
|
|
196
|
-
</Reviews>
|
|
163
|
+
{(businessFeatured ?? business?.featured) && (
|
|
164
|
+
<View style={styles.featured}>
|
|
165
|
+
<FontAwesomeIcon name="crown" size={26} color="gold" />
|
|
166
|
+
</View>
|
|
197
167
|
)}
|
|
198
|
-
<
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
168
|
+
<BusinessState>
|
|
169
|
+
{!isBusinessOpen && (configState?.configs?.preorder_status_enabled?.value === '1') && (
|
|
170
|
+
<View style={styles.businessStateView}>
|
|
171
|
+
<OText
|
|
172
|
+
color={theme.colors.textThird}
|
|
173
|
+
size={10}
|
|
174
|
+
style={styles.businessStateText}>
|
|
175
|
+
{t('PREORDER', 'PREORDER')}
|
|
176
|
+
</OText>
|
|
177
|
+
</View>
|
|
178
|
+
)}
|
|
179
|
+
</BusinessState>
|
|
180
|
+
</BusinessHero>
|
|
181
|
+
)}
|
|
182
|
+
<BusinessContent>
|
|
183
|
+
<BusinessInfo>
|
|
184
|
+
{isIntersectionObserver && (
|
|
185
|
+
<BusinessLogo style={styles.businessLogo}>
|
|
186
|
+
<FastImage
|
|
187
|
+
style={{ width: 56, height: 56 }}
|
|
188
|
+
source={{
|
|
189
|
+
uri: optimizeImage(businessLogo || business?.logo, 'h_150,c_limit'),
|
|
190
|
+
priority: FastImage.priority.normal,
|
|
191
|
+
}}
|
|
192
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
193
|
+
/>
|
|
194
|
+
</BusinessLogo>
|
|
195
|
+
)}
|
|
196
|
+
<ReviewAndFavorite>
|
|
197
|
+
{(businessReviews?.reviews?.total > 0 ?? business?.reviews?.total > 0) && (
|
|
198
|
+
<Reviews>
|
|
199
|
+
<OIcon src={theme.images.general.star} width={12} style={styles.starIcon} />
|
|
200
|
+
<OText size={10} style={{ lineHeight: 15 }}>
|
|
201
|
+
{parseNumber(businessReviews?.reviews?.total ?? business?.reviews?.total, { separator: '.' })}
|
|
202
|
+
</OText>
|
|
203
|
+
</Reviews>
|
|
204
|
+
)}
|
|
205
|
+
<TouchableOpacity
|
|
206
|
+
onPress={handleChangeFavorite}
|
|
207
|
+
>
|
|
208
|
+
<IconAntDesign
|
|
209
|
+
name={business?.favorite ? 'heart' : 'hearto'}
|
|
210
|
+
color={theme.colors.danger5}
|
|
211
|
+
size={18}
|
|
212
|
+
/>
|
|
213
|
+
</TouchableOpacity>
|
|
214
|
+
</ReviewAndFavorite>
|
|
215
|
+
</BusinessInfo>
|
|
216
|
+
<OText
|
|
217
|
+
size={12}
|
|
218
|
+
style={{ lineHeight: 18, marginBottom: 6 }}
|
|
219
|
+
weight={'500'}>
|
|
220
|
+
{business?.name}
|
|
221
|
+
</OText>
|
|
222
|
+
<OText size={10} style={{ lineHeight: 15, marginBottom: 3 }}>
|
|
223
|
+
{business?.address}
|
|
224
|
+
</OText>
|
|
225
|
+
{/* <BusinessCategory>
|
|
219
226
|
<OText>{getBusinessType()}</OText>
|
|
220
227
|
</BusinessCategory> */}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
</OText>
|
|
227
|
-
</View>
|
|
228
|
-
) : (
|
|
229
|
-
<View style={styles.bullet}>
|
|
230
|
-
{orderState?.options?.type === 1 && (
|
|
231
|
-
<OText size={10} color={theme.colors.textSecondary}>
|
|
232
|
-
{`${t('DELIVERY_FEE', 'Delivery fee')} ${parsePrice(businessDeliveryPrice ?? business?.delivery_price) + ' \u2022 '}`}
|
|
228
|
+
<Metadata>
|
|
229
|
+
{!isBusinessOpen ? (
|
|
230
|
+
<View style={styles.closed}>
|
|
231
|
+
<OText size={10} color={theme.colors.red}>
|
|
232
|
+
{t('CLOSED', 'Closed')}
|
|
233
233
|
</OText>
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
234
|
+
</View>
|
|
235
|
+
) : (
|
|
236
|
+
<View style={styles.bullet}>
|
|
237
|
+
{orderState?.options?.type === 1 && (
|
|
238
|
+
<OText size={10} color={theme.colors.textSecondary}>
|
|
239
|
+
{`${t('DELIVERY_FEE', 'Delivery fee')} ${parsePrice(businessDeliveryPrice ?? business?.delivery_price) + ' \u2022 '}`}
|
|
240
|
+
</OText>
|
|
241
|
+
)}
|
|
242
|
+
<OText size={10} color={theme.colors.textSecondary}>{`${convertHoursToMinutes(
|
|
243
|
+
orderState?.options?.type === 1
|
|
244
|
+
? (businessDeliveryTime ?? business?.delivery_time)
|
|
245
|
+
: (businessPickupTime ?? business?.pickup_time),
|
|
246
|
+
)} \u2022 `}</OText>
|
|
247
|
+
<OText size={10} color={theme.colors.textSecondary}>{parseDistance(businessDistance ?? business?.distance)}</OText>
|
|
248
|
+
</View>
|
|
249
|
+
)}
|
|
250
|
+
</Metadata>
|
|
251
|
+
</BusinessContent>
|
|
252
|
+
</Card>
|
|
253
|
+
</InView>
|
|
246
254
|
);
|
|
247
255
|
};
|
|
248
256
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react'
|
|
2
|
-
import { useLanguage, BusinessSearchList, useOrder, useUtils } from 'ordering-components/native'
|
|
2
|
+
import { useLanguage, BusinessSearchList, useOrder, useUtils, showToast, ToastType } from 'ordering-components/native'
|
|
3
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'
|
|
@@ -183,6 +183,30 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
183
183
|
setOpenFilters(false)
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
+
const isInteger = (val: any) => Number.isInteger(Number(val)) && !!val
|
|
187
|
+
|
|
188
|
+
const onProductClick = (business: any, categoryId: any, productId: any) => {
|
|
189
|
+
if (!isInteger(business?.id) ||
|
|
190
|
+
!isInteger(categoryId) ||
|
|
191
|
+
!isInteger(productId) ||
|
|
192
|
+
!business.slug || !business.header || !business.logo) {
|
|
193
|
+
showToast(ToastType.error, t('NOT_AVAILABLE', 'Not Available'))
|
|
194
|
+
return
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
navigation.navigate('ProductDetails', {
|
|
198
|
+
isRedirect: 'business',
|
|
199
|
+
businessId: business?.id,
|
|
200
|
+
categoryId: categoryId,
|
|
201
|
+
productId: productId,
|
|
202
|
+
business: {
|
|
203
|
+
store: business.slug,
|
|
204
|
+
header: business.header,
|
|
205
|
+
logo: business.logo,
|
|
206
|
+
}
|
|
207
|
+
})
|
|
208
|
+
}
|
|
209
|
+
|
|
186
210
|
useEffect(() => {
|
|
187
211
|
if (filters.business_types?.length === 0 && filters.orderBy === 'default' && Object.keys(filters)?.length === 2 && !openFilters) {
|
|
188
212
|
handleSearchbusinessAndProducts(true)
|
|
@@ -409,7 +433,7 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
409
433
|
isSoldOut={(product.inventoried && !product.quantity)}
|
|
410
434
|
product={product}
|
|
411
435
|
businessId={business?.id}
|
|
412
|
-
onProductClick={() =>
|
|
436
|
+
onProductClick={(product: any) => onProductClick(business, category?.id, product?.id)}
|
|
413
437
|
productAddedToCartLength={0}
|
|
414
438
|
handleUpdateProducts={(productId: number, changes: any) => handleUpdateProducts(productId, category?.id, business?.id, changes)}
|
|
415
439
|
style={{ width: screenWidth - 80, marginRight: i === category?.products?.length - 1 ? 0 : 20 }}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
|
2
2
|
import { View, TouchableOpacity, StyleSheet, SafeAreaView, Dimensions, Platform, KeyboardAvoidingViewBase, KeyboardAvoidingView } from 'react-native'
|
|
3
|
+
import { IOScrollView } from 'react-native-intersection-observer'
|
|
3
4
|
import { useTheme } from 'styled-components/native';
|
|
4
5
|
import {
|
|
5
6
|
BusinessAndProductList,
|
|
@@ -222,7 +223,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
222
223
|
}, [currentCart])
|
|
223
224
|
|
|
224
225
|
return (
|
|
225
|
-
|
|
226
|
+
<IOScrollView rootMargin={{ top: 0, bottom: 0 }}>
|
|
226
227
|
<ContainerSafeAreaView
|
|
227
228
|
style={{ flex: 1 }}
|
|
228
229
|
isOpenFiltProducts={isOpenFiltProducts}
|
|
@@ -421,6 +422,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
421
422
|
</>
|
|
422
423
|
)}
|
|
423
424
|
</BusinessProductsListingContainer>
|
|
425
|
+
|
|
424
426
|
{!loading && auth && currentCart?.products?.length > 0 && categoryState.products.length !== 0 && (
|
|
425
427
|
<FloatingButton
|
|
426
428
|
btnText={
|
|
@@ -479,7 +481,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
479
481
|
onClose={() => setOpenService(false)}
|
|
480
482
|
/>
|
|
481
483
|
</OModal>
|
|
482
|
-
|
|
484
|
+
</IOScrollView>
|
|
483
485
|
)
|
|
484
486
|
}
|
|
485
487
|
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
FeaturedWrapper,
|
|
33
33
|
OrderProgressWrapper,
|
|
34
34
|
FarAwayMessage,
|
|
35
|
-
|
|
35
|
+
SearchBarWrapper,
|
|
36
36
|
MomentWrapper,
|
|
37
37
|
FilterWrapper,
|
|
38
38
|
ServiceWrapper,
|
|
@@ -70,8 +70,8 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
70
70
|
isGuestUser,
|
|
71
71
|
handleUpdateBusinessList,
|
|
72
72
|
priceLevelSelected,
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
handleChangePriceLevel,
|
|
74
|
+
businessTypeSelected
|
|
75
75
|
} = props;
|
|
76
76
|
const theme = useTheme();
|
|
77
77
|
const isFocused = useIsFocused();
|
|
@@ -327,22 +327,23 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
327
327
|
/>
|
|
328
328
|
</WrapMomentOption>
|
|
329
329
|
{!businessId && (
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
330
|
+
<SearchBarWrapper>
|
|
331
|
+
<SearchBar
|
|
332
|
+
onSearch={handleChangeSearch}
|
|
333
|
+
searchValue={searchValue}
|
|
334
|
+
lazyLoad
|
|
335
|
+
isCancelXButtonShow={!!searchValue}
|
|
336
|
+
borderStyle={styles.borderStyle}
|
|
337
|
+
onCancel={() => handleChangeSearch('')}
|
|
338
|
+
placeholder={t('SEARCH', 'Search')}
|
|
339
|
+
height={80}
|
|
340
|
+
isAppointment
|
|
341
|
+
isDisabled={!businessTypes || configs?.advanced_business_search_enabled?.value === '1'}
|
|
342
|
+
inputStyle={{ ...styles.searchInput, ...Platform.OS === 'ios' ? {} : { paddingBottom: 4 } }}
|
|
343
|
+
onPress={() => { configs?.advanced_business_search_enabled?.value === '1' && navigation.navigate('BusinessSearch', { businessTypes }) }}
|
|
344
|
+
onSubmitEditing={() => { configs?.advanced_business_search_enabled?.value === '1' && navigation.navigate('BusinessSearch', { businessTypes, defaultTerm: searchValue }) }}
|
|
345
|
+
/>
|
|
346
|
+
</SearchBarWrapper>
|
|
346
347
|
)}
|
|
347
348
|
</View>
|
|
348
349
|
</OrderControlContainer>
|
|
@@ -352,13 +352,14 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
352
352
|
onCancel={() => handleChangeSearch('')}
|
|
353
353
|
placeholder={t('SEARCH', 'Search')}
|
|
354
354
|
height={50}
|
|
355
|
-
isDisabled={!businessTypes}
|
|
355
|
+
isDisabled={!businessTypes || configs?.advanced_business_search_enabled?.value === '1'}
|
|
356
356
|
inputContainerStyles={styles.inputContainerStyles}
|
|
357
357
|
containerStyles={{
|
|
358
358
|
marginHorizontal: 40,
|
|
359
359
|
marginTop: 20
|
|
360
360
|
}}
|
|
361
361
|
inputStyle={{ ...styles.searchInput, ...Platform.OS === 'ios' ? { paddingBottom: 6 } : { paddingBottom: 4 } }}
|
|
362
|
+
onPress={() => { configs?.advanced_business_search_enabled?.value === '1' && navigation.navigate('BusinessSearch', { businessTypes }) }}
|
|
362
363
|
onSubmitEditing={() => { configs?.advanced_business_search_enabled?.value === '1' && navigation.navigate('BusinessSearch', { businessTypes, defaultTerm: searchValue }) }}
|
|
363
364
|
/>
|
|
364
365
|
)}
|
|
@@ -3,6 +3,7 @@ import React, { useState, useEffect } from 'react'
|
|
|
3
3
|
import { useOrder, useSession } from 'ordering-components/native';
|
|
4
4
|
|
|
5
5
|
import { useTheme } from 'styled-components/native'
|
|
6
|
+
import { IOScrollView } from 'react-native-intersection-observer'
|
|
6
7
|
import { BusinessesListing as OriginalBusinessListing } from './Layout/Original'
|
|
7
8
|
import { BusinessesListing as AppointmentBusinessListing } from './Layout/Appointment'
|
|
8
9
|
|
|
@@ -42,9 +43,9 @@ export const BusinessesListing = (props: any) => {
|
|
|
42
43
|
}, [auth])
|
|
43
44
|
|
|
44
45
|
return (
|
|
45
|
-
|
|
46
|
+
<IOScrollView rootMargin={{ top: 0, bottom: 0 }}>
|
|
46
47
|
{(layout === 'original') && <OriginalBusinessListing {...props} />}
|
|
47
48
|
{(layout === 'appointment') && <AppointmentBusinessListing {...props} />}
|
|
48
|
-
|
|
49
|
+
</IOScrollView>
|
|
49
50
|
)
|
|
50
51
|
}
|