ordering-ui-react-native 0.17.69 → 0.17.71
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/AcceptOrRejectOrder/index.tsx +259 -238
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
- package/themes/business/src/components/OrdersOption/index.tsx +4 -5
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
- package/themes/business/src/components/PreviousOrders/index.tsx +143 -143
- package/themes/business/src/types/index.tsx +6 -3
- package/themes/original/src/components/AddressList/index.tsx +7 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +2 -3
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +2 -2
- package/themes/original/src/components/Favorite/index.tsx +7 -4
- package/themes/original/src/components/Favorite/styles.tsx +1 -1
- package/themes/original/src/components/FloatingButton/index.tsx +1 -1
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/Help/index.tsx +7 -7
- package/themes/original/src/components/LottieAnimation/index.tsx +16 -7
- package/themes/original/src/components/MomentOption/index.tsx +6 -4
- package/themes/original/src/components/Notifications/index.tsx +8 -2
- package/themes/original/src/components/ProductForm/index.tsx +2 -2
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +1 -1
- package/themes/original/src/components/Promotions/index.tsx +3 -2
- package/themes/original/src/components/UserProfileForm/index.tsx +14 -12
- package/themes/original/src/types/index.tsx +1 -0
package/package.json
CHANGED
|
@@ -11,19 +11,17 @@ import {
|
|
|
11
11
|
} from 'react-native';
|
|
12
12
|
import { useTheme } from 'styled-components/native';
|
|
13
13
|
import SelectDropdown from 'react-native-select-dropdown'
|
|
14
|
-
import { useLanguage
|
|
15
|
-
import { Content, Timer, TimeField, Header,
|
|
16
|
-
import { FloatingButton } from '../FloatingButton';
|
|
14
|
+
import { useLanguage } from 'ordering-components/native';
|
|
15
|
+
import { Content, Timer, TimeField, Header, Comments, CommentsButtonGroup, TopActions } from './styles';
|
|
17
16
|
import { OText, OButton, OTextarea, OIconButton } from '../shared';
|
|
18
17
|
import { AcceptOrRejectOrderParams } from '../../types';
|
|
19
|
-
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
20
18
|
|
|
21
19
|
import { orderCommentList } from '../../../../../src/utils'
|
|
22
20
|
|
|
23
21
|
export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
|
|
24
22
|
const {
|
|
23
|
+
isPage,
|
|
25
24
|
customerCellphone,
|
|
26
|
-
loading,
|
|
27
25
|
action,
|
|
28
26
|
handleUpdateOrder,
|
|
29
27
|
actions,
|
|
@@ -35,7 +33,6 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
|
|
|
35
33
|
} = props;
|
|
36
34
|
|
|
37
35
|
const [, t] = useLanguage();
|
|
38
|
-
const [{ user }] = useSession();
|
|
39
36
|
const theme = useTheme();
|
|
40
37
|
const scrollViewRef = useRef<any>(null);
|
|
41
38
|
const viewRef = useRef<any>(null);
|
|
@@ -46,11 +43,9 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
|
|
|
46
43
|
const [time, setTime] = useState('');
|
|
47
44
|
const [comments, setComments] = useState('');
|
|
48
45
|
const [rejectReason, setRejectReason] = useState(null);
|
|
49
|
-
const [
|
|
50
|
-
const { top, bottom } = useSafeAreaInsets()
|
|
46
|
+
const [keyboardState, setKeyboardState] = useState({ show: false, height: 0 });
|
|
51
47
|
|
|
52
48
|
const isDriverApp = appTitle?.key === 'DELIVERY_APP'
|
|
53
|
-
|
|
54
49
|
const orderCommentsList = orderCommentList(action)
|
|
55
50
|
|
|
56
51
|
let codeNumberPhone, numberPhone, numberToShow;
|
|
@@ -93,6 +88,28 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
|
|
|
93
88
|
alignItems: 'center',
|
|
94
89
|
paddingHorizontal: 10
|
|
95
90
|
},
|
|
91
|
+
parent: {
|
|
92
|
+
flex: 1,
|
|
93
|
+
backgroundColor: theme.colors.backgroundPage,
|
|
94
|
+
},
|
|
95
|
+
upper: {
|
|
96
|
+
flex: 1,
|
|
97
|
+
zIndex: 1001,
|
|
98
|
+
paddingTop: isPage ? 30 : 80,
|
|
99
|
+
marginBottom: 10,
|
|
100
|
+
backgroundColor: theme.colors.backgroundPage
|
|
101
|
+
},
|
|
102
|
+
bottomParent: {
|
|
103
|
+
justifyContent: "center",
|
|
104
|
+
paddingHorizontal: 30,
|
|
105
|
+
alignItems: "center",
|
|
106
|
+
width: '100%',
|
|
107
|
+
height: 45,
|
|
108
|
+
},
|
|
109
|
+
bottom: {
|
|
110
|
+
textAlignVertical: "center",
|
|
111
|
+
textAlign: "center",
|
|
112
|
+
}
|
|
96
113
|
})
|
|
97
114
|
|
|
98
115
|
const handleFocus = () => {
|
|
@@ -101,25 +118,6 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
|
|
|
101
118
|
});
|
|
102
119
|
};
|
|
103
120
|
|
|
104
|
-
useEffect(() => {
|
|
105
|
-
const keyboardDidShowListener = Keyboard.addListener(
|
|
106
|
-
'keyboardDidShow',
|
|
107
|
-
() => {
|
|
108
|
-
setIsKeyboardShow(true);
|
|
109
|
-
},
|
|
110
|
-
);
|
|
111
|
-
const keyboardDidHideListener = Keyboard.addListener(
|
|
112
|
-
'keyboardDidHide',
|
|
113
|
-
() => {
|
|
114
|
-
setIsKeyboardShow(false);
|
|
115
|
-
},
|
|
116
|
-
);
|
|
117
|
-
return () => {
|
|
118
|
-
keyboardDidShowListener.remove();
|
|
119
|
-
keyboardDidHideListener.remove();
|
|
120
|
-
};
|
|
121
|
-
}, []);
|
|
122
|
-
|
|
123
121
|
if (!notShowCustomerPhone) {
|
|
124
122
|
if (phoneNumber) {
|
|
125
123
|
codeNumberPhone = phoneNumber.slice(0, 3);
|
|
@@ -172,15 +170,15 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
|
|
|
172
170
|
};
|
|
173
171
|
|
|
174
172
|
const openTimerIOnput = () => {
|
|
175
|
-
const isFocus = timerRef.current
|
|
173
|
+
const isFocus = timerRef.current?.isFocused();
|
|
176
174
|
if (isFocus) {
|
|
177
|
-
timerRef.current
|
|
175
|
+
timerRef.current?.blur();
|
|
178
176
|
}
|
|
179
177
|
|
|
180
178
|
};
|
|
181
179
|
|
|
182
180
|
const openTextTareaOInput = () => {
|
|
183
|
-
const isFocus = textTareaRef.current
|
|
181
|
+
const isFocus = textTareaRef.current?.isFocused();
|
|
184
182
|
if (isFocus && textTareaRef?.current) {
|
|
185
183
|
textTareaRef.current.blur();
|
|
186
184
|
}
|
|
@@ -281,227 +279,250 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
|
|
|
281
279
|
}
|
|
282
280
|
}, [timerRef?.current])
|
|
283
281
|
|
|
282
|
+
useEffect(() => {
|
|
283
|
+
const keyboardDidShowListener =
|
|
284
|
+
Keyboard.addListener('keyboardDidShow', (e) => setKeyboardState({
|
|
285
|
+
show: true,
|
|
286
|
+
height: e.endCoordinates.height > 100
|
|
287
|
+
? Platform.OS == 'ios' ? e.endCoordinates.height : 0 : 0
|
|
288
|
+
}))
|
|
289
|
+
const keyboardDidHideListener =
|
|
290
|
+
Keyboard.addListener('keyboardDidHide', () => setKeyboardState({ show: false, height: 0 }))
|
|
291
|
+
return () => {
|
|
292
|
+
keyboardDidShowListener.remove()
|
|
293
|
+
keyboardDidHideListener.remove()
|
|
294
|
+
}
|
|
295
|
+
}, [])
|
|
296
|
+
|
|
284
297
|
return (
|
|
285
|
-
<KeyboardAvoidingView
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
<>
|
|
317
|
-
{!notShowCustomerPhone && (
|
|
298
|
+
<KeyboardAvoidingView style={{ flex: 1 }}>
|
|
299
|
+
<View style={styles.parent}>
|
|
300
|
+
<View style={styles.upper}>
|
|
301
|
+
<TopActions>
|
|
302
|
+
<OIconButton
|
|
303
|
+
icon={theme.images.general.arrow_left}
|
|
304
|
+
borderColor={theme.colors.clear}
|
|
305
|
+
iconStyle={{ width: 20, height: 20 }}
|
|
306
|
+
style={{
|
|
307
|
+
maxWidth: 40,
|
|
308
|
+
height: 35,
|
|
309
|
+
justifyContent: 'flex-end',
|
|
310
|
+
marginBottom: 10,
|
|
311
|
+
}}
|
|
312
|
+
onClick={() => handleArrowBack()}
|
|
313
|
+
/>
|
|
314
|
+
<OText
|
|
315
|
+
size={20}
|
|
316
|
+
color={theme.colors.textGray}
|
|
317
|
+
style={{
|
|
318
|
+
fontFamily: 'Poppins',
|
|
319
|
+
fontStyle: 'normal',
|
|
320
|
+
marginBottom: 10,
|
|
321
|
+
}}
|
|
322
|
+
weight="600">
|
|
323
|
+
{titleOrder}
|
|
324
|
+
</OText>
|
|
325
|
+
</TopActions>
|
|
326
|
+
<Content showsVerticalScrollIndicator={false} ref={scrollViewRef}>
|
|
327
|
+
<Header>
|
|
328
|
+
{action === 'reject' && (
|
|
318
329
|
<>
|
|
330
|
+
{!notShowCustomerPhone && (
|
|
331
|
+
<>
|
|
332
|
+
<OText
|
|
333
|
+
size={15}
|
|
334
|
+
color={theme.colors.textGray}
|
|
335
|
+
style={{ marginTop: 10 }}>
|
|
336
|
+
{t(
|
|
337
|
+
'CALL_YOUR_CUSTOMER_TO_RESOLVE_THE_ISSUE_AS_POLITELY_AS_POSSIBLE',
|
|
338
|
+
'Call your customer to resolve the issue as politely as possible',
|
|
339
|
+
)}
|
|
340
|
+
</OText>
|
|
341
|
+
|
|
342
|
+
{numberToShow ? (
|
|
343
|
+
<OButton
|
|
344
|
+
bgColor="transparent"
|
|
345
|
+
borderColor={theme.colors.primary}
|
|
346
|
+
textStyle={{
|
|
347
|
+
color: theme.colors.primary,
|
|
348
|
+
fontSize: 20,
|
|
349
|
+
}}
|
|
350
|
+
style={{
|
|
351
|
+
borderRadius: 10,
|
|
352
|
+
marginVertical: 20,
|
|
353
|
+
}}
|
|
354
|
+
imgLeftStyle={{
|
|
355
|
+
resizeMode: 'contain',
|
|
356
|
+
left: 20,
|
|
357
|
+
position: 'absolute',
|
|
358
|
+
}}
|
|
359
|
+
imgLeftSrc={theme.images.general.cellphone}
|
|
360
|
+
text={numberToShow}
|
|
361
|
+
onClick={() =>
|
|
362
|
+
Linking.openURL(`tel:${customerCellphone}`)
|
|
363
|
+
}
|
|
364
|
+
/>
|
|
365
|
+
) : (
|
|
366
|
+
<OButton
|
|
367
|
+
bgColor="transparent"
|
|
368
|
+
borderColor={theme.colors.primary}
|
|
369
|
+
textStyle={{
|
|
370
|
+
color: theme.colors.primary,
|
|
371
|
+
fontSize: 15,
|
|
372
|
+
}}
|
|
373
|
+
style={{
|
|
374
|
+
borderRadius: 10,
|
|
375
|
+
marginVertical: 20,
|
|
376
|
+
}}
|
|
377
|
+
imgLeftStyle={{
|
|
378
|
+
resizeMode: 'contain',
|
|
379
|
+
left: 20,
|
|
380
|
+
position: 'absolute',
|
|
381
|
+
}}
|
|
382
|
+
isDisabled={true}
|
|
383
|
+
imgLeftSrc={theme.images.general.cellphone}
|
|
384
|
+
text={t('NOT_NUMBER', "There's not phonenumber.")}
|
|
385
|
+
onClick={() =>
|
|
386
|
+
Linking.openURL(`tel:${customerCellphone}`)
|
|
387
|
+
}
|
|
388
|
+
/>
|
|
389
|
+
)}
|
|
390
|
+
</>
|
|
391
|
+
)}
|
|
392
|
+
|
|
319
393
|
<OText
|
|
320
394
|
size={15}
|
|
321
395
|
color={theme.colors.textGray}
|
|
322
|
-
style={{
|
|
396
|
+
style={{ marginBottom: 10 }}>
|
|
323
397
|
{t(
|
|
324
|
-
'
|
|
325
|
-
'
|
|
398
|
+
'MARK_THE_ORDER_AS_REJECTED',
|
|
399
|
+
'Mark the order as rejected',
|
|
326
400
|
)}
|
|
327
401
|
</OText>
|
|
328
402
|
|
|
329
|
-
|
|
330
|
-
<
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
resizeMode: 'contain',
|
|
343
|
-
left: 20,
|
|
344
|
-
position: 'absolute',
|
|
345
|
-
}}
|
|
346
|
-
imgLeftSrc={theme.images.general.cellphone}
|
|
347
|
-
text={numberToShow}
|
|
348
|
-
onClick={() =>
|
|
349
|
-
Linking.openURL(`tel:${customerCellphone}`)
|
|
350
|
-
}
|
|
351
|
-
/>
|
|
352
|
-
) : (
|
|
353
|
-
<OButton
|
|
354
|
-
bgColor="transparent"
|
|
355
|
-
borderColor={theme.colors.primary}
|
|
356
|
-
textStyle={{
|
|
357
|
-
color: theme.colors.primary,
|
|
358
|
-
fontSize: 15,
|
|
359
|
-
}}
|
|
360
|
-
style={{
|
|
361
|
-
borderRadius: 10,
|
|
362
|
-
marginVertical: 20,
|
|
363
|
-
}}
|
|
364
|
-
imgLeftStyle={{
|
|
365
|
-
resizeMode: 'contain',
|
|
366
|
-
left: 20,
|
|
367
|
-
position: 'absolute',
|
|
368
|
-
}}
|
|
369
|
-
isDisabled={true}
|
|
370
|
-
imgLeftSrc={theme.images.general.cellphone}
|
|
371
|
-
text={t('NOT_NUMBER', "There's not phonenumber.")}
|
|
372
|
-
onClick={() =>
|
|
373
|
-
Linking.openURL(`tel:${customerCellphone}`)
|
|
374
|
-
}
|
|
375
|
-
/>
|
|
376
|
-
)}
|
|
403
|
+
<OText>
|
|
404
|
+
<OText style={{ fontWeight: '600' }}>
|
|
405
|
+
{t('NOTE', 'Note')}
|
|
406
|
+
{': '}
|
|
407
|
+
</OText>
|
|
408
|
+
|
|
409
|
+
<OText size={15} color={theme.colors.textGray}>
|
|
410
|
+
{t(
|
|
411
|
+
'YOUR_CUSTOMER_WILL_RECEIVE_A_NOTIFICATION_ABOUT_THIS_ACTIONS',
|
|
412
|
+
'Your customer will receive a notification about this actions',
|
|
413
|
+
)}
|
|
414
|
+
</OText>
|
|
415
|
+
</OText>
|
|
377
416
|
</>
|
|
378
417
|
)}
|
|
418
|
+
</Header>
|
|
379
419
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
{action === 'accept' && (
|
|
408
|
-
<View style={{ height: 400, justifyContent: 'center' }}>
|
|
409
|
-
<Timer onPress={() => openTimerIOnput()}>
|
|
410
|
-
<OText weight="600" style={{ textAlign: 'center' }} size={55}>
|
|
411
|
-
{hour}
|
|
412
|
-
</OText>
|
|
413
|
-
{hour.length > 0 && <OText size={55}>:</OText>}
|
|
414
|
-
<OText weight="600" style={{ textAlign: 'center' }} size={55}>
|
|
415
|
-
{min}
|
|
416
|
-
</OText>
|
|
417
|
-
</Timer>
|
|
418
|
-
</View>
|
|
419
|
-
)}
|
|
420
|
-
<TimeField
|
|
421
|
-
ref={timerRef}
|
|
422
|
-
keyboardType="numeric"
|
|
423
|
-
value={time}
|
|
424
|
-
placeholder={'00:00'}
|
|
425
|
-
onChangeText={handleTime}
|
|
426
|
-
onPressOut={() => handleFixTime()}
|
|
427
|
-
editable={true}
|
|
428
|
-
selectionColor={theme.colors.primary}
|
|
429
|
-
placeholderTextColor={theme.colors.textGray}
|
|
430
|
-
color={theme.colors.textGray}
|
|
431
|
-
onEndEditing={handleFixTime}
|
|
432
|
-
onSubmitEditing={() => handleAcceptOrReject()}
|
|
433
|
-
onBlur={() => actions && action === 'accept' && timerRef?.current?.focus?.()}
|
|
434
|
-
/>
|
|
435
|
-
|
|
436
|
-
{orderCommentsList && isDriverApp && (
|
|
437
|
-
<CommentsButtonGroup>
|
|
438
|
-
<SelectDropdown
|
|
439
|
-
defaultButtonText={t('REJECT_REASONS_OPTIONS', 'Reject reasons')}
|
|
440
|
-
data={orderCommentsList?.list}
|
|
441
|
-
onSelect={(selectedItem) => {
|
|
442
|
-
setRejectReason(selectedItem?.value)
|
|
443
|
-
}}
|
|
444
|
-
buttonTextAfterSelection={(selectedItem) => selectedItem.content}
|
|
445
|
-
rowTextForSelection={(item) => item.key}
|
|
446
|
-
buttonStyle={styles.selectOption}
|
|
447
|
-
buttonTextStyle={styles.buttonTextStyle}
|
|
448
|
-
renderDropdownIcon={isOpened => {
|
|
449
|
-
return <FeatherIcon name={isOpened ? 'chevron-up' : 'chevron-down'} color={'#444'} size={18} />;
|
|
450
|
-
}}
|
|
451
|
-
dropdownStyle={styles.dropdownStyle}
|
|
452
|
-
dropdownOverlayColor='transparent'
|
|
453
|
-
rowStyle={styles.rowStyle}
|
|
454
|
-
renderCustomizedRowChild={(item) => {
|
|
455
|
-
return (
|
|
456
|
-
<View
|
|
457
|
-
style={{
|
|
458
|
-
flexDirection: 'row',
|
|
459
|
-
alignItems: 'center'
|
|
460
|
-
}}
|
|
461
|
-
>
|
|
462
|
-
<View>
|
|
463
|
-
<OText
|
|
464
|
-
size={14}
|
|
465
|
-
color={'#748194'}
|
|
466
|
-
style={{ textTransform: 'capitalize' }}
|
|
467
|
-
>
|
|
468
|
-
{item?.content}
|
|
469
|
-
</OText>
|
|
470
|
-
</View>
|
|
471
|
-
</View>
|
|
472
|
-
);
|
|
473
|
-
}}
|
|
474
|
-
/>
|
|
475
|
-
</CommentsButtonGroup>
|
|
476
|
-
)}
|
|
477
|
-
|
|
478
|
-
{showTextArea && (
|
|
479
|
-
<Comments ref={viewRef}>
|
|
480
|
-
<OTextarea
|
|
481
|
-
textTareaRef={textTareaRef}
|
|
482
|
-
autoFocus
|
|
483
|
-
onFocus={handleFocus}
|
|
484
|
-
placeholder={t(
|
|
485
|
-
'PLEASE_TYPE_YOUR_COMMENTS_IN_HERE',
|
|
486
|
-
'Please type your comments in here',
|
|
487
|
-
)}
|
|
488
|
-
value={comments}
|
|
489
|
-
onChange={setComments}
|
|
420
|
+
{action === 'accept' && (
|
|
421
|
+
<View style={{ height: 400, justifyContent: 'center' }}>
|
|
422
|
+
<Timer onPress={() => openTimerIOnput()}>
|
|
423
|
+
<OText weight="600" style={{ textAlign: 'center' }} size={55}>
|
|
424
|
+
{hour}
|
|
425
|
+
</OText>
|
|
426
|
+
{hour.length > 0 && <OText size={55}>:</OText>}
|
|
427
|
+
<OText weight="600" style={{ textAlign: 'center' }} size={55}>
|
|
428
|
+
{min}
|
|
429
|
+
</OText>
|
|
430
|
+
</Timer>
|
|
431
|
+
</View>
|
|
432
|
+
)}
|
|
433
|
+
<TimeField
|
|
434
|
+
ref={timerRef}
|
|
435
|
+
keyboardType="numeric"
|
|
436
|
+
value={time}
|
|
437
|
+
placeholder={'00:00'}
|
|
438
|
+
onChangeText={handleTime}
|
|
439
|
+
onPressOut={() => handleFixTime()}
|
|
440
|
+
editable={true}
|
|
441
|
+
selectionColor={theme.colors.primary}
|
|
442
|
+
placeholderTextColor={theme.colors.textGray}
|
|
443
|
+
color={theme.colors.textGray}
|
|
444
|
+
onEndEditing={handleFixTime}
|
|
445
|
+
onSubmitEditing={() => handleAcceptOrReject()}
|
|
446
|
+
onBlur={() => actions && action === 'accept' && timerRef?.current?.focus?.()}
|
|
490
447
|
/>
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
448
|
+
|
|
449
|
+
{orderCommentsList && isDriverApp && (
|
|
450
|
+
<CommentsButtonGroup>
|
|
451
|
+
<SelectDropdown
|
|
452
|
+
defaultButtonText={t('REJECT_REASONS_OPTIONS', 'Reject reasons')}
|
|
453
|
+
data={orderCommentsList?.list}
|
|
454
|
+
onSelect={(selectedItem) => {
|
|
455
|
+
setRejectReason(selectedItem?.value)
|
|
456
|
+
}}
|
|
457
|
+
buttonTextAfterSelection={(selectedItem) => selectedItem.content}
|
|
458
|
+
rowTextForSelection={(item) => item.key}
|
|
459
|
+
buttonStyle={styles.selectOption}
|
|
460
|
+
buttonTextStyle={styles.buttonTextStyle}
|
|
461
|
+
renderDropdownIcon={isOpened => {
|
|
462
|
+
return <FeatherIcon name={isOpened ? 'chevron-up' : 'chevron-down'} color={'#444'} size={18} />;
|
|
463
|
+
}}
|
|
464
|
+
dropdownStyle={styles.dropdownStyle}
|
|
465
|
+
dropdownOverlayColor='transparent'
|
|
466
|
+
rowStyle={styles.rowStyle}
|
|
467
|
+
renderCustomizedRowChild={(item) => {
|
|
468
|
+
return (
|
|
469
|
+
<View
|
|
470
|
+
style={{
|
|
471
|
+
flexDirection: 'row',
|
|
472
|
+
alignItems: 'center'
|
|
473
|
+
}}
|
|
474
|
+
>
|
|
475
|
+
<View>
|
|
476
|
+
<OText
|
|
477
|
+
size={14}
|
|
478
|
+
color={'#748194'}
|
|
479
|
+
style={{ textTransform: 'capitalize' }}
|
|
480
|
+
>
|
|
481
|
+
{item?.content}
|
|
482
|
+
</OText>
|
|
483
|
+
</View>
|
|
484
|
+
</View>
|
|
485
|
+
);
|
|
486
|
+
}}
|
|
487
|
+
/>
|
|
488
|
+
</CommentsButtonGroup>
|
|
489
|
+
)}
|
|
490
|
+
|
|
491
|
+
{showTextArea && (
|
|
492
|
+
<Comments ref={viewRef}>
|
|
493
|
+
<OTextarea
|
|
494
|
+
textTareaRef={textTareaRef}
|
|
495
|
+
autoFocus
|
|
496
|
+
onFocus={handleFocus}
|
|
497
|
+
placeholder={t(
|
|
498
|
+
'PLEASE_TYPE_YOUR_COMMENTS_IN_HERE',
|
|
499
|
+
'Please type your comments in here',
|
|
500
|
+
)}
|
|
501
|
+
value={comments}
|
|
502
|
+
onChange={setComments}
|
|
503
|
+
/>
|
|
504
|
+
</Comments>
|
|
505
|
+
)}
|
|
506
|
+
</Content>
|
|
507
|
+
</View>
|
|
508
|
+
<View
|
|
509
|
+
style={{
|
|
510
|
+
...styles.bottomParent,
|
|
511
|
+
marginBottom: (keyboardState.height === 0) ? isPage ? 0 : 30 : keyboardState.height - (isPage ? 20 : -10)
|
|
499
512
|
}}
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
513
|
+
>
|
|
514
|
+
<OButton
|
|
515
|
+
text={buttonText}
|
|
516
|
+
bgColor={action === 'accept' ? theme.colors.green : theme.colors.red}
|
|
517
|
+
borderColor={action === 'accept' ? theme.colors.green : theme.colors.red}
|
|
518
|
+
imgRightSrc={null}
|
|
519
|
+
style={{ borderRadius: 7, height: 45 }}
|
|
520
|
+
parentStyle={{ width: '100%' }}
|
|
521
|
+
textStyle={{color: '#FFF', fontSize: 18 }}
|
|
522
|
+
onClick={() => handleAcceptOrReject()}
|
|
523
|
+
/>
|
|
524
|
+
</View>
|
|
525
|
+
</View>
|
|
505
526
|
</KeyboardAvoidingView>
|
|
506
527
|
);
|
|
507
528
|
};
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import styled from 'styled-components/native';
|
|
2
2
|
|
|
3
3
|
export const Content = styled.ScrollView`
|
|
4
|
-
|
|
5
|
-
margin-bottom: 30px;
|
|
4
|
+
padding-horizontal: 30px;
|
|
6
5
|
`;
|
|
7
6
|
|
|
7
|
+
export const TopActions = styled.View`
|
|
8
|
+
padding-horizontal: 30px;
|
|
9
|
+
padding-bottom: 10px;
|
|
10
|
+
`
|
|
11
|
+
|
|
8
12
|
export const Timer = styled.TouchableOpacity`
|
|
9
13
|
padding: 40px;
|
|
10
14
|
justify-content: center;
|
|
@@ -29,8 +33,6 @@ export const TimeField = styled.TextInput`
|
|
|
29
33
|
|
|
30
34
|
export const Header = styled.View``;
|
|
31
35
|
|
|
32
|
-
export const Action = styled.View``;
|
|
33
|
-
|
|
34
36
|
export const Comments = styled.View`
|
|
35
37
|
margin-top: 20px;
|
|
36
38
|
padding-bottom: 40px;
|
|
@@ -55,7 +55,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
55
55
|
ordersGroup,
|
|
56
56
|
setOrdersGroup,
|
|
57
57
|
orderStatus,
|
|
58
|
-
|
|
58
|
+
ordersFormatted,
|
|
59
59
|
loadOrders,
|
|
60
60
|
loadMoreOrders,
|
|
61
61
|
onNavigationRedirect,
|
|
@@ -98,7 +98,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
98
98
|
const [slaSettingTime, setSlaSettingTime] = useState(6000)
|
|
99
99
|
const [currentDeliveryType, setCurrentDeliveryType] = useState('Delivery')
|
|
100
100
|
const [search, setSearch] = useState(defaultSearchList)
|
|
101
|
-
const [selectedTabStatus, setSelectedTabStatus] = useState([])
|
|
101
|
+
const [selectedTabStatus, setSelectedTabStatus] = useState<any>([])
|
|
102
102
|
const [hour, setHour] = useState(0)
|
|
103
103
|
const [minute, setMinute] = useState(0)
|
|
104
104
|
const [openedSelect, setOpenedSelect] = useState('')
|
|
@@ -585,9 +585,8 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
585
585
|
currentTabSelected !== 'logisticOrders' &&
|
|
586
586
|
(
|
|
587
587
|
<PreviousOrders
|
|
588
|
-
orders={
|
|
588
|
+
orders={ordersFormatted}
|
|
589
589
|
navigation={props.navigation}
|
|
590
|
-
ordersGrouped={ordersGroupedFormatted}
|
|
591
590
|
onNavigationRedirect={onNavigationRedirect}
|
|
592
591
|
getOrderStatus={getOrderStatus}
|
|
593
592
|
handleClickOrder={handleClickOrder}
|
|
@@ -840,7 +839,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
840
839
|
</ScrollView>
|
|
841
840
|
</FiltersTab>
|
|
842
841
|
<DeliveryStatusWrapper>
|
|
843
|
-
{selectedTabStatus && selectedTabStatus.length > 0 && selectedTabStatus.map((item, i) => (
|
|
842
|
+
{selectedTabStatus && selectedTabStatus.length > 0 && selectedTabStatus.map((item: any, i: number) => (
|
|
844
843
|
<StatusBlock
|
|
845
844
|
key={i}
|
|
846
845
|
item={item}
|
|
@@ -67,7 +67,7 @@ export const OrdersGroupedItem = (props: any) => {
|
|
|
67
67
|
resizeMode={FastImage.resizeMode.cover}
|
|
68
68
|
/>
|
|
69
69
|
</View>
|
|
70
|
-
<View style={{ flex: 1, marginLeft:
|
|
70
|
+
<View style={{ flex: 1, marginLeft: 5, flexDirection: 'column' }}>
|
|
71
71
|
<View>
|
|
72
72
|
<OText numberOfLines={1} style={styles.title}>
|
|
73
73
|
{t('GROUP_NRO', 'Group No.')}{groupId}
|