ordering-ui-react-native 0.16.59 → 0.16.60
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/UserFormDetails/index.tsx +5 -2
- package/themes/business/src/components/UserProfileForm/index.tsx +2 -0
- package/themes/business/src/types/index.tsx +1 -0
- package/themes/original/src/components/BusinessProductsListing/index.tsx +1 -1
- package/themes/original/src/components/OrderTypeSelector/index.tsx +77 -35
- package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
- package/themes/original/src/components/shared/OBottomPopup.tsx +5 -3
- package/themes/original/src/types/index.tsx +4 -1
package/package.json
CHANGED
|
@@ -36,6 +36,7 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
36
36
|
handleCancelEdit,
|
|
37
37
|
toggleIsEdit,
|
|
38
38
|
isCheckout,
|
|
39
|
+
isAlsea
|
|
39
40
|
} = props;
|
|
40
41
|
|
|
41
42
|
const theme = useTheme();
|
|
@@ -265,7 +266,9 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
265
266
|
}).map(
|
|
266
267
|
(field: any) =>
|
|
267
268
|
showField &&
|
|
268
|
-
showField(field.code) &&
|
|
269
|
+
showField(field.code) &&
|
|
270
|
+
!isAlsea
|
|
271
|
+
&& (
|
|
269
272
|
<React.Fragment key={field.id}>
|
|
270
273
|
<OText style={styles.label}>
|
|
271
274
|
{t(field?.code.toUpperCase(), field?.name)}
|
|
@@ -442,7 +445,7 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
442
445
|
</OText>
|
|
443
446
|
)}
|
|
444
447
|
|
|
445
|
-
{!!showInputPhoneNumber && (
|
|
448
|
+
{!!showInputPhoneNumber && !isAlsea && (
|
|
446
449
|
<WrapperPhone>
|
|
447
450
|
<PhoneInputNumber
|
|
448
451
|
data={phoneInputData}
|
|
@@ -49,6 +49,7 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
49
49
|
handleToggleAvalaibleStatusDriver,
|
|
50
50
|
userState,
|
|
51
51
|
isAvailableLoading,
|
|
52
|
+
isAlsea
|
|
52
53
|
} = props;
|
|
53
54
|
|
|
54
55
|
const [{ user }] = useSession();
|
|
@@ -459,6 +460,7 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
459
460
|
hideUpdateButton
|
|
460
461
|
handleCancelEdit={handleCancelEdit}
|
|
461
462
|
toggleIsEdit={toggleIsEdit}
|
|
463
|
+
isAlsea={isAlsea}
|
|
462
464
|
/>
|
|
463
465
|
</View>
|
|
464
466
|
)}
|
|
@@ -277,7 +277,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
277
277
|
</WrapSearchBar>
|
|
278
278
|
)}
|
|
279
279
|
</TopHeader>
|
|
280
|
-
{showBusinessNearCity && (
|
|
280
|
+
{showBusinessNearCity && businessState?.business?.city_id && (
|
|
281
281
|
<NearBusiness>
|
|
282
282
|
<BusinessesListing
|
|
283
283
|
logosLayout
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from 'ordering-components/native'
|
|
7
7
|
import { useTheme } from 'styled-components/native';
|
|
8
8
|
import { Platform, View } from 'react-native'
|
|
9
|
-
import { BgImage, ListWrapper, MaskCont, OrderTypeWrapper, Wrapper } from './styles'
|
|
9
|
+
import { BgImage, ListWrapper, MaskCont, OrderTypeWrapper, OTab, OTabs, TabBtn, Wrapper } from './styles'
|
|
10
10
|
import { OrderTypeSelectParams } from '../../types'
|
|
11
11
|
import { OIcon, OText } from '../shared'
|
|
12
12
|
import NavBar from '../NavBar';
|
|
@@ -20,14 +20,16 @@ const OrderTypeSelectorUI = (props: OrderTypeSelectParams) => {
|
|
|
20
20
|
defaultValue,
|
|
21
21
|
configTypes,
|
|
22
22
|
orderTypes,
|
|
23
|
-
setOrderTypeValue
|
|
23
|
+
setOrderTypeValue,
|
|
24
|
+
isChewLayout,
|
|
25
|
+
chewOrderTypes
|
|
24
26
|
} = props
|
|
25
27
|
|
|
26
28
|
const theme = useTheme();
|
|
27
29
|
const [orderState] = useOrder();
|
|
28
30
|
const [, t] = useLanguage();
|
|
29
31
|
const _orderTypes = orderTypes.filter((type: any) => configTypes?.includes(type.value));
|
|
30
|
-
|
|
32
|
+
|
|
31
33
|
const items = _orderTypes.map((type) => {
|
|
32
34
|
return {
|
|
33
35
|
value: type.value,
|
|
@@ -42,43 +44,83 @@ const OrderTypeSelectorUI = (props: OrderTypeSelectParams) => {
|
|
|
42
44
|
if (!orderState.loading) {
|
|
43
45
|
setOrderTypeValue && setOrderTypeValue(orderType)
|
|
44
46
|
handleChangeOrderType(orderType)
|
|
45
|
-
|
|
47
|
+
if(!isChewLayout){
|
|
48
|
+
goToBack();
|
|
49
|
+
}
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
52
|
|
|
49
53
|
return (
|
|
50
54
|
<Wrapper>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
<OText
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
55
|
+
{isChewLayout ? (
|
|
56
|
+
<View>
|
|
57
|
+
<OTabs
|
|
58
|
+
horizontal
|
|
59
|
+
showsHorizontalScrollIndicator={false}
|
|
60
|
+
>
|
|
61
|
+
{chewOrderTypes?.map((type : any) => (
|
|
62
|
+
<TabBtn
|
|
63
|
+
key={type.value}
|
|
64
|
+
onPress={() => handleChangeOrderTypeCallback(type.value)}
|
|
65
|
+
>
|
|
66
|
+
<OTab
|
|
67
|
+
style={{
|
|
68
|
+
borderBottomColor:
|
|
69
|
+
type.value === typeSelected
|
|
70
|
+
? theme.colors.textNormal
|
|
71
|
+
: theme.colors.border,
|
|
72
|
+
}}>
|
|
73
|
+
<OText
|
|
74
|
+
size={14}
|
|
75
|
+
color={
|
|
76
|
+
type.value === typeSelected
|
|
77
|
+
? theme.colors.textNormal
|
|
78
|
+
: theme.colors.disabled
|
|
79
|
+
}
|
|
80
|
+
weight={type.value === typeSelected ? 'bold' : 'normal'}>
|
|
81
|
+
{type.name}
|
|
82
|
+
</OText>
|
|
83
|
+
</OTab>
|
|
84
|
+
</TabBtn>
|
|
85
|
+
))}
|
|
86
|
+
</OTabs>
|
|
87
|
+
</View>
|
|
88
|
+
) : (
|
|
89
|
+
<>
|
|
90
|
+
<NavBar
|
|
91
|
+
onActionLeft={() => goToBack()}
|
|
92
|
+
btnStyle={{ paddingLeft: 0 }}
|
|
93
|
+
paddingTop={0}
|
|
94
|
+
style={{ paddingBottom: 0 }}
|
|
95
|
+
title={t('HOW_WILL_YOU_DELIVERY_TYPE', 'How will your order type?')}
|
|
96
|
+
titleAlign={'center'}
|
|
97
|
+
titleStyle={{ fontSize: 14 }}
|
|
98
|
+
/>
|
|
99
|
+
{
|
|
100
|
+
items.length > 0 && (
|
|
101
|
+
<ListWrapper>
|
|
102
|
+
{
|
|
103
|
+
items && items.map((item: any, idx: number) =>
|
|
104
|
+
<OrderTypeWrapper activeOpacity={0.8} key={idx} disabled={orderState.loading} onPress={() => handleChangeOrderTypeCallback(item.value)}>
|
|
105
|
+
<BgImage source={theme.images.orderTypes[`type${item?.value || 1}`]} resizeMode={'cover'} style={{ opacity: item?.value == typeSelected || typeSelected === undefined ? 1 : 0.4 }}>
|
|
106
|
+
<MaskCont>
|
|
107
|
+
<OText size={12} lineHeight={18} color={theme.colors.white} weight={Platform.OS === 'android' ? 'bold' : '600'}>{item?.label}</OText>
|
|
108
|
+
<OText size={10} lineHeight={15} color={theme.colors.white}>{item?.description}</OText>
|
|
109
|
+
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
110
|
+
<OText size={10} lineHeight={15} color={theme.colors.white}>{t('START_MY_ORDER', 'Start my order')}</OText>
|
|
111
|
+
<OIcon src={theme.images.general.arrow_left} width={16} color={theme.colors.white} style={{ transform: [{ rotate: '180deg' }], marginStart: 4 }} />
|
|
112
|
+
</View>
|
|
113
|
+
</MaskCont>
|
|
114
|
+
</BgImage>
|
|
115
|
+
</OrderTypeWrapper>
|
|
116
|
+
)
|
|
117
|
+
}
|
|
118
|
+
</ListWrapper>
|
|
119
|
+
)
|
|
120
|
+
}
|
|
121
|
+
</>
|
|
122
|
+
)}
|
|
123
|
+
|
|
82
124
|
</Wrapper>
|
|
83
125
|
)
|
|
84
126
|
}
|
|
@@ -24,4 +24,22 @@ export const MaskCont = styled.View`
|
|
|
24
24
|
padding: 16px 39px;
|
|
25
25
|
background-color: #0000004D;
|
|
26
26
|
height: 100%;
|
|
27
|
-
`;
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
export const OTabs = styled.View`
|
|
30
|
+
flex-direction: row;
|
|
31
|
+
width: 100%;
|
|
32
|
+
margin-bottom: -1px;
|
|
33
|
+
justify-content: space-between;
|
|
34
|
+
`;
|
|
35
|
+
|
|
36
|
+
export const OTab = styled.View`
|
|
37
|
+
padding-bottom: 10px;
|
|
38
|
+
border-bottom-width: 1px;
|
|
39
|
+
padding-horizontal: 10px;
|
|
40
|
+
`;
|
|
41
|
+
|
|
42
|
+
export const TabBtn = styled.TouchableOpacity`
|
|
43
|
+
min-height: 30px;
|
|
44
|
+
height: 30px;
|
|
45
|
+
`;
|
|
@@ -49,10 +49,11 @@ const OBottomPopup = (props: Props) => {
|
|
|
49
49
|
<View style={{ paddingTop: top, paddingBottom: bottom }}>
|
|
50
50
|
<View style={styles.modalTitleStyle}>
|
|
51
51
|
{closeIcon && (
|
|
52
|
-
<TouchableOpacity onPress={onClose} style={styles.closeIconStyle}>
|
|
52
|
+
<TouchableOpacity onPress={() => onClose()} style={styles.closeIconStyle}>
|
|
53
53
|
<OIcon
|
|
54
54
|
src={closeIcon}
|
|
55
|
-
width={
|
|
55
|
+
width={20}
|
|
56
|
+
height={20}
|
|
56
57
|
/>
|
|
57
58
|
</TouchableOpacity>
|
|
58
59
|
)}
|
|
@@ -93,7 +94,8 @@ const styles = StyleSheet.create({
|
|
|
93
94
|
closeIconStyle: {
|
|
94
95
|
position: 'absolute',
|
|
95
96
|
left: 25,
|
|
96
|
-
top:
|
|
97
|
+
top: 25,
|
|
98
|
+
zIndex: 100
|
|
97
99
|
},
|
|
98
100
|
modalTitleStyle: {
|
|
99
101
|
position: 'relative',
|
|
@@ -169,6 +169,7 @@ export interface BusinessesListingParams {
|
|
|
169
169
|
priceLevelSelected?: any;
|
|
170
170
|
handleChangePriceLevel?: any;
|
|
171
171
|
businessTypeSelected?: any;
|
|
172
|
+
logosLayout?: boolean;
|
|
172
173
|
}
|
|
173
174
|
export interface HighestRatedBusinessesParams {
|
|
174
175
|
businessesList: { businesses: Array<any>, loading: boolean, error: null | string };
|
|
@@ -549,7 +550,9 @@ export interface OrderTypeSelectParams {
|
|
|
549
550
|
defaultValue?: number;
|
|
550
551
|
configTypes?: Array<any>;
|
|
551
552
|
orderTypes: Array<any>;
|
|
552
|
-
setOrderTypeValue?: (value: number) => any
|
|
553
|
+
setOrderTypeValue?: (value: number) => any,
|
|
554
|
+
isChewLayout?: boolean;
|
|
555
|
+
chewOrderTypes?: any;
|
|
553
556
|
}
|
|
554
557
|
export interface UpsellingProductsParams {
|
|
555
558
|
isCustomMode?: boolean;
|