ordering-ui-react-native 0.16.5-release → 0.16.6-release
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/themes/original/src/components/DriverTips/index.tsx +4 -4
- package/themes/original/src/components/DriverTips/styles.tsx +2 -1
- package/themes/original/src/components/MyOrders/index.tsx +48 -3
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +5 -1
- package/themes/original/src/components/OrdersOption/index.tsx +3 -1
- package/themes/original/src/components/UserProfile/index.tsx +8 -1
- package/themes/original/src/types/index.tsx +3 -0
package/package.json
CHANGED
|
@@ -35,8 +35,8 @@ const DriverTipsUI = (props: any) => {
|
|
|
35
35
|
const theme = useTheme();
|
|
36
36
|
|
|
37
37
|
const style = StyleSheet.create({
|
|
38
|
-
|
|
39
|
-
borderRadius:
|
|
38
|
+
semicircle: {
|
|
39
|
+
borderRadius: 8
|
|
40
40
|
},
|
|
41
41
|
inputStyle: {
|
|
42
42
|
flex: 1,
|
|
@@ -75,10 +75,10 @@ const DriverTipsUI = (props: any) => {
|
|
|
75
75
|
onPress={() => handlerChangeOption(option)}
|
|
76
76
|
>
|
|
77
77
|
<DTCard
|
|
78
|
-
style={style.
|
|
78
|
+
style={style.semicircle}
|
|
79
79
|
isActive={option === optionSelected}
|
|
80
80
|
>
|
|
81
|
-
<OText size={12} numberOfLines={
|
|
81
|
+
<OText size={12} numberOfLines={2} color={option === optionSelected ? '#FFF' : theme.colors.textSecondary}>
|
|
82
82
|
{`${isFixedPrice ? parsePrice(option) : `${option}%`}`}
|
|
83
83
|
</OText>
|
|
84
84
|
</DTCard>
|
|
@@ -26,11 +26,12 @@ export const DTCard = styled.View`
|
|
|
26
26
|
text-transform: capitalize;
|
|
27
27
|
min-height: 55px;
|
|
28
28
|
min-width: 55px;
|
|
29
|
-
max-width:
|
|
29
|
+
max-width: 80px;
|
|
30
30
|
max-height: 55px;
|
|
31
31
|
margin-right: 10px;
|
|
32
32
|
margin-left: 10px;
|
|
33
33
|
margin-top: 10px;
|
|
34
|
+
padding-horizontal: 10px;
|
|
34
35
|
|
|
35
36
|
${(props: any) => props.isActive && css`
|
|
36
37
|
background-color: ${(props: any) => props.theme.colors.primary};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
2
|
import { useLanguage } from 'ordering-components/native';
|
|
3
|
-
import { View, StyleSheet, RefreshControl } from 'react-native';
|
|
3
|
+
import { View, StyleSheet, RefreshControl, Platform } from 'react-native';
|
|
4
|
+
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
4
5
|
|
|
5
6
|
import { OrdersOption } from '../OrdersOption'
|
|
6
|
-
import { HeaderTitle, OText } from '../shared'
|
|
7
|
+
import { HeaderTitle, OButton, OText } from '../shared'
|
|
7
8
|
import { ScrollView } from 'react-native-gesture-handler';
|
|
8
9
|
import { Tab } from './styles'
|
|
9
10
|
import { useTheme } from 'styled-components/native';
|
|
@@ -11,6 +12,7 @@ import { Container } from '../../layouts/Container';
|
|
|
11
12
|
|
|
12
13
|
export const MyOrders = (props: any) => {
|
|
13
14
|
const {
|
|
15
|
+
navigation,
|
|
14
16
|
hideOrders,
|
|
15
17
|
businessesSearchList
|
|
16
18
|
} = props
|
|
@@ -33,6 +35,9 @@ export const MyOrders = (props: any) => {
|
|
|
33
35
|
{ key: 'business', value: t('BUSINESS', 'Business') },
|
|
34
36
|
{ key: 'products', value: t('PRODUCTS', 'Products') }
|
|
35
37
|
]
|
|
38
|
+
const isChewLayout = theme?.business_view?.components?.header?.components?.layout?.type === 'chew'
|
|
39
|
+
|
|
40
|
+
const goToBack = () => navigation?.canGoBack() && navigation.goBack()
|
|
36
41
|
|
|
37
42
|
const handleOnRefresh = () => {
|
|
38
43
|
setRefreshOrders(true);
|
|
@@ -67,7 +72,47 @@ export const MyOrders = (props: any) => {
|
|
|
67
72
|
onRefresh={() => handleOnRefresh()}
|
|
68
73
|
/>
|
|
69
74
|
}>
|
|
70
|
-
{
|
|
75
|
+
{isChewLayout && (
|
|
76
|
+
<View style={{
|
|
77
|
+
width: '100%',
|
|
78
|
+
display: 'flex',
|
|
79
|
+
flexDirection: 'row',
|
|
80
|
+
alignItems: 'center',
|
|
81
|
+
paddingHorizontal: 40
|
|
82
|
+
}}>
|
|
83
|
+
<OText
|
|
84
|
+
size={24}
|
|
85
|
+
style={{
|
|
86
|
+
marginTop: Platform.OS === 'android' ? 50 : 30,
|
|
87
|
+
paddingHorizontal: 20,
|
|
88
|
+
textTransform: 'capitalize'
|
|
89
|
+
}}
|
|
90
|
+
>
|
|
91
|
+
<OButton
|
|
92
|
+
imgLeftStyle={{ width: 18 }}
|
|
93
|
+
imgRightSrc={null}
|
|
94
|
+
style={{
|
|
95
|
+
borderWidth: 0,
|
|
96
|
+
width: 26,
|
|
97
|
+
height: 26,
|
|
98
|
+
backgroundColor: '#FFF',
|
|
99
|
+
borderColor: '#FFF',
|
|
100
|
+
shadowColor: '#FFF',
|
|
101
|
+
paddingLeft: 0,
|
|
102
|
+
paddingRight: 0,
|
|
103
|
+
}}
|
|
104
|
+
onClick={goToBack}
|
|
105
|
+
icon={AntDesignIcon}
|
|
106
|
+
iconProps={{
|
|
107
|
+
name: 'arrowleft',
|
|
108
|
+
size: 26
|
|
109
|
+
}}
|
|
110
|
+
/>
|
|
111
|
+
{t('MY_ORDERS', 'My Orders')}
|
|
112
|
+
</OText>
|
|
113
|
+
</View>
|
|
114
|
+
)}
|
|
115
|
+
{!hideOrders && !isChewLayout && (
|
|
71
116
|
<HeaderTitle text={t('MY_ORDERS', 'My Orders')} />
|
|
72
117
|
)}
|
|
73
118
|
{!allEmpty && (
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from 'react-native';
|
|
13
13
|
import { PreviousBusinessOrderedParams } from '../../../types';
|
|
14
14
|
|
|
15
|
-
const BusinessControllerList = ({ businesses, onBusinessClick, navigation, orderState, style }: any) => {
|
|
15
|
+
const BusinessControllerList = ({ businesses, onBusinessClick, navigation, orderState, handleCustomUpdate, style }: any) => {
|
|
16
16
|
return (
|
|
17
17
|
<>
|
|
18
18
|
{businesses?.result?.map((business: any, i: number) => (
|
|
@@ -31,6 +31,7 @@ const BusinessControllerList = ({ businesses, onBusinessClick, navigation, order
|
|
|
31
31
|
businessDeliveryTime={business?.delivery_time}
|
|
32
32
|
businessPickupTime={business?.pickup_time}
|
|
33
33
|
businessDistance={business?.distance}
|
|
34
|
+
handleCustomUpdate={handleCustomUpdate}
|
|
34
35
|
style={style}
|
|
35
36
|
/>
|
|
36
37
|
))}
|
|
@@ -92,6 +93,7 @@ export const PreviousBusinessOrdered = (props: PreviousBusinessOrderedParams) =>
|
|
|
92
93
|
businesses,
|
|
93
94
|
onNavigationRedirect,
|
|
94
95
|
isBusinessesSearchList,
|
|
96
|
+
handleUpdateBusinesses,
|
|
95
97
|
} = props
|
|
96
98
|
|
|
97
99
|
const [orderState] = useOrder()
|
|
@@ -117,6 +119,7 @@ export const PreviousBusinessOrdered = (props: PreviousBusinessOrderedParams) =>
|
|
|
117
119
|
orderState={orderState}
|
|
118
120
|
navigation={navigation}
|
|
119
121
|
businesses={businesses}
|
|
122
|
+
handleCustomUpdate={handleUpdateBusinesses}
|
|
120
123
|
/>
|
|
121
124
|
)}
|
|
122
125
|
</>
|
|
@@ -130,6 +133,7 @@ export const PreviousBusinessOrdered = (props: PreviousBusinessOrderedParams) =>
|
|
|
130
133
|
orderState={orderState}
|
|
131
134
|
navigation={navigation}
|
|
132
135
|
businesses={businesses}
|
|
136
|
+
handleCustomUpdate={handleUpdateBusinesses}
|
|
133
137
|
/>
|
|
134
138
|
)}
|
|
135
139
|
</ListWrapper>
|
|
@@ -49,7 +49,8 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
49
49
|
BusinessControllerSkeletons,
|
|
50
50
|
businesses,
|
|
51
51
|
businessPaginationProps,
|
|
52
|
-
handleUpdateProducts
|
|
52
|
+
handleUpdateProducts,
|
|
53
|
+
handleUpdateBusinesses
|
|
53
54
|
} = props
|
|
54
55
|
|
|
55
56
|
const theme = useTheme();
|
|
@@ -228,6 +229,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
228
229
|
onNavigationRedirect={onNavigationRedirect}
|
|
229
230
|
isBusinessesSearchList={!!businessesSearchList}
|
|
230
231
|
businesses={businesses}
|
|
232
|
+
handleUpdateBusinesses={handleUpdateBusinesses}
|
|
231
233
|
/>
|
|
232
234
|
)}
|
|
233
235
|
|
|
@@ -17,7 +17,7 @@ import { LanguageSelector } from '../LanguageSelector'
|
|
|
17
17
|
import MessageCircle from 'react-native-vector-icons/AntDesign'
|
|
18
18
|
import Ionicons from 'react-native-vector-icons/Ionicons'
|
|
19
19
|
import MaterialIcons from 'react-native-vector-icons/MaterialIcons'
|
|
20
|
-
import
|
|
20
|
+
import FontAwesome from 'react-native-vector-icons/FontAwesome'
|
|
21
21
|
import FastImage from 'react-native-fast-image'
|
|
22
22
|
import { OAlert } from '../../../../../src/components/shared'
|
|
23
23
|
|
|
@@ -111,6 +111,7 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
111
111
|
|
|
112
112
|
const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' && (configs?.wallet_cash_enabled?.value === '1' || configs?.wallet_credit_point_enabled?.value === '1')
|
|
113
113
|
const IsPromotionsEnabled = configs?.advanced_offers_module?.value === '1' || configs?.advanced_offers_module?.value === true
|
|
114
|
+
const isChewLayout = theme?.business_view?.components?.header?.components?.layout?.type === 'chew'
|
|
114
115
|
const onRedirect = (route: string, params?: any) => {
|
|
115
116
|
navigation.navigate(route, params)
|
|
116
117
|
}
|
|
@@ -199,6 +200,12 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
199
200
|
<MessageCircle name='message1' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
200
201
|
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('MESSAGES', 'Messages')}</OText>
|
|
201
202
|
</ListItem>
|
|
203
|
+
{isChewLayout && (
|
|
204
|
+
<ListItem onPress={() => onRedirect('MyOrders', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
205
|
+
<FontAwesome name='list-alt' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
206
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('MY_ORDERS', 'My Orders')}</OText>
|
|
207
|
+
</ListItem>
|
|
208
|
+
)}
|
|
202
209
|
{isWalletEnabled && (
|
|
203
210
|
<ListItem onPress={() => onRedirect('Wallets', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
204
211
|
<Ionicons name='wallet-outline' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
@@ -216,6 +216,7 @@ export interface BusinessControllerParams {
|
|
|
216
216
|
setFavoriteIds?: any;
|
|
217
217
|
handleUpdateBusinessList?: any;
|
|
218
218
|
enableIntersection?: boolean;
|
|
219
|
+
handleCustomUpdate?: (businessId: number, changes: any) => {};
|
|
219
220
|
}
|
|
220
221
|
export interface BusinessProductsListingParams {
|
|
221
222
|
navigation?: any;
|
|
@@ -362,6 +363,7 @@ export interface OrdersOptionParams {
|
|
|
362
363
|
setRefreshOrders?: (value: boolean) => void,
|
|
363
364
|
handleUpdateOrderList?: (orderId: number, changes: any) => {},
|
|
364
365
|
handleUpdateProducts?: (productId: number, changes: any) => {},
|
|
366
|
+
handleUpdateBusinesses?: (businessId: number, changes: any) => {},
|
|
365
367
|
isBusiness?: boolean,
|
|
366
368
|
isProducts?: boolean,
|
|
367
369
|
businessOrderIds?: any,
|
|
@@ -726,6 +728,7 @@ export interface PreviousBusinessOrderedParams {
|
|
|
726
728
|
isBusinessesSearchList?: any,
|
|
727
729
|
businessLoading?: boolean,
|
|
728
730
|
businesses?: any
|
|
731
|
+
handleUpdateBusinesses?: (businessId: number, changes: any) => {},
|
|
729
732
|
}
|
|
730
733
|
|
|
731
734
|
export interface ServiceFormParams {
|