ordering-ui-react-native 0.8.3 → 0.8.7
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 +2 -1
- package/src/components/OrdersOption/index.tsx +1 -12
- package/src/navigators/HomeNavigator.tsx +27 -2
- package/src/pages/Checkout.tsx +3 -3
- package/src/types/react-native-background-timer/index.d.ts +1 -0
- package/themes/business/index.tsx +6 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +167 -240
- package/themes/business/src/components/Chat/index.tsx +68 -54
- package/themes/business/src/components/DriverMap/index.tsx +86 -116
- package/themes/business/src/components/GoogleMap/index.tsx +43 -39
- package/themes/business/src/components/MessagesOption/index.tsx +73 -59
- package/themes/business/src/components/MessagesOption/styles.tsx +1 -1
- package/themes/business/src/components/OrderDetails/index.tsx +104 -92
- package/themes/business/src/components/OrderDetails/styles.tsx +6 -2
- package/themes/business/src/components/OrderDetailsDelivery/index.tsx +816 -0
- package/themes/business/src/components/OrderDetailsDelivery/styles.tsx +144 -0
- package/themes/business/src/components/OrderMessage/index.tsx +122 -23
- package/themes/business/src/components/OrdersOption/index.tsx +52 -66
- package/themes/business/src/components/PreviousMessages/index.tsx +2 -2
- package/themes/business/src/components/PreviousOrders/index.tsx +5 -5
- package/themes/business/src/components/ProductItemAccordion/index.tsx +5 -1
- package/themes/business/src/components/StoresList/index.tsx +51 -49
- package/themes/business/src/components/UserFormDetails/index.tsx +2 -1
- package/themes/business/src/components/UserProfileForm/index.tsx +18 -30
- package/themes/business/src/components/UserProfileForm/styles.tsx +0 -2
- package/themes/business/src/components/shared/OInput.tsx +3 -2
- package/themes/business/src/hooks/useLocation.tsx +7 -3
- package/themes/business/src/layouts/SafeAreaContainer.tsx +43 -0
- package/themes/business/src/types/index.tsx +8 -0
- package/themes/doordash/index.tsx +4 -4
- package/themes/doordash/src/components/LoginForm/index.tsx +2 -5
- package/themes/doordash/src/components/SingleProductCard/index.tsx +1 -1
- package/themes/doordash/src/components/SocialShare/index.tsx +34 -5
- package/themes/doordash/src/components/shared/OModal.tsx +1 -6
- package/themes/instacart/src/components/AddressForm/index.tsx +2 -60
- package/themes/instacart/src/components/AddressList/index.tsx +6 -3
- package/themes/instacart/src/components/Home/index.tsx +39 -14
- package/themes/instacart/src/components/Home/styles.tsx +7 -0
- package/themes/instacart/src/components/LoginForm/index.tsx +3 -3
- package/themes/instacart/src/components/LoginForm/styles.tsx +1 -3
- package/themes/instacart/src/components/LogoutButton/index.tsx +7 -6
- package/themes/instacart/src/components/SocialShare/index.tsx +56 -19
- package/themes/instacart/src/components/SocialShare/styles.ts +0 -8
- package/themes/instacart/src/components/UserProfileForm/index.tsx +1 -1
- package/themes/instacart/src/components/shared/OIcon.tsx +2 -1
- package/themes/instacart/src/layouts/Container.tsx +1 -1
- package/themes/instacart/src/types/index.tsx +12 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-react-native",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.7",
|
|
4
4
|
"description": "Reusable components made in react native",
|
|
5
5
|
"main": "src/index.tsx",
|
|
6
6
|
"author": "ordering.inc",
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
"react-native-app-intro-slider": "^4.0.4",
|
|
61
61
|
"react-native-awesome-alerts": "^1.4.2",
|
|
62
62
|
"react-native-awesome-loading": "^1.0.15",
|
|
63
|
+
"react-native-background-timer": "^2.4.1",
|
|
63
64
|
"react-native-bootsplash": "^3.2.3",
|
|
64
65
|
"react-native-country-picker-modal": "^2.0.0",
|
|
65
66
|
"react-native-credit-card-input": "^0.4.1",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
2
|
import { OrderList, useLanguage, useOrder, ToastType, useToast } from 'ordering-components/native'
|
|
3
|
-
import { useFocusEffect } from '@react-navigation/native'
|
|
4
3
|
import { OText } from '../shared'
|
|
5
4
|
import { NotFoundSource } from '../NotFoundSource'
|
|
6
5
|
import { ActiveOrders } from '../ActiveOrders'
|
|
@@ -62,7 +61,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
62
61
|
}
|
|
63
62
|
setReorderLoading(false)
|
|
64
63
|
|
|
65
|
-
} catch (err) {
|
|
64
|
+
} catch (err: any) {
|
|
66
65
|
showToast(ToastType.Error, t('ERROR', err.message))
|
|
67
66
|
setReorderLoading(false)
|
|
68
67
|
}
|
|
@@ -100,16 +99,6 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
100
99
|
return objectStatus && objectStatus
|
|
101
100
|
}
|
|
102
101
|
|
|
103
|
-
useFocusEffect(
|
|
104
|
-
React.useCallback(() => {
|
|
105
|
-
loadOrders && loadOrders()
|
|
106
|
-
setIsLoadingFirstRender(false)
|
|
107
|
-
return () => {
|
|
108
|
-
setIsLoadingFirstRender(true)
|
|
109
|
-
}
|
|
110
|
-
}, [navigation])
|
|
111
|
-
)
|
|
112
|
-
|
|
113
102
|
useEffect(() => {
|
|
114
103
|
setOrdersLength && setOrdersLength({
|
|
115
104
|
...ordersLength,
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { AppState } from 'react-native'
|
|
2
3
|
import { createStackNavigator } from "@react-navigation/stack";
|
|
3
|
-
import { useSession, useOrder } from 'ordering-components/native';
|
|
4
|
+
import { useSession, useOrder, useWebsocket } from 'ordering-components/native';
|
|
4
5
|
import BottomNavigator from '../navigators/BottomNavigator';
|
|
5
6
|
import RootNavigator from '../navigators/RootNavigator';
|
|
6
7
|
import CheckoutNavigator from '../navigators/CheckoutNavigator';
|
|
8
|
+
import BackgroundTimer from 'react-native-background-timer';
|
|
7
9
|
|
|
8
10
|
import AddressList from '../pages/AddressList';
|
|
9
11
|
import AddressForm from '../pages/AddressForm';
|
|
@@ -22,7 +24,30 @@ const Stack = createStackNavigator();
|
|
|
22
24
|
|
|
23
25
|
const HomeNavigator = (e : any) => {
|
|
24
26
|
const [orderState] = useOrder();
|
|
25
|
-
const [{ auth }] = useSession();
|
|
27
|
+
const [{ auth, user }] = useSession();
|
|
28
|
+
const socket = useWebsocket();
|
|
29
|
+
|
|
30
|
+
const appState = React.useRef(AppState.currentState);
|
|
31
|
+
let interval: any
|
|
32
|
+
|
|
33
|
+
const _handleAppStateChange = (nextAppState: any) => {
|
|
34
|
+
if (appState.current.match(/inactive|background/) && nextAppState === 'active') {
|
|
35
|
+
BackgroundTimer.clearInterval(interval)
|
|
36
|
+
}else{
|
|
37
|
+
interval = BackgroundTimer.setInterval(()=>{
|
|
38
|
+
const ordersRoom = user?.level === 0 ? 'orders' : `orders_${user?.id}`
|
|
39
|
+
socket.join(ordersRoom)
|
|
40
|
+
}, 5000)
|
|
41
|
+
appState.current = nextAppState;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
React.useEffect (() => {
|
|
46
|
+
AppState.addEventListener('change', _handleAppStateChange);
|
|
47
|
+
return () => {
|
|
48
|
+
AppState.removeEventListener('change', _handleAppStateChange);
|
|
49
|
+
};
|
|
50
|
+
},[])
|
|
26
51
|
|
|
27
52
|
return (
|
|
28
53
|
<Stack.Navigator>
|
package/src/pages/Checkout.tsx
CHANGED
|
@@ -47,7 +47,7 @@ export const CheckoutPage = (props: any) => {
|
|
|
47
47
|
? { publishableKey: publicKey, stripeAccountId: stripeAccountId}
|
|
48
48
|
: { publishableKey: publicKey };
|
|
49
49
|
initStripe(stripeParams);
|
|
50
|
-
} catch (error) {
|
|
50
|
+
} catch (error: any) {
|
|
51
51
|
showToast(ToastType.Error, error?.toString() || error.message)
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -71,11 +71,11 @@ export const CheckoutPage = (props: any) => {
|
|
|
71
71
|
props.navigation.navigate('OrderDetails', { orderId: confirmCartRes.result.order.uuid, isFromCheckout: true })
|
|
72
72
|
return
|
|
73
73
|
}
|
|
74
|
-
} catch (error) {
|
|
74
|
+
} catch (error: any) {
|
|
75
75
|
showToast(ToastType.Error, error?.toString() || error.message)
|
|
76
76
|
}
|
|
77
77
|
return
|
|
78
|
-
} catch (error) {
|
|
78
|
+
} catch (error: any) {
|
|
79
79
|
const e = error?.message?.toLowerCase() === 'failed'
|
|
80
80
|
? t('FAILED_PAYMENT', 'The payment has failed')
|
|
81
81
|
: error?.toString() || error.message
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'react-native-background-timer'
|
|
@@ -13,6 +13,7 @@ import { MessagesOption } from './src/components/MessagesOption';
|
|
|
13
13
|
import { NotFoundSource } from './src/components/NotFoundSource';
|
|
14
14
|
import { OrderMessage } from './src/components/OrderMessage';
|
|
15
15
|
import { OrderDetails } from './src/components/OrderDetails';
|
|
16
|
+
import { OrderDetailsDelivery } from './src/components/OrderDetailsDelivery';
|
|
16
17
|
import { OrdersOption } from './src/components/OrdersOption';
|
|
17
18
|
import { OrderSummary } from './src/components/OrderSummary';
|
|
18
19
|
import { PhoneInputNumber } from './src/components/PhoneInputNumber';
|
|
@@ -25,6 +26,7 @@ import { StoresList } from './src/components/StoresList';
|
|
|
25
26
|
import { UserFormDetailsUI } from './src/components/UserFormDetails';
|
|
26
27
|
import { UserProfileForm } from './src/components/UserProfileForm';
|
|
27
28
|
import { VerifyPhone } from './src/components/VerifyPhone';
|
|
29
|
+
import { DriverMap } from './src/components/DriverMap';
|
|
28
30
|
|
|
29
31
|
//OComponents
|
|
30
32
|
import {
|
|
@@ -41,6 +43,7 @@ import {
|
|
|
41
43
|
//layouts
|
|
42
44
|
import { Container } from './src/layouts/Container';
|
|
43
45
|
import { SafeAreaContainer } from './src/layouts/SafeAreaContainer';
|
|
46
|
+
import { SafeAreaContainerLayout } from './src/layouts/SafeAreaContainer';
|
|
44
47
|
|
|
45
48
|
export {
|
|
46
49
|
//Components
|
|
@@ -50,17 +53,20 @@ export {
|
|
|
50
53
|
FloatingButton,
|
|
51
54
|
ForgotPasswordForm,
|
|
52
55
|
GoogleMap,
|
|
56
|
+
DriverMap,
|
|
53
57
|
Home,
|
|
54
58
|
LanguageSelector,
|
|
55
59
|
LoginForm,
|
|
56
60
|
LogoutButton,
|
|
57
61
|
MessagesOption,
|
|
62
|
+
OrderDetailsDelivery,
|
|
58
63
|
OrderMessage,
|
|
59
64
|
NotFoundSource,
|
|
60
65
|
OrderDetails,
|
|
61
66
|
OrdersOption,
|
|
62
67
|
OrderSummary,
|
|
63
68
|
PhoneInputNumber,
|
|
69
|
+
SafeAreaContainerLayout,
|
|
64
70
|
PreviousMessages,
|
|
65
71
|
PreviousOrders,
|
|
66
72
|
ProductItemAccordion,
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
View,
|
|
7
7
|
KeyboardAvoidingView,
|
|
8
8
|
} from 'react-native';
|
|
9
|
-
import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
|
|
10
9
|
import { useTheme } from 'styled-components/native';
|
|
11
10
|
import { useLanguage } from 'ordering-components/native';
|
|
12
11
|
import { Content, Timer, TimeField, Header, Action, Comments } from './styles';
|
|
@@ -172,255 +171,183 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
|
|
|
172
171
|
|
|
173
172
|
return (
|
|
174
173
|
<>
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
width: 245,
|
|
193
|
-
height: 245,
|
|
194
|
-
borderRadius: 123,
|
|
195
|
-
alignSelf: 'center',
|
|
196
|
-
}}
|
|
197
|
-
/>
|
|
198
|
-
</Placeholder>
|
|
199
|
-
|
|
200
|
-
<Placeholder Animation={Fade}>
|
|
201
|
-
<PlaceholderLine
|
|
202
|
-
width={90}
|
|
203
|
-
style={{ borderRadius: 7.8, alignSelf: 'center', height: 40 }}
|
|
204
|
-
/>
|
|
205
|
-
</Placeholder>
|
|
206
|
-
</>
|
|
207
|
-
) : (
|
|
208
|
-
<>
|
|
209
|
-
<Placeholder Animation={Fade}>
|
|
210
|
-
<PlaceholderLine width={90} />
|
|
211
|
-
<PlaceholderLine width={60} />
|
|
212
|
-
</Placeholder>
|
|
213
|
-
|
|
214
|
-
<Placeholder Animation={Fade}>
|
|
215
|
-
<PlaceholderLine
|
|
216
|
-
width={100}
|
|
217
|
-
style={{ borderRadius: 7.8, height: 40 }}
|
|
218
|
-
/>
|
|
219
|
-
<PlaceholderLine width={40} />
|
|
220
|
-
<PlaceholderLine width={50} />
|
|
221
|
-
<PlaceholderLine width={50} />
|
|
222
|
-
<PlaceholderLine
|
|
223
|
-
width={100}
|
|
224
|
-
style={{ borderRadius: 7.8, height: 140 }}
|
|
225
|
-
/>
|
|
226
|
-
</Placeholder>
|
|
227
|
-
|
|
228
|
-
<Placeholder Animation={Fade}>
|
|
229
|
-
<PlaceholderLine
|
|
230
|
-
width={90}
|
|
231
|
-
style={{ borderRadius: 7.8, alignSelf: 'center', height: 40 }}
|
|
232
|
-
/>
|
|
233
|
-
</Placeholder>
|
|
234
|
-
</>
|
|
235
|
-
)}
|
|
236
|
-
</View>
|
|
237
|
-
)}
|
|
238
|
-
|
|
239
|
-
{!loading && (
|
|
240
|
-
<KeyboardAvoidingView
|
|
241
|
-
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
|
|
242
|
-
style={{ flex: 1, marginTop: top }}>
|
|
243
|
-
<Content ref={scrollViewRef}>
|
|
244
|
-
<Header>
|
|
245
|
-
<OIconButton
|
|
246
|
-
icon={theme.images.general.arrow_left}
|
|
247
|
-
borderColor={theme.colors.clear}
|
|
248
|
-
iconStyle={{ width: 20, height: 20 }}
|
|
249
|
-
style={{
|
|
250
|
-
maxWidth: 40,
|
|
251
|
-
height: 35,
|
|
252
|
-
justifyContent: 'flex-end',
|
|
253
|
-
marginBottom: 30,
|
|
254
|
-
}}
|
|
255
|
-
onClick={() => handleArrowBack()}
|
|
256
|
-
/>
|
|
257
|
-
|
|
258
|
-
<OText size={20} color={theme.colors.textGray} weight="600">
|
|
259
|
-
{action === 'accept'
|
|
260
|
-
? `${t(titleAccept?.key, titleAccept?.text)}:`
|
|
261
|
-
: t(titleReject?.key, titleReject?.text)}
|
|
262
|
-
</OText>
|
|
263
|
-
|
|
264
|
-
{action === 'reject' && (
|
|
265
|
-
<>
|
|
266
|
-
{!notShowCustomerPhone && (
|
|
267
|
-
<>
|
|
268
|
-
<OText
|
|
269
|
-
size={15}
|
|
270
|
-
color={theme.colors.textGray}
|
|
271
|
-
style={{ marginTop: 10 }}>
|
|
272
|
-
{t(
|
|
273
|
-
'CALL_YOUR_CUSTOMER_TO_RESOLVE_THE_ISSUE_AS_POLITELY_AS_POSSIBLE',
|
|
274
|
-
'Call your customer to resolve the issue as politely as possible',
|
|
275
|
-
)}
|
|
276
|
-
</OText>
|
|
277
|
-
|
|
278
|
-
{numberToShow ? (
|
|
279
|
-
<OButton
|
|
280
|
-
bgColor="transparent"
|
|
281
|
-
borderColor={theme.colors.primary}
|
|
282
|
-
textStyle={{
|
|
283
|
-
color: theme.colors.primary,
|
|
284
|
-
fontSize: 20,
|
|
285
|
-
}}
|
|
286
|
-
style={{
|
|
287
|
-
borderRadius: 10,
|
|
288
|
-
marginVertical: 20,
|
|
289
|
-
}}
|
|
290
|
-
imgLeftStyle={{
|
|
291
|
-
resizeMode: 'contain',
|
|
292
|
-
left: 20,
|
|
293
|
-
position: 'absolute',
|
|
294
|
-
}}
|
|
295
|
-
imgLeftSrc={theme.images.general.cellphone}
|
|
296
|
-
text={numberToShow}
|
|
297
|
-
onClick={() =>
|
|
298
|
-
Linking.openURL(`tel:${customerCellphone}`)
|
|
299
|
-
}
|
|
300
|
-
/>
|
|
301
|
-
) : (
|
|
302
|
-
<OButton
|
|
303
|
-
bgColor="transparent"
|
|
304
|
-
borderColor={theme.colors.primary}
|
|
305
|
-
textStyle={{
|
|
306
|
-
color: theme.colors.primary,
|
|
307
|
-
fontSize: 15,
|
|
308
|
-
}}
|
|
309
|
-
style={{
|
|
310
|
-
borderRadius: 10,
|
|
311
|
-
marginVertical: 20,
|
|
312
|
-
}}
|
|
313
|
-
imgLeftStyle={{
|
|
314
|
-
resizeMode: 'contain',
|
|
315
|
-
left: 20,
|
|
316
|
-
position: 'absolute',
|
|
317
|
-
}}
|
|
318
|
-
isDisabled={true}
|
|
319
|
-
imgLeftSrc={theme.images.general.cellphone}
|
|
320
|
-
text={t('NOT_NUMBER', "There's not phonenumber.")}
|
|
321
|
-
onClick={() =>
|
|
322
|
-
Linking.openURL(`tel:${customerCellphone}`)
|
|
323
|
-
}
|
|
324
|
-
/>
|
|
325
|
-
)}
|
|
326
|
-
</>
|
|
327
|
-
)}
|
|
328
|
-
|
|
329
|
-
<OText
|
|
330
|
-
size={15}
|
|
331
|
-
color={theme.colors.textGray}
|
|
332
|
-
style={{ marginBottom: 10 }}>
|
|
333
|
-
{t(
|
|
334
|
-
'MARK_THE_ORDER_AS_REJECTED',
|
|
335
|
-
'Mark the order as rejected',
|
|
336
|
-
)}
|
|
337
|
-
</OText>
|
|
174
|
+
<KeyboardAvoidingView
|
|
175
|
+
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
|
|
176
|
+
style={{ flex: 1, marginTop: top }}>
|
|
177
|
+
<Content ref={scrollViewRef}>
|
|
178
|
+
<Header>
|
|
179
|
+
<OIconButton
|
|
180
|
+
icon={theme.images.general.arrow_left}
|
|
181
|
+
borderColor={theme.colors.clear}
|
|
182
|
+
iconStyle={{ width: 20, height: 20 }}
|
|
183
|
+
style={{
|
|
184
|
+
maxWidth: 40,
|
|
185
|
+
height: 35,
|
|
186
|
+
justifyContent: 'flex-end',
|
|
187
|
+
marginBottom: 30,
|
|
188
|
+
}}
|
|
189
|
+
onClick={() => handleArrowBack()}
|
|
190
|
+
/>
|
|
338
191
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
192
|
+
<OText size={20} color={theme.colors.textGray} weight="600">
|
|
193
|
+
{action === 'accept'
|
|
194
|
+
? `${t(titleAccept?.key, titleAccept?.text)}:`
|
|
195
|
+
: t(titleReject?.key, titleReject?.text)}
|
|
196
|
+
</OText>
|
|
344
197
|
|
|
345
|
-
|
|
198
|
+
{action === 'reject' && (
|
|
199
|
+
<>
|
|
200
|
+
{!notShowCustomerPhone && (
|
|
201
|
+
<>
|
|
202
|
+
<OText
|
|
203
|
+
size={15}
|
|
204
|
+
color={theme.colors.textGray}
|
|
205
|
+
style={{ marginTop: 10 }}>
|
|
346
206
|
{t(
|
|
347
|
-
'
|
|
348
|
-
'
|
|
207
|
+
'CALL_YOUR_CUSTOMER_TO_RESOLVE_THE_ISSUE_AS_POLITELY_AS_POSSIBLE',
|
|
208
|
+
'Call your customer to resolve the issue as politely as possible',
|
|
349
209
|
)}
|
|
350
210
|
</OText>
|
|
211
|
+
|
|
212
|
+
{numberToShow ? (
|
|
213
|
+
<OButton
|
|
214
|
+
bgColor="transparent"
|
|
215
|
+
borderColor={theme.colors.primary}
|
|
216
|
+
textStyle={{
|
|
217
|
+
color: theme.colors.primary,
|
|
218
|
+
fontSize: 20,
|
|
219
|
+
}}
|
|
220
|
+
style={{
|
|
221
|
+
borderRadius: 10,
|
|
222
|
+
marginVertical: 20,
|
|
223
|
+
}}
|
|
224
|
+
imgLeftStyle={{
|
|
225
|
+
resizeMode: 'contain',
|
|
226
|
+
left: 20,
|
|
227
|
+
position: 'absolute',
|
|
228
|
+
}}
|
|
229
|
+
imgLeftSrc={theme.images.general.cellphone}
|
|
230
|
+
text={numberToShow}
|
|
231
|
+
onClick={() =>
|
|
232
|
+
Linking.openURL(`tel:${customerCellphone}`)
|
|
233
|
+
}
|
|
234
|
+
/>
|
|
235
|
+
) : (
|
|
236
|
+
<OButton
|
|
237
|
+
bgColor="transparent"
|
|
238
|
+
borderColor={theme.colors.primary}
|
|
239
|
+
textStyle={{
|
|
240
|
+
color: theme.colors.primary,
|
|
241
|
+
fontSize: 15,
|
|
242
|
+
}}
|
|
243
|
+
style={{
|
|
244
|
+
borderRadius: 10,
|
|
245
|
+
marginVertical: 20,
|
|
246
|
+
}}
|
|
247
|
+
imgLeftStyle={{
|
|
248
|
+
resizeMode: 'contain',
|
|
249
|
+
left: 20,
|
|
250
|
+
position: 'absolute',
|
|
251
|
+
}}
|
|
252
|
+
isDisabled={true}
|
|
253
|
+
imgLeftSrc={theme.images.general.cellphone}
|
|
254
|
+
text={t('NOT_NUMBER', "There's not phonenumber.")}
|
|
255
|
+
onClick={() =>
|
|
256
|
+
Linking.openURL(`tel:${customerCellphone}`)
|
|
257
|
+
}
|
|
258
|
+
/>
|
|
259
|
+
)}
|
|
260
|
+
</>
|
|
261
|
+
)}
|
|
262
|
+
|
|
263
|
+
<OText
|
|
264
|
+
size={15}
|
|
265
|
+
color={theme.colors.textGray}
|
|
266
|
+
style={{ marginBottom: 10 }}>
|
|
267
|
+
{t(
|
|
268
|
+
'MARK_THE_ORDER_AS_REJECTED',
|
|
269
|
+
'Mark the order as rejected',
|
|
270
|
+
)}
|
|
271
|
+
</OText>
|
|
272
|
+
|
|
273
|
+
<OText>
|
|
274
|
+
<OText style={{ fontWeight: '600' }}>
|
|
275
|
+
{t('NOTE', 'Note')}
|
|
276
|
+
{': '}
|
|
351
277
|
</OText>
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
<Timer onPress={() => openTimerIOnput()}>
|
|
359
|
-
<OText weight="600" style={{ textAlign: 'center' }} size={55}>
|
|
360
|
-
{hour}
|
|
361
|
-
</OText>
|
|
362
|
-
{hour.length > 0 && <OText size={55}>:</OText>}
|
|
363
|
-
<OText weight="600" style={{ textAlign: 'center' }} size={55}>
|
|
364
|
-
{min}
|
|
278
|
+
|
|
279
|
+
<OText size={15} color={theme.colors.textGray}>
|
|
280
|
+
{t(
|
|
281
|
+
'YOUR_CUSTOMER_WILL_RECEIVE_A_NOTIFICATION_ABOUT_THIS_ACTIONS',
|
|
282
|
+
'Your customer will receive a notification about this actions',
|
|
283
|
+
)}
|
|
365
284
|
</OText>
|
|
366
|
-
</
|
|
367
|
-
|
|
285
|
+
</OText>
|
|
286
|
+
</>
|
|
368
287
|
)}
|
|
288
|
+
</Header>
|
|
289
|
+
|
|
290
|
+
{action === 'accept' && (
|
|
291
|
+
<View style={{ height: 400, justifyContent: 'center' }}>
|
|
292
|
+
<Timer onPress={() => openTimerIOnput()}>
|
|
293
|
+
<OText weight="600" style={{ textAlign: 'center' }} size={55}>
|
|
294
|
+
{hour}
|
|
295
|
+
</OText>
|
|
296
|
+
{hour.length > 0 && <OText size={55}>:</OText>}
|
|
297
|
+
<OText weight="600" style={{ textAlign: 'center' }} size={55}>
|
|
298
|
+
{min}
|
|
299
|
+
</OText>
|
|
300
|
+
</Timer>
|
|
301
|
+
</View>
|
|
302
|
+
)}
|
|
369
303
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
304
|
+
<TimeField
|
|
305
|
+
ref={timerRef}
|
|
306
|
+
keyboardType="numeric"
|
|
307
|
+
value={time}
|
|
308
|
+
placeholder={'00:00'}
|
|
309
|
+
onChangeText={handleTime}
|
|
310
|
+
onPressOut={() => handleFixTime()}
|
|
311
|
+
editable={true}
|
|
312
|
+
selectionColor={theme.colors.primary}
|
|
313
|
+
placeholderTextColor={theme.colors.textGray}
|
|
314
|
+
color={theme.colors.textGray}
|
|
315
|
+
onEndEditing={handleFixTime}
|
|
316
|
+
/>
|
|
317
|
+
|
|
318
|
+
{action === 'reject' && (
|
|
319
|
+
<Comments ref={viewRef}>
|
|
320
|
+
<OTextarea
|
|
321
|
+
onFocus={handleFocus}
|
|
322
|
+
placeholder={t(
|
|
323
|
+
'PLEASE_TYPE_YOUR_COMMENTS_IN_HERE',
|
|
324
|
+
'Please type your comments in here',
|
|
325
|
+
)}
|
|
326
|
+
value={comments}
|
|
327
|
+
onChange={setComments}
|
|
328
|
+
/>
|
|
329
|
+
<View style={{ height: 20 }} />
|
|
330
|
+
</Comments>
|
|
331
|
+
)}
|
|
332
|
+
</Content>
|
|
383
333
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
style={{
|
|
402
|
-
marginBottom: isKeyboardShow
|
|
403
|
-
? Platform.OS === 'ios'
|
|
404
|
-
? 0
|
|
405
|
-
: 10
|
|
406
|
-
: 0,
|
|
407
|
-
}}>
|
|
408
|
-
<FloatingButton
|
|
409
|
-
firstButtonClick={() => {
|
|
410
|
-
handleAcceptOrReject();
|
|
411
|
-
}}
|
|
412
|
-
btnText={
|
|
413
|
-
action === 'accept'
|
|
414
|
-
? t('ACCEPT', 'Accept')
|
|
415
|
-
: t('REJECT', 'Reject')
|
|
416
|
-
}
|
|
417
|
-
color={
|
|
418
|
-
action === 'accept' ? theme.colors.green : theme.colors.red
|
|
419
|
-
}
|
|
420
|
-
/>
|
|
421
|
-
</Action>
|
|
422
|
-
</KeyboardAvoidingView>
|
|
423
|
-
)}
|
|
334
|
+
<Action
|
|
335
|
+
style={{
|
|
336
|
+
marginBottom: isKeyboardShow ? (Platform.OS === 'ios' ? 0 : 10) : 0,
|
|
337
|
+
}}>
|
|
338
|
+
<FloatingButton
|
|
339
|
+
firstButtonClick={() => {
|
|
340
|
+
handleAcceptOrReject();
|
|
341
|
+
}}
|
|
342
|
+
btnText={
|
|
343
|
+
action === 'accept'
|
|
344
|
+
? t('ACCEPT', 'Accept')
|
|
345
|
+
: t('REJECT', 'Reject')
|
|
346
|
+
}
|
|
347
|
+
color={action === 'accept' ? theme.colors.green : theme.colors.red}
|
|
348
|
+
/>
|
|
349
|
+
</Action>
|
|
350
|
+
</KeyboardAvoidingView>
|
|
424
351
|
</>
|
|
425
352
|
);
|
|
426
353
|
};
|