ordering-ui-react-native 0.18.32 → 0.18.34
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/themes/business/src/components/NewOrderNotification/index.tsx +7 -7
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +46 -27
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -5
- package/themes/original/src/components/BusinessFeaturedController/index.tsx +17 -52
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +1 -18
- package/themes/original/src/components/BusinessListingSearch/index.tsx +2 -69
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +0 -18
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +1 -1
- package/themes/original/src/components/Cart/index.tsx +2 -8
- package/themes/original/src/components/MultiCheckout/index.tsx +1 -1
- package/themes/original/src/components/OrderSummary/index.tsx +3 -2
- package/themes/original/src/components/PageBanner/index.tsx +31 -23
- package/themes/original/src/components/PageBanner/styles.tsx +0 -3
- package/themes/original/src/components/UserProfile/index.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react'
|
|
2
1
|
import moment from 'moment'
|
|
3
|
-
import {
|
|
2
|
+
import { NewOrderNotification as NewOrderNotificationController, useApi, useEvent, useLanguage, useSession } from 'ordering-components/native'
|
|
3
|
+
import React, { useEffect, useState } from 'react'
|
|
4
|
+
import { Dimensions, Modal, StyleSheet, TouchableOpacity, View } from 'react-native'
|
|
4
5
|
import Sound from 'react-native-sound'
|
|
5
6
|
import Icon from 'react-native-vector-icons/Feather'
|
|
6
7
|
import { useTheme } from 'styled-components/native'
|
|
7
|
-
import { useEvent, useLanguage, useSession, useApi, NewOrderNotification as NewOrderNotificationController } from 'ordering-components/native'
|
|
8
8
|
|
|
9
|
-
import { OText, OIcon } from '../shared'
|
|
10
|
-
import { NotificationContainer } from './styles'
|
|
11
9
|
import { useLocation } from '../../hooks/useLocation'
|
|
10
|
+
import { OIcon, OText } from '../shared'
|
|
11
|
+
import { NotificationContainer } from './styles'
|
|
12
12
|
|
|
13
13
|
Sound.setCategory('Playback', true)
|
|
14
14
|
Sound.setMode('Default')
|
|
@@ -82,14 +82,14 @@ const NewOrderNotificationUI = (props: any) => {
|
|
|
82
82
|
} catch { }
|
|
83
83
|
const duration = moment.duration(moment().diff(moment.utc(value?.last_driver_assigned_at)))
|
|
84
84
|
const assignedSecondsDiff = duration.asSeconds()
|
|
85
|
-
if (assignedSecondsDiff < 5 && !isBusinessApp) {
|
|
85
|
+
if (assignedSecondsDiff < 5 && !isBusinessApp && !value?.logistic_status) {
|
|
86
86
|
handlePlayNotificationSound({ evt: 2, orderId: value?.id })
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
if (evtType === 3 || value.author_id === user.id) return
|
|
90
90
|
handlePlayNotificationSound({
|
|
91
91
|
evt: evtType,
|
|
92
|
-
orderId: value?.order_id
|
|
92
|
+
orderId: value?.driver ? value?.order_id : evtList[evtType].event === 'messages' ? value?.order?.id : value?.id
|
|
93
93
|
})
|
|
94
94
|
}
|
|
95
95
|
|
|
@@ -21,7 +21,6 @@ import {
|
|
|
21
21
|
BusinessInfo,
|
|
22
22
|
BusinessInfoItem,
|
|
23
23
|
WrapReviews,
|
|
24
|
-
WrapBusinessInfo,
|
|
25
24
|
TitleWrapper,
|
|
26
25
|
RibbonBox,
|
|
27
26
|
SocialListWrapper
|
|
@@ -101,11 +100,11 @@ export const BusinessBasicInformation = (
|
|
|
101
100
|
borderRadius: 3,
|
|
102
101
|
borderColor: theme.colors.border,
|
|
103
102
|
borderWidth: isChewLayout ? 0 : 1,
|
|
104
|
-
width:
|
|
105
|
-
height:
|
|
103
|
+
width: 30,
|
|
104
|
+
height: 30,
|
|
106
105
|
justifyContent: 'center',
|
|
107
106
|
alignItems: 'center',
|
|
108
|
-
marginRight:
|
|
107
|
+
marginRight: 10,
|
|
109
108
|
marginBottom: 7
|
|
110
109
|
},
|
|
111
110
|
tiktokIcon: {
|
|
@@ -166,7 +165,7 @@ export const BusinessBasicInformation = (
|
|
|
166
165
|
<MaterialComIcon
|
|
167
166
|
name={iconTitle}
|
|
168
167
|
color={isChewLayout ? theme.colors.black : theme.colors.textNormal}
|
|
169
|
-
size={isChewLayout ?
|
|
168
|
+
size={isChewLayout ? 25 : 22}
|
|
170
169
|
/>
|
|
171
170
|
</TouchableOpacity>
|
|
172
171
|
)
|
|
@@ -291,11 +290,6 @@ export const BusinessBasicInformation = (
|
|
|
291
290
|
})}
|
|
292
291
|
imageStyle={{ opacity: isChewLayout ? 0.5 : 1 }}
|
|
293
292
|
>
|
|
294
|
-
{!isBusinessInfoShow && !hideInfoIcon && !isChewLayout && (
|
|
295
|
-
<WrapBusinessInfo onPress={() => handleClickBusinessInformation()}>
|
|
296
|
-
<OIcon src={theme.images.general.info} width={24} />
|
|
297
|
-
</WrapBusinessInfo>
|
|
298
|
-
)}
|
|
299
293
|
{isChewLayout && !loading && (
|
|
300
294
|
<View style={styles.headerChewStyle}>
|
|
301
295
|
<OText size={24} weight={'600'} mBottom={-5}>
|
|
@@ -317,21 +311,31 @@ export const BusinessBasicInformation = (
|
|
|
317
311
|
{!hideLogo && (
|
|
318
312
|
<BusinessLogo isChewLayout={isChewLayout}>
|
|
319
313
|
{!isBusinessInfoShow && (
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
style={styles.logoStyle}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
314
|
+
<>
|
|
315
|
+
{loading ? (
|
|
316
|
+
<View style={styles.logoStyle}>
|
|
317
|
+
<Placeholder Animation={Fade}>
|
|
318
|
+
<PlaceholderLine height={72} style={{ borderRadius: 8 }} />
|
|
319
|
+
</Placeholder>
|
|
320
|
+
</View>
|
|
321
|
+
) : (
|
|
322
|
+
logo || businessState?.business?.logo || typeof theme.images.dummies.businessLogo === 'string' ?
|
|
323
|
+
<FastImage
|
|
324
|
+
style={styles.logoStyle}
|
|
325
|
+
source={{
|
|
326
|
+
uri: logo || optimizeImage(businessState?.business?.logo, 'h_70,c_limit') || theme.images.dummies.businessLogo,
|
|
327
|
+
priority: FastImage.priority.high,
|
|
328
|
+
cache: FastImage.cacheControl.web
|
|
329
|
+
}}
|
|
330
|
+
resizeMode={FastImage.resizeMode.contain}
|
|
331
|
+
/>
|
|
332
|
+
:
|
|
333
|
+
<OIcon
|
|
334
|
+
src={theme?.images?.dummies?.businessLogo}
|
|
335
|
+
style={styles.logoStyle}
|
|
336
|
+
/>
|
|
337
|
+
)}
|
|
338
|
+
</>
|
|
335
339
|
)}
|
|
336
340
|
</BusinessLogo>
|
|
337
341
|
)}
|
|
@@ -453,13 +457,28 @@ export const BusinessBasicInformation = (
|
|
|
453
457
|
</>
|
|
454
458
|
)}
|
|
455
459
|
{!hideReviewsPopup && (
|
|
456
|
-
|
|
460
|
+
<>
|
|
461
|
+
<TouchableOpacity onPress={() => handleClickBusinessReviews()}>
|
|
462
|
+
<OText
|
|
463
|
+
color={theme.colors.primary}
|
|
464
|
+
style={{ textDecorationColor: theme.colors.primary, textDecorationLine: 'underline' }}
|
|
465
|
+
size={12}
|
|
466
|
+
>
|
|
467
|
+
{t('REVIEWS', 'Reviews')}
|
|
468
|
+
</OText>
|
|
469
|
+
</TouchableOpacity>
|
|
470
|
+
<OText size={12} color={theme.colors.textSecondary}>{' \u2022 '}</OText>
|
|
471
|
+
</>
|
|
472
|
+
)}
|
|
473
|
+
|
|
474
|
+
{!isBusinessInfoShow && !hideInfoIcon && !isChewLayout && (
|
|
475
|
+
<TouchableOpacity onPress={() => handleClickBusinessInformation()}>
|
|
457
476
|
<OText
|
|
458
477
|
color={theme.colors.primary}
|
|
459
478
|
style={{ textDecorationColor: theme.colors.primary, textDecorationLine: 'underline' }}
|
|
460
479
|
size={12}
|
|
461
480
|
>
|
|
462
|
-
{t('
|
|
481
|
+
{t('INFORMATION', 'Information')}
|
|
463
482
|
</OText>
|
|
464
483
|
</TouchableOpacity>
|
|
465
484
|
)}
|
|
@@ -36,11 +36,6 @@ export const WrapReviews = styled.View`
|
|
|
36
36
|
align-items: center;
|
|
37
37
|
justify-content: flex-start;
|
|
38
38
|
`;
|
|
39
|
-
export const WrapBusinessInfo = styled.TouchableOpacity`
|
|
40
|
-
position: absolute;
|
|
41
|
-
top: 16px;
|
|
42
|
-
end: 39px;
|
|
43
|
-
`;
|
|
44
39
|
|
|
45
40
|
export const TitleWrapper = styled.View`
|
|
46
41
|
width: 100%;
|
|
@@ -52,6 +47,7 @@ export const RibbonBox = styled.View`
|
|
|
52
47
|
padding: 2px 8px;
|
|
53
48
|
max-width: 180px;
|
|
54
49
|
align-self: flex-start;
|
|
50
|
+
margin-bottom: 5px;
|
|
55
51
|
|
|
56
52
|
${(props: any) => props.bgColor && css`
|
|
57
53
|
background-color: ${props.bgColor};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { StyleSheet, useWindowDimensions, View } from 'react-native';
|
|
2
3
|
import {
|
|
3
4
|
BusinessController as BusinessSingleCard,
|
|
4
5
|
useUtils,
|
|
@@ -6,33 +7,29 @@ import {
|
|
|
6
7
|
useLanguage,
|
|
7
8
|
} from 'ordering-components/native';
|
|
8
9
|
import { useTheme } from 'styled-components/native';
|
|
9
|
-
import
|
|
10
|
-
|
|
10
|
+
import FastImage from 'react-native-fast-image'
|
|
11
|
+
|
|
12
|
+
import { OText } from '../shared';
|
|
11
13
|
import { BusinessControllerParams } from '../../types';
|
|
12
14
|
import { convertHoursToMinutes, lightenDarkenColor, shape } from '../../utils';
|
|
13
15
|
import {
|
|
14
16
|
Card,
|
|
15
17
|
BusinessHero,
|
|
16
18
|
BusinessContent,
|
|
17
|
-
BusinessCategory,
|
|
18
19
|
BusinessInfo,
|
|
19
20
|
Metadata,
|
|
20
|
-
BusinessState,
|
|
21
21
|
BusinessLogo,
|
|
22
|
-
Reviews,
|
|
23
22
|
RibbonBox
|
|
24
23
|
} from './styles';
|
|
25
24
|
|
|
26
25
|
export const BusinessFeaturedCtrlUI = (props: BusinessControllerParams) => {
|
|
27
26
|
const { business, handleClick, isBusinessOpen } = props;
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
|
|
28
|
+
const [{ parsePrice, parseDistance, optimizeImage }] = useUtils();
|
|
30
29
|
const [orderState] = useOrder();
|
|
31
30
|
const [, t] = useLanguage();
|
|
32
|
-
|
|
33
31
|
const theme = useTheme();
|
|
34
32
|
|
|
35
|
-
|
|
36
33
|
const styles = StyleSheet.create({
|
|
37
34
|
headerStyle: {
|
|
38
35
|
borderTopLeftRadius: 25,
|
|
@@ -79,23 +76,14 @@ export const BusinessFeaturedCtrlUI = (props: BusinessControllerParams) => {
|
|
|
79
76
|
justifyContent: 'flex-start',
|
|
80
77
|
width: '100%',
|
|
81
78
|
},
|
|
79
|
+
productStyle: {
|
|
80
|
+
height: 40,
|
|
81
|
+
width: 40
|
|
82
|
+
}
|
|
82
83
|
});
|
|
83
84
|
|
|
84
|
-
const types = ['food', 'laundry', 'alcohol', 'groceries'];
|
|
85
|
-
|
|
86
85
|
const { width } = useWindowDimensions();
|
|
87
86
|
|
|
88
|
-
const getBusinessType = () => {
|
|
89
|
-
if (Object.keys(business).length <= 0) return t('GENERAL', 'General');
|
|
90
|
-
const _types: any = [];
|
|
91
|
-
types.forEach((type) => {
|
|
92
|
-
if (business[type]) {
|
|
93
|
-
_types.push(t(type.toUpperCase(), type));
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
return _types.join(', ');
|
|
97
|
-
};
|
|
98
|
-
|
|
99
87
|
return (
|
|
100
88
|
<Card activeOpacity={1} onPress={() => handleClick(business)}>
|
|
101
89
|
{business?.ribbon?.enabled && (
|
|
@@ -120,10 +108,13 @@ export const BusinessFeaturedCtrlUI = (props: BusinessControllerParams) => {
|
|
|
120
108
|
)}
|
|
121
109
|
<BusinessHero>
|
|
122
110
|
<BusinessLogo>
|
|
123
|
-
<
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
111
|
+
<FastImage
|
|
112
|
+
style={styles.productStyle}
|
|
113
|
+
source={{
|
|
114
|
+
uri: optimizeImage(business?.logo, 'h_100,c_limit'),
|
|
115
|
+
priority: FastImage.priority.normal,
|
|
116
|
+
}}
|
|
117
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
127
118
|
/>
|
|
128
119
|
</BusinessLogo>
|
|
129
120
|
<BusinessContent style={{ width: width * 0.6 }}>
|
|
@@ -131,23 +122,7 @@ export const BusinessFeaturedCtrlUI = (props: BusinessControllerParams) => {
|
|
|
131
122
|
<OText size={12} ellipsizeMode={'tail'} numberOfLines={2}>
|
|
132
123
|
{business?.name}
|
|
133
124
|
</OText>
|
|
134
|
-
{/* {business?.reviews?.total > 0 && (
|
|
135
|
-
<Reviews>
|
|
136
|
-
<IconAntDesign
|
|
137
|
-
name="star"
|
|
138
|
-
color={theme.colors.primary}
|
|
139
|
-
size={16}
|
|
140
|
-
style={styles.starIcon}
|
|
141
|
-
/>
|
|
142
|
-
<OText>
|
|
143
|
-
{parseNumber(business?.reviews?.total, { separator: '.' })}
|
|
144
|
-
</OText>
|
|
145
|
-
</Reviews>
|
|
146
|
-
)} */}
|
|
147
125
|
</BusinessInfo>
|
|
148
|
-
{/* <BusinessCategory>
|
|
149
|
-
<OText>{getBusinessType()}</OText>
|
|
150
|
-
</BusinessCategory> */}
|
|
151
126
|
<Metadata>
|
|
152
127
|
{!isBusinessOpen ? (
|
|
153
128
|
<View style={styles.closed}>
|
|
@@ -157,7 +132,6 @@ export const BusinessFeaturedCtrlUI = (props: BusinessControllerParams) => {
|
|
|
157
132
|
</View>
|
|
158
133
|
) : (
|
|
159
134
|
<View style={styles.bullet}>
|
|
160
|
-
{/* <MaterialComIcon name="alarm" size={16} /> */}
|
|
161
135
|
<OText size={10} color={theme.colors.textSecondary}>
|
|
162
136
|
{t('DELIVERY_FEE', 'Delivery Fee')}
|
|
163
137
|
</OText>
|
|
@@ -186,15 +160,6 @@ export const BusinessFeaturedCtrlUI = (props: BusinessControllerParams) => {
|
|
|
186
160
|
)}
|
|
187
161
|
</Metadata>
|
|
188
162
|
</BusinessContent>
|
|
189
|
-
{/* <BusinessState>
|
|
190
|
-
{!business?.open && (
|
|
191
|
-
<View style={styles.businessStateView}>
|
|
192
|
-
<OText color={theme.colors.white} size={20} style={styles.businessStateText}>
|
|
193
|
-
{t('PREORDER', 'PREORDER')}
|
|
194
|
-
</OText>
|
|
195
|
-
</View>
|
|
196
|
-
)}
|
|
197
|
-
</BusinessState> */}
|
|
198
163
|
</BusinessHero>
|
|
199
164
|
</Card>
|
|
200
165
|
);
|
|
@@ -74,23 +74,6 @@ export const BusinessItemAccordion = (props: any) => {
|
|
|
74
74
|
<BIInfo>
|
|
75
75
|
<BIContentInfo>
|
|
76
76
|
<OText size={16} lineHeight={24} weight={'600'}>{cart?.business?.name}</OText>
|
|
77
|
-
{/* {orderState?.options?.type === 1 ? (
|
|
78
|
-
<View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
|
|
79
|
-
<MaterialCommunityIcon
|
|
80
|
-
name='clock-outline'
|
|
81
|
-
size={24}
|
|
82
|
-
/>
|
|
83
|
-
<OText>{convertHoursToMinutes(cart?.business?.delivery_time)}</OText>
|
|
84
|
-
</View>
|
|
85
|
-
) : (
|
|
86
|
-
<View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
|
|
87
|
-
<MaterialCommunityIcon
|
|
88
|
-
name='clock-outline'
|
|
89
|
-
size={24}
|
|
90
|
-
/>
|
|
91
|
-
<OText>{convertHoursToMinutes(cart?.business?.pickup_time)}</OText>
|
|
92
|
-
</View>
|
|
93
|
-
)} */}
|
|
94
77
|
<View style={{ flexDirection: 'row' }}>
|
|
95
78
|
{props.onNavigationRedirect && !isClosed && (
|
|
96
79
|
<>
|
|
@@ -99,7 +82,7 @@ export const BusinessItemAccordion = (props: any) => {
|
|
|
99
82
|
</TouchableOpacity>
|
|
100
83
|
</>
|
|
101
84
|
)}
|
|
102
|
-
{!isCartPending &&
|
|
85
|
+
{!isCartPending && (
|
|
103
86
|
<>
|
|
104
87
|
<OText color={theme.colors.textSecondary}>{' \u2022 '}</OText>
|
|
105
88
|
<OAlert
|
|
@@ -1,30 +1,26 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react'
|
|
2
2
|
import { useLanguage, BusinessSearchList, useOrder, useUtils, showToast, ToastType } from 'ordering-components/native'
|
|
3
|
-
import { ScrollView, StyleSheet, TouchableOpacity,
|
|
3
|
+
import { ScrollView, StyleSheet, TouchableOpacity, 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, OModal, OText } from '../shared'
|
|
7
7
|
import { SearchBar } from '../SearchBar';
|
|
8
|
-
import { BusinessController } from '../BusinessController'
|
|
9
8
|
import { NotFoundSource } from '../NotFoundSource'
|
|
10
9
|
import { SingleProductCard } from '../SingleProductCard'
|
|
11
10
|
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
12
11
|
import {
|
|
13
12
|
SearchWrapper,
|
|
14
|
-
WrapHeader,
|
|
15
13
|
ProductsList,
|
|
16
14
|
SingleBusinessSearch,
|
|
17
15
|
BusinessInfo,
|
|
18
16
|
BusinessInfoItem,
|
|
19
17
|
Metadata,
|
|
20
18
|
SingleBusinessContainer,
|
|
21
|
-
LoadMoreBusinessContainer,
|
|
22
19
|
TagsContainer,
|
|
23
20
|
SortContainer,
|
|
24
21
|
BrandContainer,
|
|
25
22
|
BrandItem,
|
|
26
23
|
PriceFilterWrapper,
|
|
27
|
-
OptionTitle,
|
|
28
24
|
BContainer,
|
|
29
25
|
WrapperButtons
|
|
30
26
|
} from './styles'
|
|
@@ -32,10 +28,8 @@ import FastImage from 'react-native-fast-image'
|
|
|
32
28
|
import { convertHoursToMinutes } from '../../utils'
|
|
33
29
|
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder'
|
|
34
30
|
import { BusinessSearchParams } from '../../types'
|
|
35
|
-
import { MyOrders } from '../MyOrders'
|
|
36
31
|
import { useIsFocused } from '@react-navigation/native';
|
|
37
32
|
import { MaxSectionItem } from './MaxSectionItem'
|
|
38
|
-
import { BusinessControllerSkeletons } from './BusinessControllerSkeletons'
|
|
39
33
|
export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
40
34
|
const {
|
|
41
35
|
navigation,
|
|
@@ -43,17 +37,13 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
43
37
|
onBusinessClick,
|
|
44
38
|
handleChangeTermValue,
|
|
45
39
|
termValue,
|
|
46
|
-
paginationProps,
|
|
47
40
|
handleSearchbusinessAndProducts,
|
|
48
41
|
handleChangeFilters,
|
|
49
42
|
filters,
|
|
50
43
|
businessTypes,
|
|
51
44
|
setFilters,
|
|
52
45
|
brandList,
|
|
53
|
-
|
|
54
|
-
handleUpdateBusinessList,
|
|
55
|
-
handleUpdateProducts,
|
|
56
|
-
brandId
|
|
46
|
+
handleUpdateProducts
|
|
57
47
|
} = props
|
|
58
48
|
|
|
59
49
|
const screenHeight = Dimensions.get('window').height;
|
|
@@ -259,63 +249,6 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
259
249
|
</View>
|
|
260
250
|
)
|
|
261
251
|
}
|
|
262
|
-
{businessesSearchList.businesses?.length > 0 && termValue?.length === 0 && (
|
|
263
|
-
<MyOrders
|
|
264
|
-
hideOrders
|
|
265
|
-
businessesSearchList={businessesSearchList}
|
|
266
|
-
onNavigationRedirect={onNavigationRedirect}
|
|
267
|
-
BusinessControllerSkeletons={BusinessControllerSkeletons}
|
|
268
|
-
businessPaginationProps={paginationProps}
|
|
269
|
-
franchiseId={brandId}
|
|
270
|
-
hideBackBtn
|
|
271
|
-
titleStyle={{
|
|
272
|
-
paddingHorizontal: 0,
|
|
273
|
-
marginTop: 0,
|
|
274
|
-
marginLeft: 0
|
|
275
|
-
}}
|
|
276
|
-
/>
|
|
277
|
-
)}
|
|
278
|
-
{businessesSearchList.businesses?.length > 0 && (
|
|
279
|
-
<OptionTitle isBusinessesSearchList={!!businessesSearchList}>
|
|
280
|
-
<OText size={16} lineHeight={24} weight={'500'} color={theme.colors.textNormal} mBottom={10}>
|
|
281
|
-
{t('BUSINESSES', 'Businesses')}
|
|
282
|
-
</OText>
|
|
283
|
-
</OptionTitle>
|
|
284
|
-
)}
|
|
285
|
-
<ScrollView horizontal showsHorizontalScrollIndicator={false}>
|
|
286
|
-
{businessesSearchList.businesses?.length > 0 && businessesSearchList.businesses.map((business: any, i: number) => (
|
|
287
|
-
<View
|
|
288
|
-
key={business.id}
|
|
289
|
-
style={{
|
|
290
|
-
width: screenWidth - 120,
|
|
291
|
-
marginRight: (businessesSearchList.loading || i !== businessesSearchList.businesses?.length - 1) ? 20 : 0
|
|
292
|
-
}}
|
|
293
|
-
>
|
|
294
|
-
<BusinessController
|
|
295
|
-
business={business}
|
|
296
|
-
isBusinessOpen={business.open}
|
|
297
|
-
enableIntersection={false}
|
|
298
|
-
handleCustomClick={() => onBusinessClick(business)}
|
|
299
|
-
handleUpdateBusinessList={handleUpdateBusinessList}
|
|
300
|
-
orderType={orderState?.options?.type}
|
|
301
|
-
/>
|
|
302
|
-
</View>
|
|
303
|
-
))}
|
|
304
|
-
{!businessesSearchList.loading && paginationProps?.totalPages && paginationProps?.currentPage < paginationProps?.totalPages && (
|
|
305
|
-
<LoadMoreBusinessContainer>
|
|
306
|
-
<OButton
|
|
307
|
-
bgColor='transparent'
|
|
308
|
-
borderColor={theme.colors.primary}
|
|
309
|
-
onClick={() => handleSearchbusinessAndProducts()}
|
|
310
|
-
text={t('LOAD_MORE_BUSINESS', 'Load more business')}
|
|
311
|
-
textStyle={{ color: theme.colors.primary }}
|
|
312
|
-
/>
|
|
313
|
-
</LoadMoreBusinessContainer>
|
|
314
|
-
)}
|
|
315
|
-
{businessesSearchList.loading && (
|
|
316
|
-
<BusinessControllerSkeletons paginationProps={paginationProps} />
|
|
317
|
-
)}
|
|
318
|
-
</ScrollView>
|
|
319
252
|
<ProductsList>
|
|
320
253
|
{businessesSearchList.businesses?.filter((business: any) => business?.categories?.length > 0).map((business: any) => (
|
|
321
254
|
<SingleBusinessSearch key={`card-${business?.id}`}>
|
|
@@ -4,11 +4,6 @@ export const BContainer = styled.View`
|
|
|
4
4
|
padding: 20px 40px;
|
|
5
5
|
`
|
|
6
6
|
|
|
7
|
-
export const WrapHeader = styled.View`
|
|
8
|
-
width: 100%;
|
|
9
|
-
padding-vertical: 20px;
|
|
10
|
-
`
|
|
11
|
-
|
|
12
7
|
export const SearchWrapper = styled.View`
|
|
13
8
|
|
|
14
9
|
`
|
|
@@ -53,12 +48,6 @@ export const SingleBusinessContainer = styled.View`
|
|
|
53
48
|
justify-content: space-between;
|
|
54
49
|
`
|
|
55
50
|
|
|
56
|
-
export const LoadMoreBusinessContainer = styled.View`
|
|
57
|
-
align-items: center;
|
|
58
|
-
justify-content: center;
|
|
59
|
-
margin-left: 20px;
|
|
60
|
-
`
|
|
61
|
-
|
|
62
51
|
export const TagsContainer = styled.View`
|
|
63
52
|
padding-bottom: 10px;
|
|
64
53
|
`
|
|
@@ -80,13 +69,6 @@ export const PriceFilterWrapper = styled.View`
|
|
|
80
69
|
margin-bottom: 20px;
|
|
81
70
|
`
|
|
82
71
|
|
|
83
|
-
export const OptionTitle = styled.View`
|
|
84
|
-
margin-top: 24px;
|
|
85
|
-
${(props: any) => props.titleContent && css`
|
|
86
|
-
margin-left: ${() => props.isBusinessesSearchList ? '0' : '40px'};
|
|
87
|
-
`}
|
|
88
|
-
`
|
|
89
|
-
|
|
90
72
|
export const WrapperButtons = styled.View`
|
|
91
73
|
flex-direction: row;
|
|
92
74
|
width: 100%;
|
|
@@ -224,7 +224,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
224
224
|
|
|
225
225
|
useEffect(() => {
|
|
226
226
|
if (!businessesList?.loading) {
|
|
227
|
-
const fb = businessesList.businesses.filter((b) => b?.featured
|
|
227
|
+
const fb = businessesList.businesses.filter((b) => b?.featured && b?.open);
|
|
228
228
|
const ary = [];
|
|
229
229
|
while (fb.length > 0) {
|
|
230
230
|
ary.push(fb.splice(0, 2));
|
|
@@ -359,10 +359,10 @@ const CartUI = (props: any) => {
|
|
|
359
359
|
</OSTable>
|
|
360
360
|
))
|
|
361
361
|
}
|
|
362
|
-
{orderState?.options?.type === 1 && cart?.
|
|
362
|
+
{orderState?.options?.type === 1 && cart?.delivery_price_with_discount > 0 && !hideDeliveryFee && (
|
|
363
363
|
<OSTable>
|
|
364
364
|
<OText size={12} lineHeight={18}>{t('DELIVERY_FEE', 'Delivery Fee')}</OText>
|
|
365
|
-
<OText size={12} lineHeight={18}>{parsePrice(cart?.
|
|
365
|
+
<OText size={12} lineHeight={18}>{parsePrice(cart?.delivery_price_with_discount)}</OText>
|
|
366
366
|
</OSTable>
|
|
367
367
|
)}
|
|
368
368
|
{
|
|
@@ -386,12 +386,6 @@ const CartUI = (props: any) => {
|
|
|
386
386
|
</OSTable>
|
|
387
387
|
))
|
|
388
388
|
}
|
|
389
|
-
{orderState?.options?.type === 1 && cart?.delivery_price > 0 && cart?.delivery_price_with_discount >= 0 && !hideDeliveryFee && isChewLayout && (
|
|
390
|
-
<OSTable>
|
|
391
|
-
<OText size={12} lineHeight={18}>{t('DELIVERY_FEE_AFTER_DISCOUNT', 'Delivery Fee After Discount')}</OText>
|
|
392
|
-
<OText size={12} lineHeight={18}>{parsePrice(cart?.delivery_price_with_discount)}</OText>
|
|
393
|
-
</OSTable>
|
|
394
|
-
)}
|
|
395
389
|
{cart?.driver_tip > 0 && !hideDriverTip && (
|
|
396
390
|
<OSTable>
|
|
397
391
|
<OText size={12} lineHeight={18}>
|
|
@@ -98,7 +98,7 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
98
98
|
|
|
99
99
|
const creditPointPlan = loyaltyPlansState?.result?.find((loyal: any) => loyal.type === 'credit_point')
|
|
100
100
|
const businessIds = openCarts.map((cart: any) => cart.business_id)
|
|
101
|
-
const loyalBusinessIds = creditPointPlan?.businesses?.filter((b: any) => b.accumulates).map((item: any) => item.business_id)
|
|
101
|
+
const loyalBusinessIds = creditPointPlan?.businesses?.filter((b: any) => b.accumulates).map((item: any) => item.business_id) ?? []
|
|
102
102
|
const creditPointPlanOnBusiness = businessIds.every((bid: any) => loyalBusinessIds.includes(bid)) && creditPointPlan
|
|
103
103
|
|
|
104
104
|
const loyaltyRewardValue = creditPointPlanOnBusiness?.accumulation_rate
|
|
@@ -46,6 +46,7 @@ const OrderSummaryUI = (props: any) => {
|
|
|
46
46
|
preorderMaximumDays,
|
|
47
47
|
preorderMinimumDays,
|
|
48
48
|
cateringTypes,
|
|
49
|
+
hideDeliveryFee,
|
|
49
50
|
loyaltyRewardRate,
|
|
50
51
|
maxDate
|
|
51
52
|
} = props;
|
|
@@ -243,10 +244,10 @@ const OrderSummaryUI = (props: any) => {
|
|
|
243
244
|
</OSTable>
|
|
244
245
|
))
|
|
245
246
|
}
|
|
246
|
-
{orderState?.options?.type === 1 && cart?.
|
|
247
|
+
{orderState?.options?.type === 1 && cart?.delivery_price_with_discount > 0 && !hideDeliveryFee && (
|
|
247
248
|
<OSTable>
|
|
248
249
|
<OText size={12}>{t('DELIVERY_FEE', 'Delivery Fee')}</OText>
|
|
249
|
-
<OText size={12}>{parsePrice(cart?.
|
|
250
|
+
<OText size={12}>{parsePrice(cart?.delivery_price_with_discount)}</OText>
|
|
250
251
|
</OSTable>
|
|
251
252
|
)}
|
|
252
253
|
{
|
|
@@ -63,7 +63,11 @@ const PageBannerUI = (props: any) => {
|
|
|
63
63
|
businessSlug: slug,
|
|
64
64
|
businessId: action.business_id,
|
|
65
65
|
categoryId: action.category_id,
|
|
66
|
-
productId: action.product_id
|
|
66
|
+
productId: action.product_id,
|
|
67
|
+
isRedirect: 'business',
|
|
68
|
+
business: {
|
|
69
|
+
store: slug
|
|
70
|
+
}
|
|
67
71
|
})
|
|
68
72
|
}
|
|
69
73
|
const clickedBanner = pageBannerState.result.find(banner => banner.id === item?.banner_id)
|
|
@@ -121,33 +125,37 @@ const PageBannerUI = (props: any) => {
|
|
|
121
125
|
<>
|
|
122
126
|
{pageBannerState.banner?.items && pageBannerState.banner?.items.length > 0 && (
|
|
123
127
|
<PageBannerWrapper>
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
128
|
+
{pageBannerState.banner?.items.length > 1 && (
|
|
129
|
+
<>
|
|
130
|
+
<TouchableOpacity
|
|
131
|
+
style={[styles.swiperButton, { left: 25 }]}
|
|
132
|
+
onPress={() => carouselRef.current.snapToPrev()}
|
|
133
|
+
>
|
|
134
|
+
<IconAntDesign
|
|
135
|
+
name="caretleft"
|
|
136
|
+
color={theme.colors.white}
|
|
137
|
+
size={13}
|
|
138
|
+
/>
|
|
139
|
+
</TouchableOpacity>
|
|
140
|
+
<TouchableOpacity
|
|
141
|
+
style={[styles.swiperButton, { right: 25 }]}
|
|
142
|
+
onPress={() => carouselRef.current.snapToNext()}
|
|
143
|
+
>
|
|
144
|
+
<IconAntDesign
|
|
145
|
+
name="caretright"
|
|
146
|
+
color={theme.colors.white}
|
|
147
|
+
size={13}
|
|
148
|
+
/>
|
|
149
|
+
</TouchableOpacity>
|
|
150
|
+
</>
|
|
151
|
+
)}
|
|
144
152
|
<Carousel
|
|
145
153
|
ref={carouselRef}
|
|
146
154
|
loop={pageBannerState.banner?.items.length > 1}
|
|
147
155
|
data={pageBannerState.banner?.items}
|
|
148
156
|
renderItem={renderItem}
|
|
149
|
-
sliderWidth={windowWidth
|
|
150
|
-
itemWidth={windowWidth
|
|
157
|
+
sliderWidth={windowWidth}
|
|
158
|
+
itemWidth={windowWidth}
|
|
151
159
|
inactiveSlideScale={1}
|
|
152
160
|
pagingEnabled
|
|
153
161
|
removeClippedSubviews={false}
|
|
@@ -242,7 +242,7 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
242
242
|
<ListItem onPress={() => navigation.navigate('Notifications', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
243
243
|
<NotificationBadge style={{ borderRadius: 100 / 2 }} />
|
|
244
244
|
<Ionicons name='notifications-outline' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
245
|
-
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('
|
|
245
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('MARKETING_NOTIFICATIONS', 'Marketing notifications')}
|
|
246
246
|
</OText>
|
|
247
247
|
<NotificationsWrapper>
|
|
248
248
|
<ToggleSwitch
|