ordering-ui-react-native 0.12.18 → 0.12.19
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/config.json +2 -2
- package/themes/business/src/components 2/AcceptOrRejectOrder/index.tsx +0 -389
- package/themes/business/src/components 2/AcceptOrRejectOrder/styles.tsx +0 -36
- package/themes/business/src/components 2/BusinessController/index.tsx +0 -155
- package/themes/business/src/components 2/BusinessController/styles.tsx +0 -19
- package/themes/business/src/components 2/Chat/index.tsx +0 -1152
- package/themes/business/src/components 2/Chat/styles.tsx +0 -12
- package/themes/business/src/components 2/Contacts/index.tsx +0 -299
- package/themes/business/src/components 2/Contacts/styles.tsx +0 -42
- package/themes/business/src/components 2/DriverMap/index.tsx +0 -525
- package/themes/business/src/components 2/FloatingButton/index.tsx +0 -141
- package/themes/business/src/components 2/FloatingButton/styles.tsx +0 -35
- package/themes/business/src/components 2/ForgotPasswordForm/index.tsx +0 -204
- package/themes/business/src/components 2/ForgotPasswordForm/styles.tsx +0 -11
- package/themes/business/src/components 2/GoogleMap/index.tsx +0 -347
- package/themes/business/src/components 2/Home/index.tsx +0 -111
- package/themes/business/src/components 2/Home/styles.tsx +0 -27
- package/themes/business/src/components 2/LanguageSelector/index.tsx +0 -124
- package/themes/business/src/components 2/LanguageSelector/lang_country.json +0 -152
- package/themes/business/src/components 2/LanguageSelector/styles.tsx +0 -17
- package/themes/business/src/components 2/LoginForm/index.tsx +0 -663
- package/themes/business/src/components 2/LoginForm/styles.tsx +0 -48
- package/themes/business/src/components 2/LogoutButton/index.tsx +0 -63
- package/themes/business/src/components 2/MapView/index.tsx +0 -317
- package/themes/business/src/components 2/MessagesOption/index.tsx +0 -337
- package/themes/business/src/components 2/MessagesOption/styles.tsx +0 -27
- package/themes/business/src/components 2/NewOrderNotification/index.tsx +0 -167
- package/themes/business/src/components 2/NewOrderNotification/styles.tsx +0 -8
- package/themes/business/src/components 2/NotFoundSource/index.tsx +0 -52
- package/themes/business/src/components 2/NotFoundSource/styles.tsx +0 -17
- package/themes/business/src/components 2/OrderDetails/Business.tsx +0 -683
- package/themes/business/src/components 2/OrderDetails/Delivery.tsx +0 -454
- package/themes/business/src/components 2/OrderDetails/OrderContentComponent.tsx +0 -391
- package/themes/business/src/components 2/OrderDetails/OrderHeaderComponent.tsx +0 -148
- package/themes/business/src/components 2/OrderDetails/styles.tsx +0 -84
- package/themes/business/src/components 2/OrderMessage/index.tsx +0 -344
- package/themes/business/src/components 2/OrderMessage/styles.tsx +0 -5
- package/themes/business/src/components 2/OrderSummary/index.tsx +0 -700
- package/themes/business/src/components 2/OrderSummary/styles.tsx +0 -61
- package/themes/business/src/components 2/OrdersOption/index.tsx +0 -755
- package/themes/business/src/components 2/OrdersOption/styles.tsx +0 -54
- package/themes/business/src/components 2/OrdersOptionBusiness/index.tsx +0 -51
- package/themes/business/src/components 2/OrdersOptionBusiness/styles.tsx +0 -8
- package/themes/business/src/components 2/OrdersOptionCity/index.tsx +0 -52
- package/themes/business/src/components 2/OrdersOptionCity/styles.tsx +0 -8
- package/themes/business/src/components 2/OrdersOptionDate/index.tsx +0 -52
- package/themes/business/src/components 2/OrdersOptionDate/styles.tsx +0 -8
- package/themes/business/src/components 2/OrdersOptionDelivery/index.tsx +0 -35
- package/themes/business/src/components 2/OrdersOptionDelivery/styles.tsx +0 -8
- package/themes/business/src/components 2/OrdersOptionDriver/index.tsx +0 -50
- package/themes/business/src/components 2/OrdersOptionDriver/styles.tsx +0 -8
- package/themes/business/src/components 2/OrdersOptionPaymethod/index.tsx +0 -49
- package/themes/business/src/components 2/OrdersOptionPaymethod/styles.tsx +0 -8
- package/themes/business/src/components 2/OrdersOptionStatus/index.tsx +0 -46
- package/themes/business/src/components 2/OrdersOptionStatus/styles.tsx +0 -8
- package/themes/business/src/components 2/PhoneInputNumber/index.tsx +0 -160
- package/themes/business/src/components 2/PhoneInputNumber/styles.tsx +0 -3
- package/themes/business/src/components 2/PreviousMessages/index.tsx +0 -304
- package/themes/business/src/components 2/PreviousMessages/styles.tsx +0 -32
- package/themes/business/src/components 2/PreviousOrders/index.tsx +0 -180
- package/themes/business/src/components 2/PreviousOrders/styles.tsx +0 -38
- package/themes/business/src/components 2/ProductItemAccordion/index.tsx +0 -301
- package/themes/business/src/components 2/ProductItemAccordion/styles.tsx +0 -61
- package/themes/business/src/components 2/SearchBar/index.tsx +0 -112
- package/themes/business/src/components 2/SignupForm/index.tsx +0 -530
- package/themes/business/src/components 2/SignupForm/styles.tsx +0 -16
- package/themes/business/src/components 2/StoresList/index.tsx +0 -208
- package/themes/business/src/components 2/StoresList/styles.tsx +0 -26
- package/themes/business/src/components 2/UserFormDetails/index.tsx +0 -513
- package/themes/business/src/components 2/UserFormDetails/styles.tsx +0 -40
- package/themes/business/src/components 2/UserProfileForm/index.tsx +0 -496
- package/themes/business/src/components 2/UserProfileForm/styles.tsx +0 -36
- package/themes/business/src/components 2/VerifyPhone/index.tsx +0 -201
- package/themes/business/src/components 2/VerifyPhone/styles.tsx +0 -43
- package/themes/business/src/components 2/shared/OAlert.tsx +0 -52
- package/themes/business/src/components 2/shared/OButton.tsx +0 -149
- package/themes/business/src/components 2/shared/OChatBubble.tsx +0 -100
- package/themes/business/src/components 2/shared/ODropDown.tsx +0 -195
- package/themes/business/src/components 2/shared/ODropDownCalendar.tsx +0 -328
- package/themes/business/src/components 2/shared/OFab.tsx +0 -54
- package/themes/business/src/components 2/shared/OIcon.tsx +0 -67
- package/themes/business/src/components 2/shared/OIconButton.tsx +0 -127
- package/themes/business/src/components 2/shared/OInput.tsx +0 -144
- package/themes/business/src/components 2/shared/OLink.tsx +0 -76
- package/themes/business/src/components 2/shared/OModal.tsx +0 -275
- package/themes/business/src/components 2/shared/OSegment.tsx +0 -86
- package/themes/business/src/components 2/shared/OText.tsx +0 -55
- package/themes/business/src/components 2/shared/OTextarea.tsx +0 -46
- package/themes/business/src/components 2/shared/OToast.tsx +0 -92
- package/themes/business/src/components 2/shared/index.tsx +0 -27
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components/native';
|
|
2
|
-
|
|
3
|
-
export const Wrapper = styled.View`
|
|
4
|
-
flex: 1;
|
|
5
|
-
background-color: ${(props: any) => props.theme.colors.white};
|
|
6
|
-
`;
|
|
7
|
-
|
|
8
|
-
export const Header = styled.ScrollView``;
|
|
9
|
-
|
|
10
|
-
export const TitleHeader = styled.View`
|
|
11
|
-
margin-left: 11px;
|
|
12
|
-
`;
|
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
StyleSheet,
|
|
4
|
-
TouchableOpacity,
|
|
5
|
-
ScrollView,
|
|
6
|
-
View,
|
|
7
|
-
Dimensions,
|
|
8
|
-
} from 'react-native';
|
|
9
|
-
import MaterialIcon from 'react-native-vector-icons/MaterialIcons';
|
|
10
|
-
import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
|
|
11
|
-
import { useTheme } from 'styled-components/native';
|
|
12
|
-
import {
|
|
13
|
-
Contacts as ContactsController,
|
|
14
|
-
useLanguage,
|
|
15
|
-
useUtils,
|
|
16
|
-
} from 'ordering-components/native';
|
|
17
|
-
import { Card, Logo, Information, Header, Badge, Stars } from './styles';
|
|
18
|
-
import { NotFoundSource } from '../NotFoundSource';
|
|
19
|
-
import { OIcon, OText, OButton } from '../shared';
|
|
20
|
-
import { ContactParams } from '../../types';
|
|
21
|
-
|
|
22
|
-
const ContactsUI = (props: ContactParams) => {
|
|
23
|
-
const {
|
|
24
|
-
contacts: { data, loading, error },
|
|
25
|
-
activeTag,
|
|
26
|
-
pagination,
|
|
27
|
-
getBusinesses,
|
|
28
|
-
getCustomers,
|
|
29
|
-
getDrivers,
|
|
30
|
-
loadMore,
|
|
31
|
-
onNavigationRedirect,
|
|
32
|
-
} = props;
|
|
33
|
-
|
|
34
|
-
const [, t] = useLanguage();
|
|
35
|
-
const theme = useTheme();
|
|
36
|
-
const [{ parseDate, optimizeImage }] = useUtils();
|
|
37
|
-
|
|
38
|
-
const [orientation, setOrientation] = useState(
|
|
39
|
-
Dimensions.get('window').width < Dimensions.get('window').height
|
|
40
|
-
? 'Portrait'
|
|
41
|
-
: 'Landscape',
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
const handlePressOrder = (order: any) => {
|
|
45
|
-
const uuid = order?.id;
|
|
46
|
-
onNavigationRedirect &&
|
|
47
|
-
onNavigationRedirect('OrderMessage', { orderId: uuid });
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
useEffect(() => {
|
|
51
|
-
if (!loading) {
|
|
52
|
-
switch (activeTag) {
|
|
53
|
-
case 2:
|
|
54
|
-
getBusinesses && getBusinesses();
|
|
55
|
-
break;
|
|
56
|
-
case 3:
|
|
57
|
-
getCustomers && getCustomers();
|
|
58
|
-
break;
|
|
59
|
-
case 4:
|
|
60
|
-
getDrivers && getDrivers();
|
|
61
|
-
break;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}, [activeTag]);
|
|
65
|
-
|
|
66
|
-
Dimensions.addEventListener('change', ({ window: { width, height } }) => {
|
|
67
|
-
if (width < height) {
|
|
68
|
-
setOrientation('Portrait');
|
|
69
|
-
} else {
|
|
70
|
-
setOrientation('Landscape');
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
const styles = StyleSheet.create({
|
|
75
|
-
btnCard: {
|
|
76
|
-
flex: 1,
|
|
77
|
-
minHeight: 64,
|
|
78
|
-
marginBottom: 30,
|
|
79
|
-
},
|
|
80
|
-
icon: {
|
|
81
|
-
borderRadius: 7.6,
|
|
82
|
-
width: 73,
|
|
83
|
-
height: 73,
|
|
84
|
-
},
|
|
85
|
-
name: {
|
|
86
|
-
fontFamily: 'Poppins',
|
|
87
|
-
fontStyle: 'normal',
|
|
88
|
-
fontWeight: '600',
|
|
89
|
-
fontSize: 18,
|
|
90
|
-
color: theme.colors.textGray,
|
|
91
|
-
},
|
|
92
|
-
badge: {
|
|
93
|
-
fontFamily: 'Poppins',
|
|
94
|
-
fontStyle: 'normal',
|
|
95
|
-
fontWeight: 'normal',
|
|
96
|
-
fontSize: 14,
|
|
97
|
-
color: theme.colors.primary,
|
|
98
|
-
},
|
|
99
|
-
star: {
|
|
100
|
-
fontFamily: 'Poppins',
|
|
101
|
-
fontStyle: 'normal',
|
|
102
|
-
fontWeight: 'normal',
|
|
103
|
-
fontSize: 15,
|
|
104
|
-
color: theme.colors.unselectText,
|
|
105
|
-
},
|
|
106
|
-
order: {
|
|
107
|
-
fontFamily: 'Poppins',
|
|
108
|
-
fontStyle: 'normal',
|
|
109
|
-
fontWeight: 'normal',
|
|
110
|
-
color: theme.colors.orderTypeColor,
|
|
111
|
-
},
|
|
112
|
-
btn: {
|
|
113
|
-
borderRadius: 7.6,
|
|
114
|
-
height: 44,
|
|
115
|
-
marginBottom: 40,
|
|
116
|
-
marginTop: 5,
|
|
117
|
-
},
|
|
118
|
-
btnText: {
|
|
119
|
-
color: theme.colors.white,
|
|
120
|
-
fontFamily: 'Poppins',
|
|
121
|
-
fontStyle: 'normal',
|
|
122
|
-
fontWeight: 'normal',
|
|
123
|
-
fontSize: 18,
|
|
124
|
-
},
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
return (
|
|
128
|
-
<>
|
|
129
|
-
<ScrollView style={{ height: '80%' }}>
|
|
130
|
-
{data?.length > 0 &&
|
|
131
|
-
data?.map((contact: any) => (
|
|
132
|
-
<TouchableOpacity
|
|
133
|
-
key={contact?.id}
|
|
134
|
-
// onPress={() => handlePressOrder(contact)}
|
|
135
|
-
onPress={() => {}}
|
|
136
|
-
style={styles.btnCard}
|
|
137
|
-
activeOpacity={1}>
|
|
138
|
-
<Card key={contact?.id}>
|
|
139
|
-
<Logo>
|
|
140
|
-
<OIcon
|
|
141
|
-
url={optimizeImage(
|
|
142
|
-
contact?.logo || contact?.photo,
|
|
143
|
-
'h_300,c_limit',
|
|
144
|
-
)}
|
|
145
|
-
style={styles.icon}
|
|
146
|
-
/>
|
|
147
|
-
</Logo>
|
|
148
|
-
|
|
149
|
-
<Information>
|
|
150
|
-
<Header>
|
|
151
|
-
<OText numberOfLines={1} style={styles.name}>
|
|
152
|
-
{contact?.name + ' ' + (contact?.lastname ?? '')}
|
|
153
|
-
</OText>
|
|
154
|
-
|
|
155
|
-
{contact?.unread_count > 0 && (
|
|
156
|
-
<Badge>
|
|
157
|
-
<OText size={14} style={styles.badge}>
|
|
158
|
-
{contact?.unread_count}
|
|
159
|
-
</OText>
|
|
160
|
-
</Badge>
|
|
161
|
-
)}
|
|
162
|
-
</Header>
|
|
163
|
-
|
|
164
|
-
<Stars>
|
|
165
|
-
{[
|
|
166
|
-
...Array(
|
|
167
|
-
Number.isInteger(contact?.qualification)
|
|
168
|
-
? contact?.qualification ?? 3
|
|
169
|
-
: Math.floor(contact?.qualification) || 3,
|
|
170
|
-
),
|
|
171
|
-
].map((item, index) => (
|
|
172
|
-
<MaterialIcon
|
|
173
|
-
key={index}
|
|
174
|
-
name="star"
|
|
175
|
-
size={20}
|
|
176
|
-
color={theme.colors.arrowColor}
|
|
177
|
-
/>
|
|
178
|
-
))}
|
|
179
|
-
|
|
180
|
-
{[
|
|
181
|
-
...Array(
|
|
182
|
-
(Number.isInteger(contact?.qualification)
|
|
183
|
-
? contact?.qualification ?? 3
|
|
184
|
-
: Math.ceil(contact?.qualification) || 3) -
|
|
185
|
-
(Number.isInteger(contact?.qualification)
|
|
186
|
-
? contact?.qualification ?? 3
|
|
187
|
-
: Math.floor(contact?.qualification) || 3),
|
|
188
|
-
),
|
|
189
|
-
].map((item, index) => (
|
|
190
|
-
<MaterialIcon
|
|
191
|
-
key={index}
|
|
192
|
-
name="star-half"
|
|
193
|
-
size={20}
|
|
194
|
-
color={theme.colors.arrowColor}
|
|
195
|
-
/>
|
|
196
|
-
))}
|
|
197
|
-
|
|
198
|
-
{[
|
|
199
|
-
...Array(
|
|
200
|
-
5 -
|
|
201
|
-
(Number.isInteger(contact?.qualification)
|
|
202
|
-
? contact?.qualification ?? 3
|
|
203
|
-
: Math.ceil(contact?.qualification) || 3),
|
|
204
|
-
),
|
|
205
|
-
].map((item, index) => (
|
|
206
|
-
<MaterialIcon
|
|
207
|
-
key={index}
|
|
208
|
-
name="star-border"
|
|
209
|
-
size={20}
|
|
210
|
-
color={theme.colors.arrowColor}
|
|
211
|
-
/>
|
|
212
|
-
))}
|
|
213
|
-
</Stars>
|
|
214
|
-
|
|
215
|
-
<OText style={styles.order} numberOfLines={1} size={16}>
|
|
216
|
-
{contact?.level === 4
|
|
217
|
-
? contact?.assigned_orders_count
|
|
218
|
-
: contact?.level === 3
|
|
219
|
-
? contact?.assigned_orders_count || ''
|
|
220
|
-
: ''}{' '}
|
|
221
|
-
{t('ORDERS', 'Orders')}
|
|
222
|
-
</OText>
|
|
223
|
-
</Information>
|
|
224
|
-
</Card>
|
|
225
|
-
</TouchableOpacity>
|
|
226
|
-
))}
|
|
227
|
-
</ScrollView>
|
|
228
|
-
|
|
229
|
-
{!loading && data?.length === 0 && (
|
|
230
|
-
<NotFoundSource
|
|
231
|
-
content={t('NO_RESULTS_FOUND', 'Sorry, no results found')}
|
|
232
|
-
image={theme.images.general.notFound}
|
|
233
|
-
conditioned={false}
|
|
234
|
-
/>
|
|
235
|
-
)}
|
|
236
|
-
|
|
237
|
-
{loading && (
|
|
238
|
-
<>
|
|
239
|
-
<View>
|
|
240
|
-
{[...Array(5)].map((item, i) => (
|
|
241
|
-
<Placeholder key={i} Animation={Fade}>
|
|
242
|
-
<View
|
|
243
|
-
style={{
|
|
244
|
-
width: '100%',
|
|
245
|
-
flexDirection: 'row',
|
|
246
|
-
marginBottom: 10,
|
|
247
|
-
}}>
|
|
248
|
-
<PlaceholderLine
|
|
249
|
-
width={orientation === 'Portrait' ? 22 : 11}
|
|
250
|
-
height={74}
|
|
251
|
-
style={{
|
|
252
|
-
marginRight: 20,
|
|
253
|
-
marginBottom: 20,
|
|
254
|
-
borderRadius: 7.6,
|
|
255
|
-
}}
|
|
256
|
-
/>
|
|
257
|
-
<Placeholder>
|
|
258
|
-
<PlaceholderLine width={30} style={{ marginTop: 5 }} />
|
|
259
|
-
<PlaceholderLine width={50} />
|
|
260
|
-
<PlaceholderLine width={20} />
|
|
261
|
-
</Placeholder>
|
|
262
|
-
</View>
|
|
263
|
-
</Placeholder>
|
|
264
|
-
))}
|
|
265
|
-
</View>
|
|
266
|
-
</>
|
|
267
|
-
)}
|
|
268
|
-
|
|
269
|
-
{!loading && pagination?.currentPage < pagination?.totalPages && (
|
|
270
|
-
<OButton
|
|
271
|
-
onClick={() => loadMore && loadMore(activeTag)}
|
|
272
|
-
text={t('LOAD_MORE', 'Load more')}
|
|
273
|
-
imgRightSrc={null}
|
|
274
|
-
textStyle={styles.btnText}
|
|
275
|
-
style={styles.btn}
|
|
276
|
-
bgColor={theme.colors.primary}
|
|
277
|
-
borderColor={theme.colors.primary}
|
|
278
|
-
/>
|
|
279
|
-
)}
|
|
280
|
-
</>
|
|
281
|
-
);
|
|
282
|
-
};
|
|
283
|
-
|
|
284
|
-
export const Contacts = (props: ContactParams) => {
|
|
285
|
-
const contactProps = {
|
|
286
|
-
...props,
|
|
287
|
-
firstFetch: 'businesses',
|
|
288
|
-
paginationSettings: {
|
|
289
|
-
page: 1,
|
|
290
|
-
pageSize: 6,
|
|
291
|
-
controlType: 'infinity',
|
|
292
|
-
},
|
|
293
|
-
orderBy: 'name',
|
|
294
|
-
orderDirection: 'asc',
|
|
295
|
-
UIComponent: ContactsUI,
|
|
296
|
-
};
|
|
297
|
-
|
|
298
|
-
return <ContactsController {...contactProps} />;
|
|
299
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components/native';
|
|
2
|
-
|
|
3
|
-
export const Card = styled.View`
|
|
4
|
-
flex: 1;
|
|
5
|
-
flex-direction: row;
|
|
6
|
-
`;
|
|
7
|
-
|
|
8
|
-
export const Logo = styled.View`
|
|
9
|
-
align-items: center;
|
|
10
|
-
justify-content: center;
|
|
11
|
-
shadow-color: ${(props: any) => props.theme.colors.shadow};
|
|
12
|
-
elevation: 1;
|
|
13
|
-
width: 75px;
|
|
14
|
-
height: 75px;
|
|
15
|
-
border-radius: 7.6px;
|
|
16
|
-
`;
|
|
17
|
-
|
|
18
|
-
export const Information = styled.View`
|
|
19
|
-
justify-content: space-between;
|
|
20
|
-
align-items: flex-start;
|
|
21
|
-
margin-horizontal: 10px;
|
|
22
|
-
flex: 1;
|
|
23
|
-
min-height: 64px;
|
|
24
|
-
`;
|
|
25
|
-
|
|
26
|
-
export const Header = styled.View`
|
|
27
|
-
flex-direction: row;
|
|
28
|
-
justify-content: space-between;
|
|
29
|
-
align-items: center;
|
|
30
|
-
width: 100%;
|
|
31
|
-
`;
|
|
32
|
-
|
|
33
|
-
export const Badge = styled.View`
|
|
34
|
-
background-color: #e9f2fe;
|
|
35
|
-
border-radius: 4px;
|
|
36
|
-
padding: 1px 4px;
|
|
37
|
-
`;
|
|
38
|
-
|
|
39
|
-
export const Stars = styled.View`
|
|
40
|
-
display: flex;
|
|
41
|
-
flex-direction: row;
|
|
42
|
-
`;
|