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
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React, { useEffect } from 'react'
|
|
2
|
-
import { useLanguage, useUtils, useToast,
|
|
3
|
-
import { View, StyleSheet, BackHandler } from 'react-native'
|
|
2
|
+
import { useLanguage, useUtils, useToast, ToastType, MultiOrdersDetails as MultiOrdersDetailsController } from 'ordering-components/native'
|
|
3
|
+
import { View, StyleSheet, BackHandler, TouchableOpacity } from 'react-native'
|
|
4
4
|
import { useTheme } from 'styled-components/native'
|
|
5
5
|
import { OText, OButton } from '../shared'
|
|
6
6
|
import { Container } from '../../layouts/Container'
|
|
7
7
|
import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder'
|
|
8
8
|
import { SingleOrderCard } from './SingleOrderCard'
|
|
9
|
+
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
9
10
|
|
|
10
11
|
import {
|
|
11
12
|
OrdersDetailsContainer,
|
|
@@ -29,20 +30,20 @@ export const MultiOrdersDetailsUI = (props: any) => {
|
|
|
29
30
|
} = props
|
|
30
31
|
|
|
31
32
|
const theme = useTheme()
|
|
32
|
-
|
|
33
|
+
const styles = StyleSheet.create({
|
|
33
34
|
btnBackArrow: {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
borderWidth: 0,
|
|
36
|
+
backgroundColor: theme.colors.clear,
|
|
37
|
+
shadowColor: theme.colors.clear,
|
|
38
|
+
padding: 0,
|
|
38
39
|
marginLeft: -20
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
},
|
|
41
|
+
})
|
|
42
|
+
|
|
42
43
|
const { loading, orders, error } = props.ordersList
|
|
43
44
|
const [, t] = useLanguage()
|
|
44
45
|
const [{ parsePrice, parseNumber, parseDate }] = useUtils();
|
|
45
|
-
|
|
46
|
+
const [, { showToast }] = useToast();
|
|
46
47
|
|
|
47
48
|
const walletName: any = {
|
|
48
49
|
cash: {
|
|
@@ -60,7 +61,7 @@ export const MultiOrdersDetailsUI = (props: any) => {
|
|
|
60
61
|
}
|
|
61
62
|
navigation.navigate('BusinessList');
|
|
62
63
|
return true
|
|
63
|
-
|
|
64
|
+
}
|
|
64
65
|
|
|
65
66
|
const handleGoToOrderDetails = (uuid: any) => {
|
|
66
67
|
navigation.navigate('OrderDetails', { orderId: uuid })
|
|
@@ -68,7 +69,7 @@ export const MultiOrdersDetailsUI = (props: any) => {
|
|
|
68
69
|
|
|
69
70
|
useEffect(() => {
|
|
70
71
|
if (error) {
|
|
71
|
-
|
|
72
|
+
showToast(ToastType.Error, error)
|
|
72
73
|
}
|
|
73
74
|
}, [error])
|
|
74
75
|
|
|
@@ -83,11 +84,14 @@ export const MultiOrdersDetailsUI = (props: any) => {
|
|
|
83
84
|
<OrdersDetailsContainer keyboardShouldPersistTaps="handled" contentContainerStyle={{ paddingHorizontal: 40 }}>
|
|
84
85
|
<View style={{ flexDirection: 'row' }}>
|
|
85
86
|
<OButton
|
|
86
|
-
imgLeftSrc={theme.images.general.arrow_left}
|
|
87
87
|
imgRightSrc={null}
|
|
88
88
|
style={styles.btnBackArrow}
|
|
89
89
|
onClick={() => handleArrowBack()}
|
|
90
|
-
|
|
90
|
+
icon={AntDesignIcon}
|
|
91
|
+
iconProps={{
|
|
92
|
+
name: 'arrowleft',
|
|
93
|
+
size: 26
|
|
94
|
+
}}
|
|
91
95
|
/>
|
|
92
96
|
</View>
|
|
93
97
|
<Header>
|
|
@@ -202,7 +206,7 @@ export const MultiOrdersDetailsUI = (props: any) => {
|
|
|
202
206
|
</Row>
|
|
203
207
|
<Row>
|
|
204
208
|
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
|
|
205
|
-
|
|
209
|
+
{t('ESTIMATED_TAX_TO_BE_COLLECTED', 'Estimated tax to be collected')}:
|
|
206
210
|
</OText>
|
|
207
211
|
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
|
|
208
212
|
{parsePrice(ordersSummary?.tax)}
|
|
@@ -2,6 +2,7 @@ import * as React from 'react'
|
|
|
2
2
|
import styled, { useTheme } from 'styled-components/native'
|
|
3
3
|
import { OButton, OIcon, OText } from '../shared'
|
|
4
4
|
import { Platform, TextStyle, ViewStyle, I18nManager, TouchableOpacity } from 'react-native'
|
|
5
|
+
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
5
6
|
|
|
6
7
|
const TitleWrapper = styled.View`
|
|
7
8
|
flex-direction: column;
|
|
@@ -61,11 +62,16 @@ const NavBar = (props: Props) => {
|
|
|
61
62
|
return (
|
|
62
63
|
<Wrapper style={{ paddingTop: props.paddingTop, ...{ flexDirection: props.isVertical ? 'column' : 'row', alignItems: props.isVertical ? 'flex-start' : 'center' }, ...props.style }}>
|
|
63
64
|
<OButton
|
|
64
|
-
imgLeftSrc={props.leftImg
|
|
65
|
+
imgLeftSrc={props.leftImg}
|
|
65
66
|
imgLeftStyle={{ width: 18 }}
|
|
66
67
|
imgRightSrc={null}
|
|
67
68
|
style={{ ...btnBackArrow, ...props.btnStyle, ...props.isVertical ? (I18nManager.isRTL ? { paddingRight: 0 } : { paddingLeft: 0 }) : {} }}
|
|
68
69
|
onClick={props?.onActionLeft}
|
|
70
|
+
icon={AntDesignIcon}
|
|
71
|
+
iconProps={{
|
|
72
|
+
name: 'arrowleft',
|
|
73
|
+
size: 26
|
|
74
|
+
}}
|
|
69
75
|
/>
|
|
70
76
|
<TitleTopWrapper>
|
|
71
77
|
{props.withIcon
|
|
@@ -19,15 +19,16 @@ export const OrderItAgain = (props: OrderItAgainParams) => {
|
|
|
19
19
|
categoryState,
|
|
20
20
|
currentCart,
|
|
21
21
|
handleUpdateProducts,
|
|
22
|
-
navigation
|
|
22
|
+
navigation,
|
|
23
|
+
searchValue
|
|
23
24
|
} = props
|
|
24
25
|
|
|
25
26
|
const [, t] = useLanguage()
|
|
26
27
|
const theme = useTheme()
|
|
27
28
|
const { width } = Dimensions.get('window');
|
|
28
|
-
|
|
29
|
+
const productsFilterd = productList?.length > 0 && productList?.sort((a: any, b:any) => moment(b?.last_ordered_date).valueOf() - moment(a?.last_ordered_date).valueOf()).filter((product : any) => product?.name?.toLowerCase()?.includes(searchValue?.toLowerCase()))
|
|
29
30
|
return (
|
|
30
|
-
<Container>
|
|
31
|
+
<Container hide={productsFilterd?.length === 0}>
|
|
31
32
|
<OText
|
|
32
33
|
size={16}
|
|
33
34
|
lineHeight={24}
|
|
@@ -51,7 +52,7 @@ export const OrderItAgain = (props: OrderItAgainParams) => {
|
|
|
51
52
|
showsVerticalScrollIndicator={false}
|
|
52
53
|
showsHorizontalScrollIndicator={false}
|
|
53
54
|
>
|
|
54
|
-
{
|
|
55
|
+
{productsFilterd.map((product: any, i: number) => (
|
|
55
56
|
<ProductWrapper key={'prod_' + product.id + `_${i}`} style={{ width: width - 120, }}>
|
|
56
57
|
<SingleProductCard
|
|
57
58
|
isSoldOut={product.inventoried && !product.quantity}
|
|
@@ -11,6 +11,7 @@ import { OrderTypeSelectParams } from '../../types'
|
|
|
11
11
|
import { OIcon, OText } from '../shared'
|
|
12
12
|
import NavBar from '../NavBar';
|
|
13
13
|
import { ORDER_TYPES } from '../../config/constants';
|
|
14
|
+
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
14
15
|
|
|
15
16
|
const OrderTypeSelectorUI = (props: OrderTypeSelectParams) => {
|
|
16
17
|
const {
|
|
@@ -44,7 +45,7 @@ const OrderTypeSelectorUI = (props: OrderTypeSelectParams) => {
|
|
|
44
45
|
if (!orderState.loading) {
|
|
45
46
|
setOrderTypeValue && setOrderTypeValue(orderType)
|
|
46
47
|
handleChangeOrderType(orderType)
|
|
47
|
-
if(!isChewLayout){
|
|
48
|
+
if (!isChewLayout) {
|
|
48
49
|
goToBack();
|
|
49
50
|
}
|
|
50
51
|
}
|
|
@@ -58,7 +59,7 @@ const OrderTypeSelectorUI = (props: OrderTypeSelectParams) => {
|
|
|
58
59
|
horizontal
|
|
59
60
|
showsHorizontalScrollIndicator={false}
|
|
60
61
|
>
|
|
61
|
-
{chewOrderTypes?.map((type
|
|
62
|
+
{chewOrderTypes?.map((type: any) => (
|
|
62
63
|
<TabBtn
|
|
63
64
|
key={type.value}
|
|
64
65
|
onPress={() => handleChangeOrderTypeCallback(type.value)}
|
|
@@ -108,7 +109,7 @@ const OrderTypeSelectorUI = (props: OrderTypeSelectParams) => {
|
|
|
108
109
|
<OText size={10} lineHeight={15} color={theme.colors.white}>{item?.description}</OText>
|
|
109
110
|
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
110
111
|
<OText size={10} lineHeight={15} color={theme.colors.white}>{t('START_MY_ORDER', 'Start my order')}</OText>
|
|
111
|
-
<
|
|
112
|
+
<AntDesignIcon name='arrowleft' size={26} color={theme.colors.white} style={{ transform: [{ rotate: '180deg' }], marginStart: 4 }} />
|
|
112
113
|
</View>
|
|
113
114
|
</MaskCont>
|
|
114
115
|
</BgImage>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { useOrder } from 'ordering-components/native'
|
|
3
3
|
import { BusinessController } from '../../BusinessController'
|
|
4
4
|
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
|
|
5
5
|
|
|
@@ -12,30 +12,93 @@ import {
|
|
|
12
12
|
} from 'react-native';
|
|
13
13
|
import { PreviousBusinessOrderedParams } from '../../../types';
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
const BusinessControllerList = ({ businesses, onBusinessClick, navigation, orderState, style }: any) => {
|
|
16
|
+
return (
|
|
17
|
+
<>
|
|
18
|
+
{businesses?.result?.map((business: any, i: number) => (
|
|
19
|
+
<BusinessController
|
|
20
|
+
key={`${business.id}_` + i}
|
|
21
|
+
business={business}
|
|
22
|
+
isBusinessOpen={business.open}
|
|
23
|
+
handleCustomClick={() => onBusinessClick(business)}
|
|
24
|
+
orderType={orderState?.options?.type}
|
|
25
|
+
navigation={navigation}
|
|
26
|
+
businessHeader={business?.header}
|
|
27
|
+
businessFeatured={business?.featured}
|
|
28
|
+
businessLogo={business?.logo}
|
|
29
|
+
businessReviews={business?.reviews}
|
|
30
|
+
businessDeliveryPrice={business?.delivery_price}
|
|
31
|
+
businessDeliveryTime={business?.delivery_time}
|
|
32
|
+
businessPickupTime={business?.pickup_time}
|
|
33
|
+
businessDistance={business?.distance}
|
|
34
|
+
style={style}
|
|
35
|
+
/>
|
|
36
|
+
))}
|
|
37
|
+
</>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const BusinessSkeletons = () => {
|
|
42
|
+
return (
|
|
43
|
+
<>
|
|
44
|
+
{[...Array(4).keys()].map((item, i) => (
|
|
45
|
+
<Placeholder
|
|
46
|
+
Animation={Fade}
|
|
47
|
+
key={i}
|
|
48
|
+
style={{ marginBottom: 20 }}>
|
|
49
|
+
<View style={{ width: '100%' }}>
|
|
50
|
+
<PlaceholderLine
|
|
51
|
+
height={200}
|
|
52
|
+
style={{ marginBottom: 20, borderRadius: 25 }}
|
|
53
|
+
/>
|
|
54
|
+
<View style={{ paddingHorizontal: 10 }}>
|
|
55
|
+
<View
|
|
56
|
+
style={{
|
|
57
|
+
flexDirection: 'row',
|
|
58
|
+
justifyContent: 'space-between',
|
|
59
|
+
}}>
|
|
60
|
+
<PlaceholderLine
|
|
61
|
+
height={25}
|
|
62
|
+
width={40}
|
|
63
|
+
style={{ marginBottom: 10 }}
|
|
64
|
+
/>
|
|
65
|
+
<PlaceholderLine
|
|
66
|
+
height={25}
|
|
67
|
+
width={20}
|
|
68
|
+
style={{ marginBottom: 10 }}
|
|
69
|
+
/>
|
|
70
|
+
</View>
|
|
71
|
+
<PlaceholderLine
|
|
72
|
+
height={20}
|
|
73
|
+
width={30}
|
|
74
|
+
style={{ marginBottom: 10 }}
|
|
75
|
+
/>
|
|
76
|
+
<PlaceholderLine
|
|
77
|
+
height={20}
|
|
78
|
+
width={80}
|
|
79
|
+
style={{ marginBottom: 10 }}
|
|
80
|
+
/>
|
|
81
|
+
</View>
|
|
82
|
+
</View>
|
|
83
|
+
</Placeholder>
|
|
84
|
+
))}
|
|
85
|
+
</>
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export const PreviousBusinessOrdered = (props: PreviousBusinessOrderedParams) => {
|
|
16
90
|
const {
|
|
17
91
|
navigation,
|
|
18
|
-
|
|
19
|
-
setBusinessLoading,
|
|
20
|
-
businessId,
|
|
92
|
+
businesses,
|
|
21
93
|
onNavigationRedirect,
|
|
22
94
|
isBusinessesSearchList,
|
|
23
|
-
businessLoading
|
|
24
95
|
} = props
|
|
25
96
|
|
|
26
97
|
const [orderState] = useOrder()
|
|
27
98
|
const windowWidth = Dimensions.get('window').width;
|
|
28
|
-
|
|
29
99
|
const onBusinessClick = (business: any) => {
|
|
30
100
|
onNavigationRedirect('Business', { store: business.slug })
|
|
31
101
|
}
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
if (businessesList?.loading && businessesList?.businesses?.length === 0) {
|
|
34
|
-
setBusinessLoading(true)
|
|
35
|
-
} else {
|
|
36
|
-
setBusinessLoading(false)
|
|
37
|
-
}
|
|
38
|
-
}, [businessesList?.loading])
|
|
39
102
|
|
|
40
103
|
const styles = StyleSheet.create({
|
|
41
104
|
container: {
|
|
@@ -43,95 +106,31 @@ export const PreviousBusinessOrderedUI = (props: PreviousBusinessOrderedParams)
|
|
|
43
106
|
},
|
|
44
107
|
});
|
|
45
108
|
|
|
46
|
-
const BusinessControllerList = ({ style }: any) => {
|
|
47
|
-
return (
|
|
48
|
-
<>
|
|
49
|
-
{businessesList.businesses?.filter((business: any) => businessId?.includes(business?.id))?.map((business: any, i: number) => (
|
|
50
|
-
<BusinessController
|
|
51
|
-
key={`${business.id}_` + i}
|
|
52
|
-
business={business}
|
|
53
|
-
isBusinessOpen={business.open}
|
|
54
|
-
handleCustomClick={() => onBusinessClick(business)}
|
|
55
|
-
orderType={orderState?.options?.type}
|
|
56
|
-
navigation={navigation}
|
|
57
|
-
businessHeader={business?.header}
|
|
58
|
-
businessFeatured={business?.featured}
|
|
59
|
-
businessLogo={business?.logo}
|
|
60
|
-
businessReviews={business?.reviews}
|
|
61
|
-
businessDeliveryPrice={business?.delivery_price}
|
|
62
|
-
businessDeliveryTime={business?.delivery_time}
|
|
63
|
-
businessPickupTime={business?.pickup_time}
|
|
64
|
-
businessDistance={business?.distance}
|
|
65
|
-
style={style}
|
|
66
|
-
/>
|
|
67
|
-
))}
|
|
68
|
-
</>
|
|
69
|
-
)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const BusinessSkeletons = () => {
|
|
73
|
-
return (
|
|
74
|
-
<>
|
|
75
|
-
{[...Array(4).keys()].map((item, i) => (
|
|
76
|
-
<Placeholder
|
|
77
|
-
Animation={Fade}
|
|
78
|
-
key={i}
|
|
79
|
-
style={{ marginBottom: 20 }}>
|
|
80
|
-
<View style={{ width: '100%' }}>
|
|
81
|
-
<PlaceholderLine
|
|
82
|
-
height={200}
|
|
83
|
-
style={{ marginBottom: 20, borderRadius: 25 }}
|
|
84
|
-
/>
|
|
85
|
-
<View style={{ paddingHorizontal: 10 }}>
|
|
86
|
-
<View
|
|
87
|
-
style={{
|
|
88
|
-
flexDirection: 'row',
|
|
89
|
-
justifyContent: 'space-between',
|
|
90
|
-
}}>
|
|
91
|
-
<PlaceholderLine
|
|
92
|
-
height={25}
|
|
93
|
-
width={40}
|
|
94
|
-
style={{ marginBottom: 10 }}
|
|
95
|
-
/>
|
|
96
|
-
<PlaceholderLine
|
|
97
|
-
height={25}
|
|
98
|
-
width={20}
|
|
99
|
-
style={{ marginBottom: 10 }}
|
|
100
|
-
/>
|
|
101
|
-
</View>
|
|
102
|
-
<PlaceholderLine
|
|
103
|
-
height={20}
|
|
104
|
-
width={30}
|
|
105
|
-
style={{ marginBottom: 10 }}
|
|
106
|
-
/>
|
|
107
|
-
<PlaceholderLine
|
|
108
|
-
height={20}
|
|
109
|
-
width={80}
|
|
110
|
-
style={{ marginBottom: 10 }}
|
|
111
|
-
/>
|
|
112
|
-
</View>
|
|
113
|
-
</View>
|
|
114
|
-
</Placeholder>
|
|
115
|
-
))}
|
|
116
|
-
</>
|
|
117
|
-
)
|
|
118
|
-
}
|
|
119
|
-
|
|
120
109
|
return (
|
|
121
110
|
<ScrollView horizontal={isBusinessesSearchList} style={styles.container} showsVerticalScrollIndicator={false}>
|
|
122
111
|
{isBusinessesSearchList ? (
|
|
123
112
|
<>
|
|
124
|
-
{!
|
|
113
|
+
{!businesses?.loading && (
|
|
125
114
|
<BusinessControllerList
|
|
126
115
|
style={{ width: windowWidth - 120, marginRight: 20 }}
|
|
116
|
+
onBusinessClick={onBusinessClick}
|
|
117
|
+
orderState={orderState}
|
|
118
|
+
navigation={navigation}
|
|
119
|
+
businesses={businesses}
|
|
127
120
|
/>
|
|
128
121
|
)}
|
|
129
122
|
</>
|
|
130
123
|
) : (
|
|
131
124
|
<ListWrapper>
|
|
132
|
-
|
|
133
|
-
{businessesList.loading && (
|
|
125
|
+
{businesses?.loading ? (
|
|
134
126
|
<BusinessSkeletons />
|
|
127
|
+
) : (
|
|
128
|
+
<BusinessControllerList
|
|
129
|
+
onBusinessClick={onBusinessClick}
|
|
130
|
+
orderState={orderState}
|
|
131
|
+
navigation={navigation}
|
|
132
|
+
businesses={businesses}
|
|
133
|
+
/>
|
|
135
134
|
)}
|
|
136
135
|
</ListWrapper>
|
|
137
136
|
)}
|
|
@@ -139,15 +138,3 @@ export const PreviousBusinessOrderedUI = (props: PreviousBusinessOrderedParams)
|
|
|
139
138
|
</ScrollView>
|
|
140
139
|
)
|
|
141
140
|
}
|
|
142
|
-
|
|
143
|
-
export const PreviousBusinessOrdered = (props: PreviousBusinessOrderedParams) => {
|
|
144
|
-
const previousBusinessOrderedController = {
|
|
145
|
-
...props,
|
|
146
|
-
UIComponent: PreviousBusinessOrderedUI,
|
|
147
|
-
paginationSettings: { initialPage: 1, pageSize: 50, controlType: 'infinity' }
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
return (
|
|
151
|
-
<BusinessListController {...previousBusinessOrderedController} />
|
|
152
|
-
)
|
|
153
|
-
}
|
|
@@ -47,6 +47,8 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
47
47
|
businessesSearchList,
|
|
48
48
|
hideOrders,
|
|
49
49
|
BusinessControllerSkeletons,
|
|
50
|
+
businesses,
|
|
51
|
+
businessPaginationProps
|
|
50
52
|
} = props
|
|
51
53
|
|
|
52
54
|
const theme = useTheme();
|
|
@@ -141,9 +143,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
141
143
|
|
|
142
144
|
useFocusEffect(
|
|
143
145
|
React.useCallback(() => {
|
|
144
|
-
|
|
145
|
-
loadOrders(false, false, false, true)
|
|
146
|
-
}
|
|
146
|
+
loadOrders(false, false, false, true)
|
|
147
147
|
}, [navigation])
|
|
148
148
|
)
|
|
149
149
|
|
|
@@ -215,23 +215,20 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
215
215
|
)}
|
|
216
216
|
</>
|
|
217
217
|
)}
|
|
218
|
-
{isBusiness && !!businessesSearchList &&
|
|
218
|
+
{isBusiness && !!businessesSearchList && businesses?.loading && (
|
|
219
219
|
<ScrollView horizontal>
|
|
220
|
-
<BusinessControllerSkeletons />
|
|
220
|
+
<BusinessControllerSkeletons paginationProps={businessPaginationProps} />
|
|
221
221
|
</ScrollView>
|
|
222
222
|
)}
|
|
223
|
-
{isBusiness &&
|
|
223
|
+
{isBusiness && (
|
|
224
224
|
<PreviousBusinessOrdered
|
|
225
|
-
businessId={businessOrderIds}
|
|
226
|
-
businessLoading={businessLoading}
|
|
227
|
-
setBusinessLoading={setBusinessLoading}
|
|
228
225
|
onNavigationRedirect={onNavigationRedirect}
|
|
229
|
-
isLoadingOrders={loading}
|
|
230
226
|
isBusinessesSearchList={!!businessesSearchList}
|
|
227
|
+
businesses={businesses}
|
|
231
228
|
/>
|
|
232
229
|
)}
|
|
233
230
|
|
|
234
|
-
{isProducts && (
|
|
231
|
+
{isProducts && !loading && (
|
|
235
232
|
<PreviousProductsOrdered
|
|
236
233
|
products={products}
|
|
237
234
|
onProductClick={onProductClick}
|
|
@@ -240,9 +237,9 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
240
237
|
)}
|
|
241
238
|
{(loading && isProducts) && (
|
|
242
239
|
<>
|
|
243
|
-
{[...Array(4).keys()].map(
|
|
240
|
+
{[...Array(!!businessesSearchList ? 1 : 4).keys()].map(
|
|
244
241
|
(item, i) => (
|
|
245
|
-
<Placeholder key={i} style={{ padding: 5, paddingLeft: 40 }} Animation={Fade}>
|
|
242
|
+
<Placeholder key={i} style={{ padding: 5, paddingLeft: !!businessesSearchList ? 0 : 40, marginBottom: !!businessesSearchList ? 38 : 0 }} Animation={Fade}>
|
|
246
243
|
<View style={{ flexDirection: 'row' }}>
|
|
247
244
|
<PlaceholderLine
|
|
248
245
|
width={24}
|
|
@@ -458,7 +458,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
458
458
|
<SafeAreaView style={{ flex: 1 }}>
|
|
459
459
|
<TopHeader>
|
|
460
460
|
<TopActions onPress={() => handleGoBack()}>
|
|
461
|
-
<
|
|
461
|
+
<IconAntDesign name='arrowleft' size={26} />
|
|
462
462
|
</TopActions>
|
|
463
463
|
</TopHeader>
|
|
464
464
|
{!error && (
|
|
@@ -981,7 +981,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
981
981
|
<OText size={16} lineHeight={24} weight={'600'}>
|
|
982
982
|
{productCart.total ? parsePrice(productCart?.total) : ''}
|
|
983
983
|
</OText>
|
|
984
|
-
{product?.minimum_per_order && productCart?.quantity <= product?.minimum_per_order && <OText size={12} color={theme.colors?.red}>{t('MOBILE_MINIMUM_TO_ORDER', 'Min. _number_ ').replace('_number_', product?.minimum_per_order)}</OText>}
|
|
984
|
+
{product?.minimum_per_order && productCart?.quantity <= product?.minimum_per_order && productCart?.quantity !== 1 && <OText size={12} color={theme.colors?.red}>{t('MOBILE_MINIMUM_TO_ORDER', 'Min. _number_ ').replace('_number_', product?.minimum_per_order)}</OText>}
|
|
985
985
|
{product?.maximum_per_order && productCart?.quantity >= product?.maximum_per_order && <OText size={12} color={theme.colors?.red}>{t('MOBILE_MAXIMUM_TO_ORDER', 'Max. _number_'.replace('_number_', product?.maximum_per_order))}</OText>}
|
|
986
986
|
</View>
|
|
987
987
|
{productCart && !isSoldOut && maxProductQuantity > 0 && (
|
|
@@ -1031,7 +1031,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
1031
1031
|
disabled={
|
|
1032
1032
|
maxProductQuantity <= 0 ||
|
|
1033
1033
|
productCart.quantity >= maxProductQuantity ||
|
|
1034
|
-
productCart.quantity >= product?.maximum_per_order ||
|
|
1034
|
+
(productCart.quantity >= product?.maximum_per_order && product?.maximum_per_order) ||
|
|
1035
1035
|
isSoldOut
|
|
1036
1036
|
}>
|
|
1037
1037
|
<OIcon
|
|
@@ -1040,7 +1040,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
1040
1040
|
color={
|
|
1041
1041
|
maxProductQuantity <= 0 ||
|
|
1042
1042
|
productCart.quantity >= maxProductQuantity ||
|
|
1043
|
-
productCart.quantity >= product?.maximum_per_order ||
|
|
1043
|
+
(productCart.quantity >= product?.maximum_per_order && product?.maximum_per_order) ||
|
|
1044
1044
|
isSoldOut
|
|
1045
1045
|
? theme.colors.backgroundGray
|
|
1046
1046
|
: theme.colors.backgroundDark
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
useLanguage,
|
|
4
4
|
useConfig,
|
|
@@ -42,8 +42,6 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
|
|
|
42
42
|
const theme = useTheme();
|
|
43
43
|
const hideAddButton = theme?.business_view?.components?.products?.components?.add_to_cart_button?.hidden ?? true
|
|
44
44
|
|
|
45
|
-
const fadeAnim = useRef(new Animated.Value(enableIntersection ? 0 : 1)).current;
|
|
46
|
-
|
|
47
45
|
const styles = StyleSheet.create({
|
|
48
46
|
container: {
|
|
49
47
|
borderWidth: 1,
|
|
@@ -123,14 +121,6 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
|
|
|
123
121
|
maxCartProductConfig,
|
|
124
122
|
maxCartProductInventory,
|
|
125
123
|
);
|
|
126
|
-
|
|
127
|
-
const fadeIn = () => {
|
|
128
|
-
Animated.timing(fadeAnim, {
|
|
129
|
-
toValue: 1,
|
|
130
|
-
duration: 500,
|
|
131
|
-
useNativeDriver: true
|
|
132
|
-
}).start();
|
|
133
|
-
};
|
|
134
124
|
|
|
135
125
|
const handleChangeFavorite = () => {
|
|
136
126
|
if (auth) {
|
|
@@ -143,14 +133,9 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
|
|
|
143
133
|
const handleChangeIntersection = () => {
|
|
144
134
|
if (enableIntersection) {
|
|
145
135
|
setIsIntersectionObserver(true);
|
|
146
|
-
fadeIn();
|
|
147
136
|
}
|
|
148
137
|
}
|
|
149
138
|
|
|
150
|
-
useEffect(() => {
|
|
151
|
-
if (enableIntersection) fadeIn()
|
|
152
|
-
}, [enableIntersection])
|
|
153
|
-
|
|
154
139
|
return (
|
|
155
140
|
<InView style={{ minHeight: hideAddButton ? 125 : 165 }} triggerOnce={true} onChange={(inView: boolean) => handleChangeIntersection()}>
|
|
156
141
|
{isIntersectionObserver ? (
|
|
@@ -238,23 +223,14 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
|
|
|
238
223
|
</RibbonBox>
|
|
239
224
|
)}
|
|
240
225
|
{product?.images && (
|
|
241
|
-
<
|
|
242
|
-
style={
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
<FastImage
|
|
250
|
-
style={styles.productStyle}
|
|
251
|
-
source={{
|
|
252
|
-
uri: optimizeImage(product?.images, 'h_250,c_limit'),
|
|
253
|
-
priority: FastImage.priority.normal,
|
|
254
|
-
}}
|
|
255
|
-
resizeMode={FastImage.resizeMode.cover}
|
|
256
|
-
/>
|
|
257
|
-
</Animated.View>
|
|
226
|
+
<FastImage
|
|
227
|
+
style={styles.productStyle}
|
|
228
|
+
source={{
|
|
229
|
+
uri: optimizeImage(product?.images, 'h_250,c_limit'),
|
|
230
|
+
priority: FastImage.priority.normal,
|
|
231
|
+
}}
|
|
232
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
233
|
+
/>
|
|
258
234
|
)}
|
|
259
235
|
</LogoWrapper>
|
|
260
236
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
|
-
import { Platform, StyleSheet, View } from 'react-native'
|
|
2
|
+
import { Platform, StyleSheet, TouchableOpacity, View } from 'react-native'
|
|
3
3
|
import {
|
|
4
4
|
UpsellingPage as UpsellingPageController,
|
|
5
5
|
useUtils,
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
import { OrderSummary } from '../OrderSummary';
|
|
22
22
|
import { ScrollView } from 'react-native-gesture-handler';
|
|
23
23
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
24
|
+
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
24
25
|
|
|
25
26
|
const UpsellingProductsUI = (props: UpsellingProductsParams) => {
|
|
26
27
|
const {
|
|
@@ -161,11 +162,14 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
|
|
|
161
162
|
<>
|
|
162
163
|
<View style={{ ...styles.headerItem, flex: 1, marginTop: Platform.OS == 'ios' ? 35 : 70 }}>
|
|
163
164
|
<OButton
|
|
164
|
-
imgLeftSrc={theme.images.general.arrow_left}
|
|
165
165
|
imgRightSrc={null}
|
|
166
166
|
style={styles.btnBackArrow}
|
|
167
167
|
onClick={() => onGoBack()}
|
|
168
|
-
|
|
168
|
+
icon={AntDesignIcon}
|
|
169
|
+
iconProps={{
|
|
170
|
+
name: 'arrowleft',
|
|
171
|
+
size: 26
|
|
172
|
+
}}
|
|
169
173
|
/>
|
|
170
174
|
</View>
|
|
171
175
|
<ScrollView style={{ marginTop: 10, marginBottom: props.isPage ? 40 : bottom + (Platform.OS == 'ios' ? 96 : 130) }} showsVerticalScrollIndicator={false}>
|