ordering-ui-react-native 0.16.83 → 0.16.84
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/BusinessProductsList/index.tsx +4 -4
- package/themes/original/src/components/BusinessController/index.tsx +1 -23
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +3 -3
- package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
- package/themes/original/src/components/BusinessListingSearch/index.tsx +11 -115
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +4 -12
- package/themes/original/src/components/BusinessProductsList/index.tsx +1 -0
- package/themes/original/src/components/CartContent/index.tsx +3 -3
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +8 -3
- package/themes/original/src/components/HelpGuide/index.tsx +8 -3
- package/themes/original/src/components/HelpOrder/index.tsx +8 -3
- package/themes/original/src/components/Messages/index.tsx +17 -17
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -16
- package/themes/original/src/components/NavBar/index.tsx +7 -1
- package/themes/original/src/components/OrderItAgain/index.tsx +5 -4
- package/themes/original/src/components/OrderTypeSelector/index.tsx +4 -3
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +91 -104
- package/themes/original/src/components/OrdersOption/index.tsx +10 -13
- package/themes/original/src/components/ProductForm/index.tsx +4 -4
- package/themes/original/src/components/SingleProductCard/index.tsx +9 -33
- package/themes/original/src/components/UpsellingProducts/index.tsx +7 -3
- package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
- package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
- package/themes/original/src/components/Wallets/index.tsx +172 -162
- package/themes/original/src/components/Wallets/styles.tsx +10 -8
- package/themes/original/src/components/shared/OButton.tsx +8 -3
- package/themes/original/src/types/index.tsx +6 -2
package/package.json
CHANGED
|
@@ -68,9 +68,9 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
|
|
|
68
68
|
|
|
69
69
|
{
|
|
70
70
|
!category.id && categories && categories.filter(category => category.id !== null).map((category, i, _categories) => {
|
|
71
|
-
const products = categoryState.products?.filter((product: any) =>
|
|
71
|
+
const products = categoryState.products?.filter((product: any) => category?.children?.some((cat: any) => cat?.category_id === product?.category_id)) || []
|
|
72
72
|
return (
|
|
73
|
-
<View key={category.id} style={{alignItems: 'flex-start', flex:1}}>
|
|
73
|
+
<View key={category.id} style={{ alignItems: 'flex-start', flex: 1 }}>
|
|
74
74
|
{
|
|
75
75
|
products.length > 0 && (
|
|
76
76
|
<>
|
|
@@ -104,8 +104,8 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
|
|
|
104
104
|
<View style={{ flexDirection: 'row' }}>
|
|
105
105
|
<PlaceholderLine width={24} height={70} style={{ marginRight: 10, marginBottom: 10 }} />
|
|
106
106
|
<Placeholder style={{ paddingVertical: 10 }}>
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
<PlaceholderLine width={60} style={{ marginBottom: 25 }} />
|
|
108
|
+
<PlaceholderLine width={20} />
|
|
109
109
|
</Placeholder>
|
|
110
110
|
</View>
|
|
111
111
|
</Placeholder>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
|
|
3
3
|
import {
|
|
4
4
|
BusinessController as BusinessSingleCard,
|
|
@@ -59,7 +59,6 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
59
59
|
const [, t] = useLanguage();
|
|
60
60
|
const theme = useTheme()
|
|
61
61
|
const [isIntersectionObserver, setIsIntersectionObserver] = useState(!enableIntersection)
|
|
62
|
-
const fadeAnim = useRef(new Animated.Value(0)).current;
|
|
63
62
|
|
|
64
63
|
const styles = StyleSheet.create({
|
|
65
64
|
headerStyle: {
|
|
@@ -146,23 +145,10 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
146
145
|
}
|
|
147
146
|
}
|
|
148
147
|
|
|
149
|
-
const fadeIn = () => {
|
|
150
|
-
Animated.timing(fadeAnim, {
|
|
151
|
-
toValue: 1,
|
|
152
|
-
duration: 500,
|
|
153
|
-
useNativeDriver: true
|
|
154
|
-
}).start();
|
|
155
|
-
};
|
|
156
|
-
|
|
157
148
|
const handleChangeInterSection = (inView: boolean) => {
|
|
158
149
|
setIsIntersectionObserver(inView)
|
|
159
|
-
fadeIn()
|
|
160
150
|
}
|
|
161
151
|
|
|
162
|
-
useEffect(() => {
|
|
163
|
-
if (!enableIntersection) fadeIn()
|
|
164
|
-
}, [enableIntersection])
|
|
165
|
-
|
|
166
152
|
return (
|
|
167
153
|
<InView style={{ minHeight: 200 }} triggerOnce={true} onChange={(inView: boolean) => handleChangeInterSection(inView)}>
|
|
168
154
|
{isIntersectionObserver ? (
|
|
@@ -186,13 +172,6 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
186
172
|
</RibbonBox>
|
|
187
173
|
)}
|
|
188
174
|
<BusinessHero>
|
|
189
|
-
<Animated.View
|
|
190
|
-
style={[
|
|
191
|
-
{
|
|
192
|
-
opacity: fadeAnim
|
|
193
|
-
}
|
|
194
|
-
]}
|
|
195
|
-
>
|
|
196
175
|
<FastImage
|
|
197
176
|
style={{ height: 120 }}
|
|
198
177
|
source={{
|
|
@@ -201,7 +180,6 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
201
180
|
}}
|
|
202
181
|
resizeMode={FastImage.resizeMode.cover}
|
|
203
182
|
/>
|
|
204
|
-
</Animated.View>
|
|
205
183
|
{(businessFeatured ?? business?.featured) && (
|
|
206
184
|
<View style={styles.featured}>
|
|
207
185
|
<FontAwesomeIcon name="crown" size={26} color="gold" />
|
|
@@ -41,10 +41,10 @@ export const BusinessItemAccordion = (props: any) => {
|
|
|
41
41
|
useEffect(() => {
|
|
42
42
|
const cartsArray = Object.values(orderState?.carts)
|
|
43
43
|
const cartsLength = cartsArray.filter((cart: any) => cart.products.length > 0).length ?? 0
|
|
44
|
-
if (
|
|
45
|
-
setActiveState(
|
|
44
|
+
if (cartsLength === 1) {
|
|
45
|
+
setActiveState(!isClosed)
|
|
46
46
|
}
|
|
47
|
-
}, [orderState?.carts])
|
|
47
|
+
}, [orderState?.carts, isClosed])
|
|
48
48
|
|
|
49
49
|
return (
|
|
50
50
|
<BIContainer isClosed={isClosed} isMultiCheckout={isMultiCheckout} checkoutVisible={!isActive && !isClosed && !!isProducts && !checkoutButtonDisabled}>
|
package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { View } from 'react-native'
|
|
3
|
+
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder'
|
|
4
|
+
|
|
5
|
+
export const BusinessControllerSkeletons = ({ paginationProps }: any) => {
|
|
6
|
+
return (
|
|
7
|
+
<>
|
|
8
|
+
{[
|
|
9
|
+
...Array(
|
|
10
|
+
paginationProps.nextPageItems
|
|
11
|
+
? paginationProps.nextPageItems
|
|
12
|
+
: 3,
|
|
13
|
+
).keys(),
|
|
14
|
+
].map((item, i) => (
|
|
15
|
+
<Placeholder
|
|
16
|
+
Animation={Fade}
|
|
17
|
+
key={i}
|
|
18
|
+
style={{ width: 320, marginRight: 20, marginTop: 20 }}>
|
|
19
|
+
<View style={{ width: 320 }}>
|
|
20
|
+
<PlaceholderLine
|
|
21
|
+
height={155}
|
|
22
|
+
style={{ marginBottom: 20, borderRadius: 25 }}
|
|
23
|
+
/>
|
|
24
|
+
<View style={{ paddingHorizontal: 10 }}>
|
|
25
|
+
<View
|
|
26
|
+
style={{
|
|
27
|
+
flexDirection: 'row',
|
|
28
|
+
justifyContent: 'space-between',
|
|
29
|
+
}}>
|
|
30
|
+
<PlaceholderLine
|
|
31
|
+
height={25}
|
|
32
|
+
width={40}
|
|
33
|
+
style={{ marginBottom: 10 }}
|
|
34
|
+
/>
|
|
35
|
+
<PlaceholderLine
|
|
36
|
+
height={25}
|
|
37
|
+
width={20}
|
|
38
|
+
style={{ marginBottom: 10 }}
|
|
39
|
+
/>
|
|
40
|
+
</View>
|
|
41
|
+
<PlaceholderLine
|
|
42
|
+
height={20}
|
|
43
|
+
width={30}
|
|
44
|
+
style={{ marginBottom: 10 }}
|
|
45
|
+
/>
|
|
46
|
+
<PlaceholderLine
|
|
47
|
+
height={20}
|
|
48
|
+
width={80}
|
|
49
|
+
style={{ marginBottom: 0 }}
|
|
50
|
+
/>
|
|
51
|
+
</View>
|
|
52
|
+
</View>
|
|
53
|
+
</Placeholder>
|
|
54
|
+
))}
|
|
55
|
+
</>
|
|
56
|
+
)
|
|
57
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { useLanguage, useUtils } from 'ordering-components/native'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { View, TouchableOpacity, StyleSheet } from 'react-native'
|
|
4
|
+
import { OText } from '../../shared'
|
|
5
|
+
|
|
6
|
+
import { ProgressContentWrapper, ProgressBar } from './styles'
|
|
7
|
+
|
|
8
|
+
export const MaxSectionItem = (props: any) => {
|
|
9
|
+
const {
|
|
10
|
+
filters,
|
|
11
|
+
handleChangeFilters,
|
|
12
|
+
title,
|
|
13
|
+
options,
|
|
14
|
+
filter
|
|
15
|
+
} = props
|
|
16
|
+
|
|
17
|
+
const [, t] = useLanguage()
|
|
18
|
+
const [{ parsePrice }] = useUtils();
|
|
19
|
+
|
|
20
|
+
const styles = StyleSheet.create({
|
|
21
|
+
maxContainer: {
|
|
22
|
+
flexDirection: 'row',
|
|
23
|
+
justifyContent: 'space-between'
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const parseValue = (option: number) => {
|
|
28
|
+
return filter === 'max_distance'
|
|
29
|
+
? `${option / 1000} ${t('KM', 'Km')}`
|
|
30
|
+
: filter === 'max_eta'
|
|
31
|
+
? `${option} ${t('MIN', 'min')}`
|
|
32
|
+
: parsePrice(option)
|
|
33
|
+
}
|
|
34
|
+
return (
|
|
35
|
+
<View style={{ marginBottom: 20 }}>
|
|
36
|
+
<OText weight='bold' mBottom={10} size={16}>
|
|
37
|
+
{title}
|
|
38
|
+
</OText>
|
|
39
|
+
<ProgressContentWrapper>
|
|
40
|
+
<ProgressBar style={{ width: `${((options.indexOf(filters?.[filter]) / 3) * 100) ?? 100}%` }} />
|
|
41
|
+
</ProgressContentWrapper>
|
|
42
|
+
<View style={styles.maxContainer}>
|
|
43
|
+
{options.map((option: any, i: number) => (
|
|
44
|
+
<TouchableOpacity
|
|
45
|
+
onPress={() => handleChangeFilters(filter, option)}
|
|
46
|
+
key={option}
|
|
47
|
+
>
|
|
48
|
+
<OText
|
|
49
|
+
size={12}
|
|
50
|
+
weight={filters?.[filter] === option || (option === 'default' && (filters?.[filter] === 'default' || !filters?.[filter])) ? 'bold' : '500'}
|
|
51
|
+
>
|
|
52
|
+
{option === 'default' ? `${parseValue(options[i - 1])}+` : parseValue(option)}
|
|
53
|
+
</OText>
|
|
54
|
+
</TouchableOpacity>
|
|
55
|
+
))}
|
|
56
|
+
</View>
|
|
57
|
+
</View>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import styled from 'styled-components/native';
|
|
2
|
+
|
|
3
|
+
export const ProgressBar = styled.View`
|
|
4
|
+
height: 4px;
|
|
5
|
+
background: ${(props: any) => props.theme.colors.textNormal};
|
|
6
|
+
`
|
|
7
|
+
|
|
8
|
+
export const ProgressContentWrapper = styled.View`
|
|
9
|
+
height: 4px;
|
|
10
|
+
background: #F8F9FA;
|
|
11
|
+
margin-bottom: 10px;
|
|
12
|
+
flex: 1;
|
|
13
|
+
`
|
|
@@ -3,7 +3,7 @@ import { useLanguage, BusinessSearchList, useOrder, useUtils, showToast, ToastTy
|
|
|
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'
|
|
6
|
-
import { OButton,
|
|
6
|
+
import { OButton, OModal, OText } from '../shared'
|
|
7
7
|
import { SearchBar } from '../SearchBar';
|
|
8
8
|
import { BusinessController } from '../BusinessController'
|
|
9
9
|
import { NotFoundSource } from '../NotFoundSource'
|
|
@@ -19,14 +19,13 @@ import {
|
|
|
19
19
|
Metadata,
|
|
20
20
|
SingleBusinessContainer,
|
|
21
21
|
LoadMoreBusinessContainer,
|
|
22
|
-
ProgressContentWrapper,
|
|
23
|
-
ProgressBar,
|
|
24
22
|
TagsContainer,
|
|
25
23
|
SortContainer,
|
|
26
24
|
BrandContainer,
|
|
27
25
|
BrandItem,
|
|
28
26
|
PriceFilterWrapper,
|
|
29
|
-
OptionTitle
|
|
27
|
+
OptionTitle,
|
|
28
|
+
BContainer
|
|
30
29
|
} from './styles'
|
|
31
30
|
import FastImage from 'react-native-fast-image'
|
|
32
31
|
import { convertHoursToMinutes } from '../../utils'
|
|
@@ -34,8 +33,8 @@ import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder'
|
|
|
34
33
|
import { BusinessSearchParams } from '../../types'
|
|
35
34
|
import { MyOrders } from '../MyOrders'
|
|
36
35
|
import { useIsFocused } from '@react-navigation/native';
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
import { MaxSectionItem } from './MaxSectionItem'
|
|
37
|
+
import { BusinessControllerSkeletons } from './BusinessControllerSkeletons'
|
|
39
38
|
export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
40
39
|
const {
|
|
41
40
|
navigation,
|
|
@@ -101,10 +100,6 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
101
100
|
productsContainer: {
|
|
102
101
|
marginTop: 20
|
|
103
102
|
},
|
|
104
|
-
maxContainer: {
|
|
105
|
-
flexDirection: 'row',
|
|
106
|
-
justifyContent: 'space-between'
|
|
107
|
-
},
|
|
108
103
|
businessTypesContainer: {
|
|
109
104
|
width: '100%',
|
|
110
105
|
flexDirection: 'row',
|
|
@@ -220,116 +215,16 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
220
215
|
handleSearchbusinessAndProducts(true)
|
|
221
216
|
}, [])
|
|
222
217
|
|
|
223
|
-
|
|
218
|
+
|
|
224
219
|
useEffect(() => {
|
|
225
220
|
handleChangeTermValue('')
|
|
226
221
|
}, [isFocused])
|
|
227
222
|
|
|
228
|
-
const MaxSectionItem = ({ title, options, filter }: any) => {
|
|
229
|
-
const parseValue = (option: number) => {
|
|
230
|
-
return filter === 'max_distance'
|
|
231
|
-
? `${option / 1000} ${t('KM', 'Km')}`
|
|
232
|
-
: filter === 'max_eta'
|
|
233
|
-
? `${option} ${t('MIN', 'min')}`
|
|
234
|
-
: parsePrice(option)
|
|
235
|
-
}
|
|
236
|
-
return (
|
|
237
|
-
<View style={{ marginBottom: 20 }}>
|
|
238
|
-
<OText weight='bold' mBottom={10} size={16}>
|
|
239
|
-
{title}
|
|
240
|
-
</OText>
|
|
241
|
-
<ProgressContentWrapper>
|
|
242
|
-
<ProgressBar style={{ width: `${((options.indexOf(filters?.[filter]) / 3) * 100) ?? 100}%` }} />
|
|
243
|
-
</ProgressContentWrapper>
|
|
244
|
-
<View style={styles.maxContainer}>
|
|
245
|
-
{options.map((option: any, i: number) => (
|
|
246
|
-
<TouchableOpacity
|
|
247
|
-
onPress={() => handleChangeFilters(filter, option)}
|
|
248
|
-
key={option}
|
|
249
|
-
>
|
|
250
|
-
<OText
|
|
251
|
-
size={12}
|
|
252
|
-
weight={filters?.[filter] === option || (option === 'default' && (filters?.[filter] === 'default' || !filters?.[filter])) ? 'bold' : '500'}
|
|
253
|
-
>
|
|
254
|
-
{option === 'default' ? `${parseValue(options[i - 1])}+` : parseValue(option)}
|
|
255
|
-
</OText>
|
|
256
|
-
</TouchableOpacity>
|
|
257
|
-
))}
|
|
258
|
-
</View>
|
|
259
|
-
</View>
|
|
260
|
-
)
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
const BusinessControllerSkeletons = () => {
|
|
264
|
-
return (
|
|
265
|
-
<>
|
|
266
|
-
{[
|
|
267
|
-
...Array(
|
|
268
|
-
paginationProps.nextPageItems
|
|
269
|
-
? paginationProps.nextPageItems
|
|
270
|
-
: 3,
|
|
271
|
-
).keys(),
|
|
272
|
-
].map((item, i) => (
|
|
273
|
-
<Placeholder
|
|
274
|
-
Animation={Fade}
|
|
275
|
-
key={i}
|
|
276
|
-
style={{ width: 320, marginRight: 20, marginTop: 20 }}>
|
|
277
|
-
<View style={{ width: 320 }}>
|
|
278
|
-
<PlaceholderLine
|
|
279
|
-
height={155}
|
|
280
|
-
style={{ marginBottom: 20, borderRadius: 25 }}
|
|
281
|
-
/>
|
|
282
|
-
<View style={{ paddingHorizontal: 10 }}>
|
|
283
|
-
<View
|
|
284
|
-
style={{
|
|
285
|
-
flexDirection: 'row',
|
|
286
|
-
justifyContent: 'space-between',
|
|
287
|
-
}}>
|
|
288
|
-
<PlaceholderLine
|
|
289
|
-
height={25}
|
|
290
|
-
width={40}
|
|
291
|
-
style={{ marginBottom: 10 }}
|
|
292
|
-
/>
|
|
293
|
-
<PlaceholderLine
|
|
294
|
-
height={25}
|
|
295
|
-
width={20}
|
|
296
|
-
style={{ marginBottom: 10 }}
|
|
297
|
-
/>
|
|
298
|
-
</View>
|
|
299
|
-
<PlaceholderLine
|
|
300
|
-
height={20}
|
|
301
|
-
width={30}
|
|
302
|
-
style={{ marginBottom: 10 }}
|
|
303
|
-
/>
|
|
304
|
-
<PlaceholderLine
|
|
305
|
-
height={20}
|
|
306
|
-
width={80}
|
|
307
|
-
style={{ marginBottom: 0 }}
|
|
308
|
-
/>
|
|
309
|
-
</View>
|
|
310
|
-
</View>
|
|
311
|
-
</Placeholder>
|
|
312
|
-
))}
|
|
313
|
-
</>
|
|
314
|
-
)
|
|
315
|
-
}
|
|
316
|
-
|
|
317
223
|
return (
|
|
318
|
-
<
|
|
319
|
-
<WrapHeader style={{ paddingTop: top + 20, marginVertical: 2 }}>
|
|
320
|
-
<OText
|
|
321
|
-
size={20}
|
|
322
|
-
mBottom={15}
|
|
323
|
-
weight='bold'
|
|
324
|
-
style={{ marginTop: 10 }}
|
|
325
|
-
>
|
|
326
|
-
{t('SEARCH', 'Search')}
|
|
327
|
-
</OText>
|
|
328
|
-
</WrapHeader>
|
|
224
|
+
<BContainer>
|
|
329
225
|
<SearchWrapper>
|
|
330
226
|
{isFocused && (
|
|
331
227
|
<SearchBar
|
|
332
|
-
autoFocus
|
|
333
228
|
lazyLoad
|
|
334
229
|
inputStyle={{ ...styles.searchInput, ...Platform.OS === 'ios' ? {} : { paddingBottom: 4 } }}
|
|
335
230
|
placeholder={`${t('SEARCH_BUSINESSES', 'Search Businesses')} / ${t('TYPE_AT_LEAST_3_CHARACTERS', 'type at least 3 characters')}`}
|
|
@@ -348,12 +243,13 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
348
243
|
</View>
|
|
349
244
|
)
|
|
350
245
|
}
|
|
351
|
-
{businessesSearchList.businesses?.length > 0 && (
|
|
246
|
+
{businessesSearchList.businesses?.length > 0 && termValue?.length === 0 && (
|
|
352
247
|
<MyOrders
|
|
353
248
|
hideOrders
|
|
354
249
|
businessesSearchList={businessesSearchList}
|
|
355
250
|
onNavigationRedirect={onNavigationRedirect}
|
|
356
251
|
BusinessControllerSkeletons={BusinessControllerSkeletons}
|
|
252
|
+
businessPaginationProps={paginationProps}
|
|
357
253
|
/>
|
|
358
254
|
)}
|
|
359
255
|
|
|
@@ -387,7 +283,7 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
387
283
|
</LoadMoreBusinessContainer>
|
|
388
284
|
)}
|
|
389
285
|
{businessesSearchList.loading && (
|
|
390
|
-
<BusinessControllerSkeletons />
|
|
286
|
+
<BusinessControllerSkeletons paginationProps={paginationProps} />
|
|
391
287
|
)}
|
|
392
288
|
</ScrollView>
|
|
393
289
|
<ProductsList>
|
|
@@ -630,7 +526,7 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
630
526
|
onClick={() => handleApplyFilters()}
|
|
631
527
|
/>
|
|
632
528
|
</OModal>
|
|
633
|
-
</
|
|
529
|
+
</BContainer>
|
|
634
530
|
)
|
|
635
531
|
}
|
|
636
532
|
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components/native'
|
|
2
2
|
|
|
3
|
+
export const BContainer = styled.View`
|
|
4
|
+
padding: 20px 40px;
|
|
5
|
+
`
|
|
6
|
+
|
|
3
7
|
export const WrapHeader = styled.View`
|
|
4
8
|
width: 100%;
|
|
5
9
|
padding-vertical: 20px;
|
|
@@ -55,18 +59,6 @@ export const LoadMoreBusinessContainer = styled.View`
|
|
|
55
59
|
margin-left: 20px;
|
|
56
60
|
`
|
|
57
61
|
|
|
58
|
-
export const ProgressBar = styled.View`
|
|
59
|
-
height: 4px;
|
|
60
|
-
background: ${(props: any) => props.theme.colors.textNormal};
|
|
61
|
-
`
|
|
62
|
-
|
|
63
|
-
export const ProgressContentWrapper = styled.View`
|
|
64
|
-
height: 4px;
|
|
65
|
-
background: #F8F9FA;
|
|
66
|
-
margin-bottom: 10px;
|
|
67
|
-
flex: 1;
|
|
68
|
-
`
|
|
69
|
-
|
|
70
62
|
export const TagsContainer = styled.View`
|
|
71
63
|
padding-bottom: 10px;
|
|
72
64
|
`
|
|
@@ -30,10 +30,10 @@ export const CartContent = (props: any) => {
|
|
|
30
30
|
{cart.products.length > 0 && (
|
|
31
31
|
<>
|
|
32
32
|
<Cart
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
singleBusiness={props.singleBusiness}
|
|
34
|
+
isFranchiseApp={props.isFranchiseApp}
|
|
35
35
|
cart={cart}
|
|
36
|
-
|
|
36
|
+
cartuuid={cart.uuid}
|
|
37
37
|
onNavigationRedirect={props.onNavigationRedirect}
|
|
38
38
|
isCartsLoading={isCartsLoading}
|
|
39
39
|
setIsCartsLoading={setIsCartsLoading}
|
|
@@ -3,7 +3,8 @@ import { useLanguage } from 'ordering-components/native'
|
|
|
3
3
|
import { HelpAccountAndPaymentParams } from '../../types'
|
|
4
4
|
import { OText, OButton, OIcon } from '../shared'
|
|
5
5
|
import { useTheme } from 'styled-components/native'
|
|
6
|
-
import { StyleSheet } from 'react-native'
|
|
6
|
+
import { StyleSheet, TouchableOpacity } from 'react-native'
|
|
7
|
+
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
7
8
|
|
|
8
9
|
import {
|
|
9
10
|
Content
|
|
@@ -38,10 +39,14 @@ export const HelpAccountAndPayment = (props: HelpAccountAndPaymentParams) => {
|
|
|
38
39
|
return (
|
|
39
40
|
<>
|
|
40
41
|
<OButton
|
|
41
|
-
imgLeftSrc={theme.images.general.arrow_left}
|
|
42
42
|
imgRightSrc={null}
|
|
43
43
|
style={styles.btnBackArrow}
|
|
44
44
|
onClick={() => goToBack()}
|
|
45
|
+
icon={AntDesignIcon}
|
|
46
|
+
iconProps={{
|
|
47
|
+
name: 'arrowleft',
|
|
48
|
+
size: 26
|
|
49
|
+
}}
|
|
45
50
|
/>
|
|
46
51
|
<OText size={22} weight={600}>{t('ACCOUNT_PAYMENT_OPTIONS', 'Account and Payment Options')}</OText>
|
|
47
52
|
<Content>
|
|
@@ -65,4 +70,4 @@ export const HelpAccountAndPayment = (props: HelpAccountAndPaymentParams) => {
|
|
|
65
70
|
</Content>
|
|
66
71
|
</>
|
|
67
72
|
)
|
|
68
|
-
}
|
|
73
|
+
}
|
|
@@ -3,10 +3,11 @@ import { useLanguage } from 'ordering-components/native'
|
|
|
3
3
|
import { HelpGuideParams } from '../../types'
|
|
4
4
|
import { OText, OButton, OIcon } from '../shared'
|
|
5
5
|
import { useTheme } from 'styled-components/native'
|
|
6
|
-
import { StyleSheet } from 'react-native'
|
|
6
|
+
import { StyleSheet, TouchableOpacity } from 'react-native'
|
|
7
7
|
import {
|
|
8
8
|
Content
|
|
9
9
|
} from './styles'
|
|
10
|
+
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
10
11
|
|
|
11
12
|
export const HelpGuide = (props: HelpGuideParams) => {
|
|
12
13
|
const {
|
|
@@ -37,10 +38,14 @@ export const HelpGuide = (props: HelpGuideParams) => {
|
|
|
37
38
|
return (
|
|
38
39
|
<>
|
|
39
40
|
<OButton
|
|
40
|
-
imgLeftSrc={theme.images.general.arrow_left}
|
|
41
41
|
imgRightSrc={null}
|
|
42
42
|
style={styles.btnBackArrow}
|
|
43
43
|
onClick={() => goToBack()}
|
|
44
|
+
icon={AntDesignIcon}
|
|
45
|
+
iconProps={{
|
|
46
|
+
name: 'arrowleft',
|
|
47
|
+
size: 26
|
|
48
|
+
}}
|
|
44
49
|
/>
|
|
45
50
|
<OText size={22} weight={600}>{t('GUIDE_TO_ORDERING', 'Guide to Ordering')}</OText>
|
|
46
51
|
<Content>
|
|
@@ -64,4 +69,4 @@ export const HelpGuide = (props: HelpGuideParams) => {
|
|
|
64
69
|
</Content>
|
|
65
70
|
</>
|
|
66
71
|
)
|
|
67
|
-
}
|
|
72
|
+
}
|
|
@@ -3,8 +3,9 @@ import { useLanguage } from 'ordering-components/native'
|
|
|
3
3
|
import { HelpOrderParams } from '../../types'
|
|
4
4
|
import { OText, OButton, OIcon } from '../shared'
|
|
5
5
|
import { useTheme } from 'styled-components/native'
|
|
6
|
-
import { StyleSheet } from 'react-native'
|
|
6
|
+
import { StyleSheet, TouchableOpacity } from 'react-native'
|
|
7
7
|
import { WebView } from 'react-native-webview'
|
|
8
|
+
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
8
9
|
|
|
9
10
|
import {
|
|
10
11
|
Content
|
|
@@ -42,10 +43,14 @@ export const HelpOrder = (props: HelpOrderParams) => {
|
|
|
42
43
|
return (
|
|
43
44
|
<>
|
|
44
45
|
<OButton
|
|
45
|
-
imgLeftSrc={theme.images.general.arrow_left}
|
|
46
46
|
imgRightSrc={null}
|
|
47
47
|
style={styles.btnBackArrow}
|
|
48
48
|
onClick={() => goToBack()}
|
|
49
|
+
icon={AntDesignIcon}
|
|
50
|
+
iconProps={{
|
|
51
|
+
name: 'arrowleft',
|
|
52
|
+
size: 26
|
|
53
|
+
}}
|
|
49
54
|
/>
|
|
50
55
|
<OText size={22} weight={600}>{t('HELP_WITH_ORDER', 'Help with an order')}</OText>
|
|
51
56
|
<Content>
|
|
@@ -76,4 +81,4 @@ export const HelpOrder = (props: HelpOrderParams) => {
|
|
|
76
81
|
</Content>
|
|
77
82
|
</>
|
|
78
83
|
)
|
|
79
|
-
}
|
|
84
|
+
}
|
|
@@ -5,6 +5,7 @@ import { launchImageLibrary } from 'react-native-image-picker'
|
|
|
5
5
|
import { GiftedChat, Actions, ActionsProps, InputToolbar, Composer, Send, Bubble, MessageImage, InputToolbarProps, ComposerProps } from 'react-native-gifted-chat'
|
|
6
6
|
import { USER_TYPE } from '../../config/constants'
|
|
7
7
|
import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons'
|
|
8
|
+
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
8
9
|
import { OIcon, OIconButton, OText, OButton } from '../shared'
|
|
9
10
|
import { TouchableOpacity, ActivityIndicator, StyleSheet, View, Platform, Keyboard } from 'react-native'
|
|
10
11
|
import { Header, TitleHeader, Wrapper, QuickMessageContainer, ProfileMessageHeader, MessageTypeItem } from './styles'
|
|
@@ -36,7 +37,7 @@ const ORDER_STATUS: any = {
|
|
|
36
37
|
20: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
|
|
37
38
|
21: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
|
|
38
39
|
22: 'ORDER_LOOKING_FOR_DRIVER',
|
|
39
|
-
|
|
40
|
+
23: 'ORDER_DRIVER_ON_WAY'
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
const filterSpecialStatus = ['prepared_in', 'delivered_in', 'delivery_datetime']
|
|
@@ -122,18 +123,17 @@ const MessagesUI = (props: MessagesParams) => {
|
|
|
122
123
|
|
|
123
124
|
const messageConsole = (message: any) => {
|
|
124
125
|
return message.change?.attribute !== 'driver_id'
|
|
125
|
-
?
|
|
126
|
-
`${t('ORDER', 'Order')} ${t(message.change.attribute.toUpperCase(), message.change.attribute.replace('_', ' '))} ${t('CHANGED_FROM', 'Changed from')} ${
|
|
127
|
-
filterSpecialStatus.includes(message.change.attribute) ?
|
|
128
|
-
`${message.change.old === null ? '0' : message.change.old} ${t('TO', 'to')} ${message.change.new} ${t('MINUTES', 'Minutes')}` :
|
|
129
|
-
`${message.change.old !== null && t(ORDER_STATUS[parseInt(message.change.old, 10)])} ${t('TO', 'to')} ${t(ORDER_STATUS[parseInt(message.change.new, 10)])}`
|
|
130
|
-
}`
|
|
131
|
-
: message.change.new
|
|
132
126
|
?
|
|
133
|
-
`${
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
127
|
+
`${t('ORDER', 'Order')} ${t(message.change.attribute.toUpperCase(), message.change.attribute.replace('_', ' '))} ${t('CHANGED_FROM', 'Changed from')} ${filterSpecialStatus.includes(message.change.attribute) ?
|
|
128
|
+
`${message.change.old === null ? '0' : message.change.old} ${t('TO', 'to')} ${message.change.new} ${t('MINUTES', 'Minutes')}` :
|
|
129
|
+
`${message.change.old !== null && t(ORDER_STATUS[parseInt(message.change.old, 10)])} ${t('TO', 'to')} ${t(ORDER_STATUS[parseInt(message.change.new, 10)])}`
|
|
130
|
+
}`
|
|
131
|
+
: message.change.new
|
|
132
|
+
?
|
|
133
|
+
`${message.driver?.name} ${message.driver?.lastname !== null ? message.driver.lastname : ''} ${t('WAS_ASSIGNED_AS_DRIVER', 'Was assigned as driver')} ${message.comment ? message.comment.length : ''}`
|
|
134
|
+
:
|
|
135
|
+
`${t('DRIVER_UNASSIGNED', 'Driver unassigned')}`
|
|
136
|
+
}
|
|
137
137
|
|
|
138
138
|
useEffect(() => {
|
|
139
139
|
let newMessages: Array<any> = []
|
|
@@ -402,7 +402,9 @@ const MessagesUI = (props: MessagesParams) => {
|
|
|
402
402
|
<Wrapper>
|
|
403
403
|
{!isMeesageListing ? (
|
|
404
404
|
<Header>
|
|
405
|
-
<
|
|
405
|
+
<TouchableOpacity onPress={onClose} style={{ paddingStart: 10, borderColor: theme.colors.clear }}>
|
|
406
|
+
<AntDesignIcon name='arrowleft' size={26} />
|
|
407
|
+
</TouchableOpacity>
|
|
406
408
|
<View style={{ marginRight: 10, shadowColor: theme.colors.black, shadowOpacity: 0.1, shadowOffset: { width: 0, height: 1 }, shadowRadius: 2 }}>
|
|
407
409
|
<OIcon
|
|
408
410
|
url={type === USER_TYPE.DRIVER ? order?.driver?.photo : order?.business?.logo}
|
|
@@ -419,10 +421,8 @@ const MessagesUI = (props: MessagesParams) => {
|
|
|
419
421
|
) : (
|
|
420
422
|
<ProfileMessageHeader>
|
|
421
423
|
<View style={{ ...styles.headerTitle }}>
|
|
422
|
-
<TouchableOpacity
|
|
423
|
-
|
|
424
|
-
onPress={onClose}>
|
|
425
|
-
<OIcon src={theme.images.general.arrow_left} width={16} />
|
|
424
|
+
<TouchableOpacity onPress={onClose} style={styles.headerItem}>
|
|
425
|
+
<AntDesignIcon name='arrowleft' size={26} />
|
|
426
426
|
</TouchableOpacity>
|
|
427
427
|
<OText size={18}>{t('ORDER', theme?.defaultLanguages?.ORDER || 'Order')} #{order?.id}</OText>
|
|
428
428
|
</View>
|