ordering-ui-react-native 0.14.84 → 0.14.87
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/components/OrderDetails/index.tsx +3 -1
- package/src/components/OrdersOption/index.tsx +4 -2
- package/src/utils/index.tsx +68 -0
- package/themes/business/src/components/OrdersOption/index.tsx +9 -1
- package/themes/business/src/components/PreviousMessages/index.tsx +12 -0
- package/themes/business/src/components/ReviewCustomer/index.tsx +6 -7
- package/themes/business/src/utils/index.tsx +12 -0
- package/themes/doordash/src/components/OrderDetails/index.tsx +3 -1
- package/themes/doordash/src/components/OrdersOption/index.tsx +4 -2
- package/themes/instacart/src/components/OrderDetails/index.tsx +3 -1
- package/themes/instacart/src/components/OrdersOption/index.tsx +4 -2
- package/themes/original/index.tsx +4 -0
- package/themes/original/src/components/Checkout/index.tsx +13 -0
- package/themes/original/src/components/LastOrder/index.tsx +3 -1
- package/themes/original/src/components/MessageListing/index.tsx +4 -2
- package/themes/original/src/components/OrderDetails/index.tsx +14 -0
- package/themes/original/src/components/OrderProgress/index.tsx +5 -3
- package/themes/original/src/components/OrdersOption/index.tsx +4 -2
- package/themes/original/src/components/PaymentOptions/index.tsx +1 -1
- package/themes/original/src/components/ProductForm/index.tsx +13 -12
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +75 -73
- package/themes/original/src/components/ReviewDriver/index.tsx +315 -0
- package/themes/original/src/components/ReviewDriver/styles.tsx +38 -0
- package/themes/original/src/components/ReviewOrder/index.tsx +325 -186
- package/themes/original/src/components/ReviewOrder/styles.tsx +24 -13
- package/themes/original/src/components/ReviewProducts/index.tsx +116 -0
- package/themes/original/src/components/ReviewProducts/styles.tsx +16 -0
- package/themes/original/src/components/SingleProductReview/index.tsx +166 -0
- package/themes/original/src/components/SingleProductReview/styles.tsx +27 -0
- package/themes/original/src/layouts/FloatingBottomContainer.tsx +26 -0
- package/themes/original/src/types/index.tsx +29 -2
- package/themes/single-business/src/components/LastOrder/index.tsx +3 -1
- package/themes/single-business/src/components/OrderDetails/index.tsx +15 -0
- package/themes/single-business/src/components/OrdersOption/index.tsx +4 -2
- package/themes/single-business/src/utils/index.tsx +7 -1
- package/themes/uber-eats/src/components/OrderDetails/index.tsx +3 -1
- package/themes/uber-eats/src/components/OrdersOption/index.tsx +4 -2
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react'
|
|
2
|
+
import { useLanguage, useToast, ToastType, ReviewProduct as ReviewProductController } from 'ordering-components/native'
|
|
3
|
+
import { OText, OButton } from '../shared'
|
|
4
|
+
import NavBar from '../NavBar'
|
|
5
|
+
import { ReviewProductParams } from '../../types'
|
|
6
|
+
import { FloatingBottomContainer } from '../../layouts/FloatingBottomContainer'
|
|
7
|
+
import { useTheme } from 'styled-components/native'
|
|
8
|
+
import { SingleProductReview } from '../SingleProductReview'
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
ReviewProductsContainer,
|
|
12
|
+
ActionContainer,
|
|
13
|
+
SkipButton
|
|
14
|
+
} from './styles'
|
|
15
|
+
|
|
16
|
+
const ReviewProductsUI = (props: ReviewProductParams) => {
|
|
17
|
+
const {
|
|
18
|
+
navigation,
|
|
19
|
+
order,
|
|
20
|
+
onNavigationRedirect,
|
|
21
|
+
formState,
|
|
22
|
+
handleChangeFormState,
|
|
23
|
+
handleSendProductReview
|
|
24
|
+
} = props
|
|
25
|
+
|
|
26
|
+
const [, t] = useLanguage()
|
|
27
|
+
const theme = useTheme()
|
|
28
|
+
const [, { showToast }] = useToast()
|
|
29
|
+
|
|
30
|
+
const [isProductReviewed, setIsProductReviewed] = useState(false)
|
|
31
|
+
const [alertState, setAlertState] = useState<{ open: boolean, content: Array<any>, success?: boolean }>({ open: false, content: [], success: false })
|
|
32
|
+
|
|
33
|
+
const handleContinueClick = () => {
|
|
34
|
+
setAlertState({ ...alertState, success: true })
|
|
35
|
+
handleSendProductReview()
|
|
36
|
+
}
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (alertState.open) {
|
|
39
|
+
alertState.content && showToast(
|
|
40
|
+
ToastType.Error,
|
|
41
|
+
alertState.content
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
}, [alertState.content])
|
|
45
|
+
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (!formState.loading && formState.result?.error) {
|
|
48
|
+
setAlertState({
|
|
49
|
+
open: true,
|
|
50
|
+
success: false,
|
|
51
|
+
content: formState.result?.result || [t('ERROR', 'Error')]
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
if (!formState.loading && !formState.result?.error && alertState.success) {
|
|
55
|
+
setIsProductReviewed && setIsProductReviewed(true)
|
|
56
|
+
if (order?.driver && !order?.user_review) {
|
|
57
|
+
onNavigationRedirect('ReviewDriver', { order: order })
|
|
58
|
+
} else {
|
|
59
|
+
onNavigationRedirect('MyOrders')
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}, [formState])
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<>
|
|
66
|
+
<ReviewProductsContainer>
|
|
67
|
+
<NavBar
|
|
68
|
+
title={t('REVIEW_PRODUCT', 'Review product')}
|
|
69
|
+
titleAlign={'center'}
|
|
70
|
+
onActionLeft={() => onNavigationRedirect('MyOrders')}
|
|
71
|
+
showCall={false}
|
|
72
|
+
btnStyle={{ paddingLeft: 0 }}
|
|
73
|
+
style={{ flexDirection: 'column', alignItems: 'flex-start' }}
|
|
74
|
+
titleWrapStyle={{ paddingHorizontal: 0 }}
|
|
75
|
+
titleStyle={{ marginRight: 0, marginLeft: 0 }}
|
|
76
|
+
/>
|
|
77
|
+
{order?.products.map((product: any) => (
|
|
78
|
+
<SingleProductReview
|
|
79
|
+
key={product.id}
|
|
80
|
+
product={product}
|
|
81
|
+
formState={formState}
|
|
82
|
+
handleChangeFormState={handleChangeFormState}
|
|
83
|
+
/>
|
|
84
|
+
))}
|
|
85
|
+
</ReviewProductsContainer>
|
|
86
|
+
|
|
87
|
+
<FloatingBottomContainer>
|
|
88
|
+
<ActionContainer>
|
|
89
|
+
<SkipButton
|
|
90
|
+
onPress={() => (order?.driver && !order?.user_review) ? onNavigationRedirect('ReviewDriver', { order: order }) : onNavigationRedirect('MyOrders')}
|
|
91
|
+
>
|
|
92
|
+
<OText weight={700} size={18} color={theme.colors.textNormal}>{t('FRONT_VISUALS_SKIP', 'Skip')}</OText>
|
|
93
|
+
</SkipButton>
|
|
94
|
+
<OButton
|
|
95
|
+
textStyle={{ color: theme.colors.white, paddingRight: 10 }}
|
|
96
|
+
text={order?.driver && !order?.user_review ? t('CONTINUE', 'Continue') : t('SEND_REVIEW', 'Send Review')}
|
|
97
|
+
style={{ borderRadius: 8 }}
|
|
98
|
+
imgRightSrc={theme.images.general.arrow_right}
|
|
99
|
+
imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
|
|
100
|
+
isDisabled={formState.loading || formState?.changes?.length === 0}
|
|
101
|
+
onClick={() => handleContinueClick()}
|
|
102
|
+
/>
|
|
103
|
+
</ActionContainer>
|
|
104
|
+
</FloatingBottomContainer>
|
|
105
|
+
</>
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export const ReviewProducts = (props: any) => {
|
|
110
|
+
const reviewProductProps = {
|
|
111
|
+
...props,
|
|
112
|
+
UIComponent: ReviewProductsUI,
|
|
113
|
+
isToast: true
|
|
114
|
+
}
|
|
115
|
+
return <ReviewProductController {...reviewProductProps} />
|
|
116
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import styled from 'styled-components/native'
|
|
2
|
+
|
|
3
|
+
export const ReviewProductsContainer = styled.ScrollView`
|
|
4
|
+
padding: 20px 40px;
|
|
5
|
+
margin-bottom: 100px;
|
|
6
|
+
`
|
|
7
|
+
|
|
8
|
+
export const ActionContainer = styled.View`
|
|
9
|
+
flex-direction: row;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
padding: 3px 30px;
|
|
13
|
+
`
|
|
14
|
+
|
|
15
|
+
export const SkipButton = styled.TouchableOpacity`
|
|
16
|
+
`
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react'
|
|
2
|
+
import { useLanguage } from 'ordering-components/native'
|
|
3
|
+
import { OText, OButton, OInput } from '../shared'
|
|
4
|
+
import { StyleSheet, TouchableOpacity, View } from 'react-native'
|
|
5
|
+
import AntDesignIcons from 'react-native-vector-icons/AntDesign'
|
|
6
|
+
import { useTheme } from 'styled-components/native'
|
|
7
|
+
import { SingleProductReviewParams } from '../../types'
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
ProductContainer,
|
|
11
|
+
ProductHeader,
|
|
12
|
+
LikeHandsActionContainer,
|
|
13
|
+
LikeHandsButton,
|
|
14
|
+
CommentsButtonGroup,
|
|
15
|
+
} from './styles'
|
|
16
|
+
|
|
17
|
+
export const SingleProductReview = (props: SingleProductReviewParams) => {
|
|
18
|
+
const {
|
|
19
|
+
product,
|
|
20
|
+
formState,
|
|
21
|
+
handleChangeFormState,
|
|
22
|
+
} = props
|
|
23
|
+
|
|
24
|
+
const [, t] = useLanguage()
|
|
25
|
+
const theme = useTheme()
|
|
26
|
+
|
|
27
|
+
const styles = StyleSheet.create({
|
|
28
|
+
inputTextArea: {
|
|
29
|
+
borderColor: theme.colors.lightGray,
|
|
30
|
+
borderRadius: 8,
|
|
31
|
+
marginTop: 10,
|
|
32
|
+
marginBottom: 40,
|
|
33
|
+
height: 100,
|
|
34
|
+
alignItems: 'flex-start'
|
|
35
|
+
},
|
|
36
|
+
additionalCommentButton: {
|
|
37
|
+
flexDirection: 'row',
|
|
38
|
+
justifyContent: 'center',
|
|
39
|
+
marginVertical: 10,
|
|
40
|
+
},
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
const [comments, setComments] = useState<Array<any>>([])
|
|
44
|
+
const [extraComment, setExtraComment] = useState('')
|
|
45
|
+
const [isShowTextArea, setIsShowTextArea] = useState(false)
|
|
46
|
+
const [qualification, setQualification] = useState(5)
|
|
47
|
+
|
|
48
|
+
const commentsList = [
|
|
49
|
+
{ key: 0, content: t('IT_WASNT_TASTY', "It wasn't tasty") },
|
|
50
|
+
{ key: 1, content: t('SMALL_PORTION', 'Small portion') },
|
|
51
|
+
{ key: 2, content: t('WET_OR_LEAKY', 'Wet or leaky') },
|
|
52
|
+
{ key: 3, content: t('SLOPPY_PRESENTATION', 'Sloppy presentation') },
|
|
53
|
+
{ key: 4, content: t('COLD_OR_MELTED', 'Cold or melted') }
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
const isSelectedComment = (commentKey: number) => {
|
|
57
|
+
const found = comments.find((comment: any) => comment?.key === commentKey)
|
|
58
|
+
return found
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const handleChangeComment = (commentItem: any) => {
|
|
62
|
+
const found = comments.find((comment: any) => comment?.key === commentItem.key)
|
|
63
|
+
if (found) {
|
|
64
|
+
const _comments = comments.filter((comment: any) => comment?.key !== commentItem.key)
|
|
65
|
+
setComments(_comments)
|
|
66
|
+
} else {
|
|
67
|
+
setComments([...comments, commentItem])
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
if (comments?.length === 0 && !extraComment && formState.changes?.length === 0 && qualification === 5) return
|
|
73
|
+
let _comments = ''
|
|
74
|
+
if (comments.length > 0) {
|
|
75
|
+
comments.map(comment => (_comments += comment.content + '. '))
|
|
76
|
+
}
|
|
77
|
+
const _comment = _comments + extraComment
|
|
78
|
+
let found = false
|
|
79
|
+
const _changes = formState.changes.map((item: any) => {
|
|
80
|
+
if (item?.product_id === product?.product_id) {
|
|
81
|
+
found = true
|
|
82
|
+
return {
|
|
83
|
+
product_id: product?.product_id,
|
|
84
|
+
comment: _comment,
|
|
85
|
+
qualification: qualification
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return item
|
|
89
|
+
})
|
|
90
|
+
if (!found) {
|
|
91
|
+
_changes.push({
|
|
92
|
+
product_id: product?.product_id,
|
|
93
|
+
comment: _comment,
|
|
94
|
+
qualification: qualification
|
|
95
|
+
})
|
|
96
|
+
}
|
|
97
|
+
handleChangeFormState && handleChangeFormState(_changes)
|
|
98
|
+
}, [comments, extraComment, qualification])
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<>
|
|
102
|
+
<ProductContainer>
|
|
103
|
+
<ProductHeader>
|
|
104
|
+
<OText numberOfLines={1} style={{ flex: 1 }} color={theme.colors.textNormal}>{product?.name}</OText>
|
|
105
|
+
<LikeHandsActionContainer>
|
|
106
|
+
<LikeHandsButton
|
|
107
|
+
isLike
|
|
108
|
+
onPress={() => setQualification(5)}
|
|
109
|
+
>
|
|
110
|
+
<AntDesignIcons name='like2' size={20} color={qualification === 5 ? theme.colors.primary : theme.colors.lightGray} />
|
|
111
|
+
</LikeHandsButton>
|
|
112
|
+
<LikeHandsButton onPress={() => setQualification(1)}>
|
|
113
|
+
<AntDesignIcons name='dislike2' size={20} color={qualification === 1 ? theme.colors.primary : theme.colors.lightGray} />
|
|
114
|
+
</LikeHandsButton>
|
|
115
|
+
</LikeHandsActionContainer>
|
|
116
|
+
</ProductHeader>
|
|
117
|
+
<CommentsButtonGroup>
|
|
118
|
+
{commentsList.map(commentItem => (
|
|
119
|
+
<OButton
|
|
120
|
+
key={commentItem.key}
|
|
121
|
+
text={commentItem.content}
|
|
122
|
+
bgColor={isSelectedComment(commentItem.key) ? theme.colors.primary : theme.colors.backgroundGray200}
|
|
123
|
+
borderColor={isSelectedComment(commentItem.key) ? theme.colors.primary : theme.colors.backgroundGray200}
|
|
124
|
+
textStyle={{
|
|
125
|
+
color: isSelectedComment(commentItem.key) ? theme.colors.white : theme.colors.textNormal,
|
|
126
|
+
fontSize: 13,
|
|
127
|
+
paddingRight: isSelectedComment(commentItem.key) ? 15 : 0
|
|
128
|
+
}}
|
|
129
|
+
style={{ height: 35, paddingLeft: 5, paddingRight: 5, marginHorizontal: 3, marginVertical: 10 }}
|
|
130
|
+
imgRightSrc={isSelectedComment(commentItem.key) ? theme.images.general.close : null}
|
|
131
|
+
imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
|
|
132
|
+
onClick={() => handleChangeComment(commentItem) }
|
|
133
|
+
/>
|
|
134
|
+
))}
|
|
135
|
+
</CommentsButtonGroup>
|
|
136
|
+
<TouchableOpacity
|
|
137
|
+
style={styles.additionalCommentButton}
|
|
138
|
+
onPress={() => setIsShowTextArea(!isShowTextArea)}
|
|
139
|
+
>
|
|
140
|
+
<OText
|
|
141
|
+
color={isShowTextArea ? theme.colors.primary : theme.colors.disabled}
|
|
142
|
+
style={{
|
|
143
|
+
borderBottomColor: isShowTextArea ? theme.colors.primary : theme.colors.disabled,
|
|
144
|
+
borderBottomWidth: 1
|
|
145
|
+
}}
|
|
146
|
+
>
|
|
147
|
+
{t('ADDITIONAL_COMMENTS', 'Additional comments')}
|
|
148
|
+
</OText>
|
|
149
|
+
</TouchableOpacity>
|
|
150
|
+
{isShowTextArea && (
|
|
151
|
+
<View>
|
|
152
|
+
<OText style={{ marginTop: 10 }} color={theme.colors.textNormal}>{t('REVIEW_COMMENT_QUESTION', 'Do you want to add something?')}</OText>
|
|
153
|
+
<OInput
|
|
154
|
+
name='comments'
|
|
155
|
+
onChange={(val: any) => {
|
|
156
|
+
setExtraComment(val.target.value)
|
|
157
|
+
}}
|
|
158
|
+
style={styles.inputTextArea}
|
|
159
|
+
multiline
|
|
160
|
+
/>
|
|
161
|
+
</View>
|
|
162
|
+
)}
|
|
163
|
+
</ProductContainer>
|
|
164
|
+
</>
|
|
165
|
+
)
|
|
166
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components/native'
|
|
2
|
+
|
|
3
|
+
export const ProductContainer = styled.View`
|
|
4
|
+
margin-bottom: 15px;
|
|
5
|
+
`
|
|
6
|
+
|
|
7
|
+
export const ProductHeader = styled.View`
|
|
8
|
+
flex-direction: row;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
margin-bottom: 10px;
|
|
12
|
+
`
|
|
13
|
+
|
|
14
|
+
export const LikeHandsActionContainer = styled.View`
|
|
15
|
+
flex-direction: row;
|
|
16
|
+
`
|
|
17
|
+
|
|
18
|
+
export const LikeHandsButton = styled.TouchableOpacity`
|
|
19
|
+
${(props: any) => props.isLike && css`
|
|
20
|
+
margin-horizontal: 15px;
|
|
21
|
+
`}
|
|
22
|
+
`
|
|
23
|
+
|
|
24
|
+
export const CommentsButtonGroup = styled.View`
|
|
25
|
+
flex-direction: row;
|
|
26
|
+
flex-wrap: wrap;
|
|
27
|
+
`
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import styled from 'styled-components/native'
|
|
3
|
+
import { Platform, Dimensions } from 'react-native'
|
|
4
|
+
const windowWidth = Dimensions.get('window').width
|
|
5
|
+
|
|
6
|
+
export const Container = styled.View`
|
|
7
|
+
position: absolute;
|
|
8
|
+
flex: 1;
|
|
9
|
+
bottom: 0px;
|
|
10
|
+
left: 0;
|
|
11
|
+
right: 0;
|
|
12
|
+
padding: 10px;
|
|
13
|
+
border-top-width: 1px;
|
|
14
|
+
border-color: ${(props: any) => props.theme.colors.backgroundGray200};
|
|
15
|
+
z-index: 1000;
|
|
16
|
+
background-color: ${(props: any) => props.bgColor ? props.bgColor : '#FFF'};
|
|
17
|
+
padding-bottom: ${Platform.OS === 'ios' ? '20px' : '10px'};
|
|
18
|
+
`
|
|
19
|
+
|
|
20
|
+
export const FloatingBottomContainer = (props: any) => {
|
|
21
|
+
return (
|
|
22
|
+
<Container style={{ width: windowWidth }}>
|
|
23
|
+
{props.children}
|
|
24
|
+
</Container>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
@@ -329,13 +329,40 @@ export interface ProductItemAccordionParams {
|
|
|
329
329
|
isFromCheckout?: any
|
|
330
330
|
}
|
|
331
331
|
export interface ReviewOrderParams {
|
|
332
|
-
order?: {
|
|
332
|
+
order?: { id: number, businessId: number, logo: string, driver: any, products: Array<any>, review: any, user_review: any },
|
|
333
333
|
stars?: any,
|
|
334
334
|
handleChangeInput?: any,
|
|
335
335
|
handleChangeRating?: any,
|
|
336
336
|
handleSendReview?: any,
|
|
337
337
|
formState?: any,
|
|
338
|
-
navigation?: any
|
|
338
|
+
navigation?: any,
|
|
339
|
+
setIsReviewed?: (isReviewed: boolean) => {},
|
|
340
|
+
handleReviewState?: any,
|
|
341
|
+
setStars?: any,
|
|
342
|
+
onNavigationRedirect?: any
|
|
343
|
+
}
|
|
344
|
+
export interface ReviewProductParams {
|
|
345
|
+
navigation?: any,
|
|
346
|
+
onNavigationRedirect?: any,
|
|
347
|
+
order?: { orderId: number, businessId: number, logo: string, driver: any, products: Array<any>, review: any, user_review: any },
|
|
348
|
+
formState?: any,
|
|
349
|
+
handleChangeFormState?: any,
|
|
350
|
+
handleSendProductReview?: any
|
|
351
|
+
}
|
|
352
|
+
export interface SingleProductReviewParams {
|
|
353
|
+
product: any,
|
|
354
|
+
formState?: any,
|
|
355
|
+
handleChangeFormState?: any,
|
|
356
|
+
}
|
|
357
|
+
export interface ReviewDriverParams {
|
|
358
|
+
navigation?: any,
|
|
359
|
+
onNavigationRedirect?: any,
|
|
360
|
+
order?: { orderId: number, businessId: number, logo: string, driver: any, products: Array<any>, review: any, user_review: any },
|
|
361
|
+
formState?: any,
|
|
362
|
+
setIsDriverReviewed?: (isReviewed: boolean) => {},
|
|
363
|
+
dirverReviews?: any,
|
|
364
|
+
setDriverReviews?: any,
|
|
365
|
+
handleSendDriverReview?: any
|
|
339
366
|
}
|
|
340
367
|
export interface MessagesParams {
|
|
341
368
|
type?: string,
|
|
@@ -91,7 +91,9 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
91
91
|
{ key: 18, value: t('DRIVER_ALMOST_ARRIVED_TO_BUSINESS', 'Driver almost arrived to business') },
|
|
92
92
|
{ key: 19, value: t('DRIVER_ALMOST_ARRIVED_TO_CUSTOMER', 'Driver almost arrived to customer') },
|
|
93
93
|
{ key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', 'Customer almost arrived to business') },
|
|
94
|
-
{ key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business') }
|
|
94
|
+
{ key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business') },
|
|
95
|
+
{ key: 22, value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver') },
|
|
96
|
+
{ key: 23, value: t('ORDER_DRIVER_ON_WAY', 'Driver on way') }
|
|
95
97
|
]
|
|
96
98
|
|
|
97
99
|
const objectStatus = orderStatus.find((o) => o.key === status)
|
|
@@ -284,6 +284,21 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
284
284
|
percentage: 95,
|
|
285
285
|
image: theme.images.order.status7,
|
|
286
286
|
},
|
|
287
|
+
{
|
|
288
|
+
key: 22,
|
|
289
|
+
value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
|
|
290
|
+
slug: 'ORDER_LOOKING_FOR_DRIVER',
|
|
291
|
+
percentage: 35,
|
|
292
|
+
image: theme.images.order.status8,
|
|
293
|
+
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
key: 23,
|
|
297
|
+
value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
|
|
298
|
+
slug: 'ORDER_DRIVER_ON_WAY',
|
|
299
|
+
percentage: 45,
|
|
300
|
+
image: theme.images.order.status8,
|
|
301
|
+
}
|
|
287
302
|
];
|
|
288
303
|
|
|
289
304
|
const objectStatus = orderStatus.find((o) => o.key === status);
|
|
@@ -91,7 +91,9 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
91
91
|
{ key: 18, value: t('DRIVER_ALMOST_ARRIVED_TO_BUSINESS', 'Driver almost arrived to business') },
|
|
92
92
|
{ key: 19, value: t('DRIVER_ALMOST_ARRIVED_TO_CUSTOMER', 'Driver almost arrived to customer') },
|
|
93
93
|
{ key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', 'Customer almost arrived to business') },
|
|
94
|
-
{ key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business') }
|
|
94
|
+
{ key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business') },
|
|
95
|
+
{ key: 22, value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver') },
|
|
96
|
+
{ key: 23, value: t('ORDER_DRIVER_ON_WAY', 'Driver on way') }
|
|
95
97
|
]
|
|
96
98
|
|
|
97
99
|
const objectStatus = orderStatus.find((o) => o.key === status)
|
|
@@ -228,7 +230,7 @@ export const OrdersOption = (props: OrdersOptionParams) => {
|
|
|
228
230
|
...props,
|
|
229
231
|
UIComponent: OrdersOptionUI,
|
|
230
232
|
orderStatus: props.preOrders ? [13] : props.activeOrders
|
|
231
|
-
? [0, 3, 4, 7, 8, 9, 14, 15, 18, 19, 20, 21]
|
|
233
|
+
? [0, 3, 4, 7, 8, 9, 14, 15, 18, 19, 20, 21, 22, 23]
|
|
232
234
|
: [1, 2, 5, 6, 10, 11, 12, 16, 17],
|
|
233
235
|
useDefualtSessionManager: true,
|
|
234
236
|
paginationSettings: {
|
|
@@ -216,6 +216,10 @@ export const getOrderStatus = (status: number) => {
|
|
|
216
216
|
return 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS'
|
|
217
217
|
case 21:
|
|
218
218
|
return 'ORDER_CUSTOMER_ARRIVED_BUSINESS'
|
|
219
|
+
case 22:
|
|
220
|
+
return 'ORDER_LOOKING_FOR_DRIVER'
|
|
221
|
+
case 23:
|
|
222
|
+
return 'ORDER_DRIVER_ON_WAY'
|
|
219
223
|
default:
|
|
220
224
|
return status
|
|
221
225
|
}
|
|
@@ -245,7 +249,9 @@ export const getTextOrderStatus = (s: string, t: any) => {
|
|
|
245
249
|
{ key: 18, value: t('DRIVER_ALMOST_ARRIVED_TO_BUSINESS', 'Driver almost arrived to business') },
|
|
246
250
|
{ key: 19, value: t('DRIVER_ALMOST_ARRIVED_TO_CUSTOMER', 'Driver almost arrived to customer') },
|
|
247
251
|
{ key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', 'Customer almost arrived to business') },
|
|
248
|
-
{ key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business') }
|
|
252
|
+
{ key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business') },
|
|
253
|
+
{ key: 22, value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver') },
|
|
254
|
+
{ key: 23, value: t('ORDER_DRIVER_ON_WAY', 'Driver on way') }
|
|
249
255
|
]
|
|
250
256
|
|
|
251
257
|
const objectStatus = orderStatus.find((o) => o.key === status)
|
|
@@ -119,7 +119,9 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
119
119
|
{ key: 18, value: t('DRIVER_ALMOST_ARRIVED_TO_BUSINESS', 'Driver almost arrived to business'), slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS', progress: 2 },
|
|
120
120
|
{ key: 19, value: t('DRIVER_ALMOST_ARRIVED_TO_CUSTOMER', 'Driver almost arrived to customer'), slug: 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER', progress: 2 },
|
|
121
121
|
{ key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', 'Customer almost arrived to business'), slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', progress: 2 },
|
|
122
|
-
{ key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business'), slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS', progress: 2 }
|
|
122
|
+
{ key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business'), slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS', progress: 2 },
|
|
123
|
+
{ key: 22, value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'), slug: 'ORDER_LOOKING_FOR_DRIVER', progress: 2 },
|
|
124
|
+
{ key: 23, value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'), slug: 'ORDER_DRIVER_ON_WAY', progress: 2 }
|
|
123
125
|
]
|
|
124
126
|
|
|
125
127
|
const objectStatus = orderStatus.find((o) => o.key === status)
|
|
@@ -89,7 +89,9 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
89
89
|
{ key: 18, value: t('DRIVER_ALMOST_ARRIVED_TO_BUSINESS', 'Driver almost arrived to business') },
|
|
90
90
|
{ key: 19, value: t('DRIVER_ALMOST_ARRIVED_TO_CUSTOMER', 'Driver almost arrived to customer') },
|
|
91
91
|
{ key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', 'Customer almost arrived to business') },
|
|
92
|
-
{ key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business') }
|
|
92
|
+
{ key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business') },
|
|
93
|
+
{ key: 22, value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver') },
|
|
94
|
+
{ key: 23, value: t('ORDER_DRIVER_ON_WAY', 'Driver on way') }
|
|
93
95
|
]
|
|
94
96
|
|
|
95
97
|
const objectStatus = orderStatus.find((o) => o.key === status)
|
|
@@ -208,7 +210,7 @@ export const OrdersOption = (props: OrdersOptionParams) => {
|
|
|
208
210
|
...props,
|
|
209
211
|
UIComponent: OrdersOptionUI,
|
|
210
212
|
orderStatus: props.activeOrders
|
|
211
|
-
? [0, 3, 4, 7, 8, 9, 13, 14, 15, 18, 19, 20, 21]
|
|
213
|
+
? [0, 3, 4, 7, 8, 9, 13, 14, 15, 18, 19, 20, 21, 22, 23]
|
|
212
214
|
: [1, 2, 5, 6, 10, 11, 12, 16, 17],
|
|
213
215
|
useDefualtSessionManager: true,
|
|
214
216
|
paginationSettings: {
|