ordering-ui-react-native 0.16.41 → 0.16.44
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/ReviewOrder/index.tsx +2 -2
- package/src/pages/BusinessesListing.tsx +7 -6
- package/src/pages/OrderDetails.tsx +1 -1
- package/src/pages/ReviewDriver.tsx +2 -2
- package/src/pages/ReviewOrder.tsx +2 -2
- package/themes/business/src/components/PreviousOrders/index.tsx +5 -5
- package/themes/original/src/components/BusinessesListing/index.tsx +38 -5
- package/themes/original/src/components/Checkout/index.tsx +3 -3
- package/themes/original/src/components/NavBar/index.tsx +4 -4
- package/themes/original/src/components/OrderDetails/index.tsx +2 -0
- package/themes/original/src/components/ReviewDriver/index.tsx +6 -6
- package/themes/original/src/components/ReviewOrder/index.tsx +98 -78
- package/themes/original/src/components/ReviewOrder/styles.tsx +9 -0
- package/themes/original/src/types/index.tsx +1 -1
package/package.json
CHANGED
|
@@ -106,7 +106,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
const qualificationList = [
|
|
109
|
-
{ key: 1, text: t('TERRIBLE', 'Terrible'), percent: 0, parentStyle: { left: '0%' }, isInnerStyle: false, pointerColor: false },
|
|
109
|
+
{ key: 1, text: t('TERRIBLE', 'Terrible'), percent: 0.0001, parentStyle: { left: '0%' }, isInnerStyle: false, pointerColor: false },
|
|
110
110
|
{ key: 2, text: t('BAD', 'Bad'), percent: 0.25, parentStyle: { left: '25%' }, isInnerStyle: true, pointerColor: true },
|
|
111
111
|
{ key: 3, text: t('OKAY', 'Okay'), percent: 0.5, parentStyle: { left: '50%' }, isInnerStyle: true, pointerColor: true },
|
|
112
112
|
{ key: 4, text: t('GOOD', 'Good'), percent: 0.75, parentStyle: { left: '75%' }, isInnerStyle: true, pointerColor: true },
|
|
@@ -238,7 +238,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
|
238
238
|
<RatingBarContainer>
|
|
239
239
|
<LinearGradient
|
|
240
240
|
start={{ x: 0.0, y: 0.0 }}
|
|
241
|
-
end={{ x: qualificationList[stars.quality - 1]?.percent || 0, y: 0 }}
|
|
241
|
+
end={{ x: qualificationList[stars.quality - 1]?.percent || 0.0, y: 0.0 }}
|
|
242
242
|
locations={[.9999, .9999]}
|
|
243
243
|
colors={[theme.colors.primary, theme.colors.lightGray]}
|
|
244
244
|
style={styles.statusBar}
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import React, {useEffect} from 'react'
|
|
1
|
+
import React, { useEffect } from 'react'
|
|
2
2
|
import { BusinessesListing as BusinessListingController } from '../components/BusinessesListing'
|
|
3
3
|
import styled from 'styled-components/native'
|
|
4
4
|
import { useTheme } from 'styled-components/native'
|
|
5
5
|
|
|
6
6
|
const BusinessesListing = (props: any) => {
|
|
7
7
|
const theme = useTheme()
|
|
8
|
-
const businessId =
|
|
8
|
+
const businessId = props.route.params?.businessId
|
|
9
9
|
const categoryId = props.route.params?.categoryId
|
|
10
|
-
const productId =
|
|
11
|
-
const store =
|
|
10
|
+
const productId = props.route.params?.productId
|
|
11
|
+
const store = props.route.params?.store
|
|
12
12
|
|
|
13
13
|
useEffect(() => {
|
|
14
|
-
if(store){
|
|
15
|
-
props.navigation.navigate('Business', {store,businessId,categoryId,productId})
|
|
14
|
+
if (store) {
|
|
15
|
+
props.navigation.navigate('Business', { store, businessId, categoryId, productId })
|
|
16
16
|
return
|
|
17
17
|
}
|
|
18
18
|
}, [businessId, categoryId, productId, store])
|
|
19
19
|
|
|
20
20
|
const BusinessesListingProps = {
|
|
21
21
|
...props,
|
|
22
|
+
navigation: props?.navigation,
|
|
22
23
|
isSearchByName: true,
|
|
23
24
|
isSearchByDescription: true,
|
|
24
25
|
propsToFetch: ['id', 'name', 'header', 'logo', 'ribbon', 'location', 'schedule', 'open', 'delivery_price', 'distance', 'delivery_time', 'pickup_time', 'reviews', 'featured', 'offers', 'food', 'laundry', 'alcohol', 'groceries', 'slug'],
|
|
@@ -2,7 +2,7 @@ import React from 'react'
|
|
|
2
2
|
import { OrderDetails as OrderDetailsController } from '../components/OrderDetails'
|
|
3
3
|
import { SafeAreaContainer } from '../layouts/SafeAreaContainer'
|
|
4
4
|
|
|
5
|
-
const OrderDetails = ({ navigation, route }
|
|
5
|
+
const OrderDetails = ({ navigation, route }: any) => {
|
|
6
6
|
const orderDetailsProps = {
|
|
7
7
|
navigation,
|
|
8
8
|
orderId: route.params?.orderId,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { Platform } from 'react-native';
|
|
3
3
|
import styled from 'styled-components/native';
|
|
4
|
-
import {ReviewDriver as ReviewDriverController} from '../components/ReviewDriver'
|
|
4
|
+
import { ReviewDriver as ReviewDriverController } from '../components/ReviewDriver'
|
|
5
5
|
import { SafeAreaContainer } from '../layouts/SafeAreaContainer';
|
|
6
6
|
|
|
7
7
|
const KeyboardView = styled.KeyboardAvoidingView`
|
|
8
8
|
flex: 1;
|
|
9
9
|
`;
|
|
10
10
|
|
|
11
|
-
const ReviewDriver = ({navigation, route}
|
|
11
|
+
const ReviewDriver = ({ navigation, route }: any) => {
|
|
12
12
|
const reviewDriverProps = {
|
|
13
13
|
navigation,
|
|
14
14
|
order: route?.params?.order,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { Platform } from 'react-native';
|
|
3
3
|
import styled from 'styled-components/native';
|
|
4
|
-
import {ReviewOrder as ReviewOrderController} from '../components/ReviewOrder'
|
|
4
|
+
import { ReviewOrder as ReviewOrderController } from '../components/ReviewOrder'
|
|
5
5
|
import { SafeAreaContainer } from '../layouts/SafeAreaContainer';
|
|
6
6
|
|
|
7
7
|
const KeyboardView = styled.KeyboardAvoidingView`
|
|
8
8
|
flex: 1;
|
|
9
9
|
`;
|
|
10
10
|
|
|
11
|
-
const ReviewOrder = ({navigation, route}
|
|
11
|
+
const ReviewOrder = ({ navigation, route }: any) => {
|
|
12
12
|
const reviewOrderProps = {
|
|
13
13
|
navigation,
|
|
14
14
|
order: route?.params?.order,
|
|
@@ -182,7 +182,7 @@ export const PreviousOrders = (props: any) => {
|
|
|
182
182
|
<Timestatus style={{ backgroundColor: getStatusClassName(getDelayMinutes(order)) === 'in_time' ? '#00D27A' : getStatusClassName(getDelayMinutes(order)) === 'at_risk' ? '#FFC700' : getStatusClassName(getDelayMinutes(order)) === 'delayed' ? '#E63757' : '' }} />
|
|
183
183
|
)}
|
|
184
184
|
{
|
|
185
|
-
order.business?.logo && (
|
|
185
|
+
!!order.business?.logo && (
|
|
186
186
|
<Logo style={styles.logo}>
|
|
187
187
|
<OIcon
|
|
188
188
|
url={optimizeImage(
|
|
@@ -194,17 +194,17 @@ export const PreviousOrders = (props: any) => {
|
|
|
194
194
|
</Logo>
|
|
195
195
|
)}
|
|
196
196
|
<Information>
|
|
197
|
-
{order?.order_group_id && (
|
|
197
|
+
{!!order?.order_group_id && (
|
|
198
198
|
<OText>
|
|
199
199
|
<OText>{(t('INVOICE_GROUP_NO', 'Group No.') + order?.order_group_id)}</OText>
|
|
200
200
|
</OText>
|
|
201
201
|
)}
|
|
202
|
-
{order.business?.name && (
|
|
202
|
+
{!!order.business?.name && (
|
|
203
203
|
<OText numberOfLines={1} style={styles.title}>
|
|
204
204
|
{order.business?.name}
|
|
205
205
|
</OText>
|
|
206
206
|
)}
|
|
207
|
-
{order?.showNotification && (
|
|
207
|
+
{!!order?.showNotification && (
|
|
208
208
|
<NotificationIcon>
|
|
209
209
|
<EntypoIcon
|
|
210
210
|
name="dot-single"
|
|
@@ -258,7 +258,7 @@ export const PreviousOrders = (props: any) => {
|
|
|
258
258
|
</TouchableOpacity>
|
|
259
259
|
{isLogisticOrder && (
|
|
260
260
|
<AcceptOrRejectOrder>
|
|
261
|
-
{order?.order_group_id && order?.order_group ? (
|
|
261
|
+
{!!order?.order_group_id && !!order?.order_group ? (
|
|
262
262
|
<OButton
|
|
263
263
|
text={t('VIEW_ORDER', 'View order')}
|
|
264
264
|
onClick={() => handlePressOrder({ ...order, logistic_order_id: _order?.id })}
|
|
@@ -1,17 +1,50 @@
|
|
|
1
1
|
|
|
2
|
-
import React from 'react'
|
|
2
|
+
import React, { useState, useEffect } from 'react'
|
|
3
|
+
import { useOrder, useSession } from 'ordering-components/native';
|
|
4
|
+
|
|
3
5
|
import { useTheme } from 'styled-components/native'
|
|
4
6
|
import { BusinessesListing as OriginalBusinessListing } from './Layout/Original'
|
|
5
7
|
import { BusinessesListing as AppointmentBusinessListing } from './Layout/Appointment'
|
|
6
8
|
|
|
7
9
|
export const BusinessesListing = (props: any) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
const theme = useTheme()
|
|
11
|
+
const layout = theme?.layout?.businessListing?.layout?.type || 'original'
|
|
12
|
+
const [{ auth }] = useSession()
|
|
13
|
+
const [, { getLastOrderHasNoReview }] = useOrder();
|
|
14
|
+
const [, setIsReviewed] = useState(false)
|
|
15
|
+
const handleOrderReview = (order: any) => {
|
|
16
|
+
props?.navigation && props.navigation.navigate(
|
|
17
|
+
'ReviewOrder',
|
|
18
|
+
{
|
|
19
|
+
order: {
|
|
20
|
+
id: order?.id,
|
|
21
|
+
business_id: order?.business_id,
|
|
22
|
+
business_name: order?.business?.name,
|
|
23
|
+
delivery_datetime: order?.delivery_datetime,
|
|
24
|
+
logo: order.business?.logo,
|
|
25
|
+
driver: order?.driver,
|
|
26
|
+
products: order?.products,
|
|
27
|
+
review: order?.review,
|
|
28
|
+
user_review: order?.user_review
|
|
29
|
+
},
|
|
30
|
+
setIsReviewed
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const _getLastOrderHasNoReview = async () => {
|
|
36
|
+
const lastOrderHasNoReview = await getLastOrderHasNoReview()
|
|
37
|
+
lastOrderHasNoReview && handleOrderReview(lastOrderHasNoReview)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
auth && _getLastOrderHasNoReview()
|
|
42
|
+
}, [auth])
|
|
10
43
|
|
|
11
|
-
|
|
44
|
+
return (
|
|
12
45
|
<>
|
|
13
46
|
{(layout === 'original') && <OriginalBusinessListing {...props} />}
|
|
14
47
|
{(layout === 'appointment') && <AppointmentBusinessListing {...props} />}
|
|
15
48
|
</>
|
|
16
|
-
|
|
49
|
+
)
|
|
17
50
|
}
|
|
@@ -178,7 +178,7 @@ const CheckoutUI = (props: any) => {
|
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
const handlePlaceOrder = (confirmPayment) => {
|
|
181
|
+
const handlePlaceOrder = (confirmPayment : any) => {
|
|
182
182
|
if (!userErrors.length && !requiredFields?.length) {
|
|
183
183
|
handlerClickPlaceOrder && handlerClickPlaceOrder(null, null, confirmPayment)
|
|
184
184
|
return
|
|
@@ -741,7 +741,7 @@ const CheckoutUI = (props: any) => {
|
|
|
741
741
|
</Container>
|
|
742
742
|
{!cartState.loading && cart && cart?.status !== 2 && (
|
|
743
743
|
<FloatingButton
|
|
744
|
-
handleClick={() => handlePlaceOrder()}
|
|
744
|
+
handleClick={() => handlePlaceOrder(null)}
|
|
745
745
|
isSecondaryBtn={isDisabledButtonPlace}
|
|
746
746
|
disabled={isDisabledButtonPlace}
|
|
747
747
|
btnText={cart?.subtotal >= cart?.minimum
|
|
@@ -755,7 +755,7 @@ const CheckoutUI = (props: any) => {
|
|
|
755
755
|
: (`${t('MINIMUN_SUBTOTAL_ORDER', 'Minimum subtotal order:')} ${parsePrice(cart?.minimum)}`)
|
|
756
756
|
}
|
|
757
757
|
btnRightValueShow
|
|
758
|
-
btnRightValue={parsePrice(cart?.
|
|
758
|
+
btnRightValue={parsePrice(cart?.balance)}
|
|
759
759
|
iosBottom={30}
|
|
760
760
|
/>
|
|
761
761
|
)}
|
|
@@ -62,7 +62,7 @@ const NavBar = (props: Props) => {
|
|
|
62
62
|
<Wrapper style={{ paddingTop: props.paddingTop, ...{ flexDirection: props.isVertical ? 'column' : 'row', alignItems: props.isVertical ? 'flex-start' : 'center' }, ...props.style }}>
|
|
63
63
|
<OButton
|
|
64
64
|
imgLeftSrc={props.leftImg || theme.images.general.arrow_left}
|
|
65
|
-
imgLeftStyle={{width: 18}}
|
|
65
|
+
imgLeftStyle={{ width: 18 }}
|
|
66
66
|
imgRightSrc={null}
|
|
67
67
|
style={{ ...btnBackArrow, ...props.btnStyle, ...props.isVertical ? (I18nManager.isRTL ? { paddingRight: 0 } : { paddingLeft: 0 }) : {} }}
|
|
68
68
|
onClick={props?.onActionLeft}
|
|
@@ -126,9 +126,9 @@ NavBar.defaultProps = {
|
|
|
126
126
|
textAlign: 'center'
|
|
127
127
|
};
|
|
128
128
|
|
|
129
|
-
const areEqual=(prevProps: { route?: any; }, nextProps: { route?: any; })=>{
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
const areEqual = (prevProps: { route?: any; }, nextProps: { route?: any; }) => {
|
|
130
|
+
return prevProps.route === nextProps.route
|
|
131
|
+
return true
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
export default React.memo(NavBar, areEqual);
|
|
@@ -354,6 +354,8 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
354
354
|
id: order?.id,
|
|
355
355
|
business_id: order?.business_id,
|
|
356
356
|
logo: order.business?.logo,
|
|
357
|
+
business_name: order?.business?.name,
|
|
358
|
+
delivery_datetime: order?.delivery_datetime,
|
|
357
359
|
driver: order?.driver,
|
|
358
360
|
products: order?.products,
|
|
359
361
|
review: order?.review,
|
|
@@ -44,7 +44,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
|
|
|
44
44
|
photoWrapper: {
|
|
45
45
|
shadowColor: theme.colors.black,
|
|
46
46
|
shadowRadius: 3,
|
|
47
|
-
shadowOffset: {width: 1, height: 4},
|
|
47
|
+
shadowOffset: { width: 1, height: 4 },
|
|
48
48
|
elevation: 3,
|
|
49
49
|
borderRadius: 8,
|
|
50
50
|
shadowOpacity: 0.1,
|
|
@@ -86,11 +86,11 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
|
|
|
86
86
|
const [alertState, setAlertState] = useState<{ open: boolean, content: Array<any>, success?: boolean }>({ open: false, content: [], success: false })
|
|
87
87
|
|
|
88
88
|
const qualificationList = [
|
|
89
|
-
{ key: 1, text: t('TERRIBLE', 'Terrible'), percent: 0,
|
|
89
|
+
{ key: 1, text: t('TERRIBLE', 'Terrible'), percent: 0, parentStyle: { left: '0%' }, isInnerStyle: false, pointerColor: false },
|
|
90
90
|
{ key: 2, text: t('BAD', 'Bad'), percent: 0.25, parentStyle: { left: '25%' }, isInnerStyle: true, pointerColor: true },
|
|
91
91
|
{ key: 3, text: t('OKAY', 'Okay'), percent: 0.5, parentStyle: { left: '50%' }, isInnerStyle: true, pointerColor: true },
|
|
92
92
|
{ key: 4, text: t('GOOD', 'Good'), percent: 0.75, parentStyle: { left: '75%' }, isInnerStyle: true, pointerColor: true },
|
|
93
|
-
{ key: 5, text: t('GREAT', 'Great'), percent: 1, parentStyle: { right: '0%' }, isInnerStyle: false,
|
|
93
|
+
{ key: 5, text: t('GREAT', 'Great'), percent: 1, parentStyle: { right: '0%' }, isInnerStyle: false, pointerColor: false }
|
|
94
94
|
]
|
|
95
95
|
|
|
96
96
|
const commentsList = reviewCommentList('driver')
|
|
@@ -204,7 +204,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
|
|
|
204
204
|
<OIcon
|
|
205
205
|
url={order?.driver?.photo}
|
|
206
206
|
src={!order?.driver?.photo && theme.images.general.user}
|
|
207
|
-
cover={order?.driver?.photo ? true: false}
|
|
207
|
+
cover={order?.driver?.photo ? true : false}
|
|
208
208
|
width={80}
|
|
209
209
|
height={80}
|
|
210
210
|
/>
|
|
@@ -212,7 +212,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
|
|
|
212
212
|
<OText weight={500} style={{ marginVertical: 10 }} color={theme.colors.textNormal}>{order?.driver?.name} {order?.driver?.lastname}</OText>
|
|
213
213
|
</DriverPhotoContainer>
|
|
214
214
|
|
|
215
|
-
<View style={{flex: 1, justifyContent: 'flex-end'}}>
|
|
215
|
+
<View style={{ flex: 1, justifyContent: 'flex-end' }}>
|
|
216
216
|
<FormReviews>
|
|
217
217
|
<OText mBottom={13} color={theme.colors.textNormal}>{t('HOW_WAS_YOUR_DRIVER', 'How was your driver?')}</OText>
|
|
218
218
|
<RatingBarContainer>
|
|
@@ -264,7 +264,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
|
|
|
264
264
|
style={{ height: 35, paddingLeft: 5, paddingRight: 5, marginHorizontal: 3, marginVertical: 10 }}
|
|
265
265
|
imgRightSrc={isSelectedComment(commentItem.key) ? theme.images.general.close : null}
|
|
266
266
|
imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
|
|
267
|
-
onClick={() => handleChangeComment(commentItem)
|
|
267
|
+
onClick={() => handleChangeComment(commentItem)}
|
|
268
268
|
/>
|
|
269
269
|
))}
|
|
270
270
|
</CommentsButtonGroup>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
|
-
import
|
|
2
|
+
import FontAwesome from 'react-native-vector-icons/FontAwesome';
|
|
3
|
+
import { OrderReview as ReviewOrderController, useLanguage, useToast, ToastType, useUtils } from 'ordering-components/native'
|
|
3
4
|
import { useForm, Controller } from 'react-hook-form'
|
|
4
5
|
import LinearGradient from 'react-native-linear-gradient'
|
|
5
6
|
|
|
@@ -11,7 +12,9 @@ import {
|
|
|
11
12
|
ActionContainer,
|
|
12
13
|
SkipButton,
|
|
13
14
|
RatingBarContainer,
|
|
14
|
-
RatingTextContainer
|
|
15
|
+
RatingTextContainer,
|
|
16
|
+
RatingStarContainer,
|
|
17
|
+
PlacedDate
|
|
15
18
|
} from './styles'
|
|
16
19
|
import { OButton, OIcon, OInput, OText } from '../shared'
|
|
17
20
|
import { TouchableOpacity, StyleSheet, View, I18nManager } from 'react-native';
|
|
@@ -88,10 +91,11 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
|
88
91
|
const [, t] = useLanguage()
|
|
89
92
|
const [, { showToast }] = useToast()
|
|
90
93
|
const { handleSubmit, control, errors } = useForm()
|
|
91
|
-
|
|
94
|
+
const [{ parseDate }] = useUtils()
|
|
92
95
|
const [alertState, setAlertState] = useState<{ open: boolean, content: Array<any>, success?: boolean }>({ open: false, content: [], success: false })
|
|
93
96
|
const [comments, setComments] = useState<Array<any>>([])
|
|
94
97
|
const [extraComment, setExtraComment] = useState('')
|
|
98
|
+
const placedOnDate = parseDate(order?.delivery_datetime, { outputFormat: 'dddd MMMM DD, YYYY' })
|
|
95
99
|
|
|
96
100
|
const onSubmit = () => {
|
|
97
101
|
if (Object.values(stars).some((value: any) => value === 0)) {
|
|
@@ -191,14 +195,15 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
|
191
195
|
<>
|
|
192
196
|
<ReviewOrderContainer>
|
|
193
197
|
<NavBar
|
|
194
|
-
title={t('
|
|
198
|
+
title={t('HEY', 'Hey! ') + t('HOW_WAS_YOUR_ORDER', 'How was your order?')}
|
|
195
199
|
titleAlign={'center'}
|
|
200
|
+
leftImg={theme.images.general.close}
|
|
196
201
|
onActionLeft={() => navigation?.canGoBack() && navigation.goBack()}
|
|
197
202
|
showCall={false}
|
|
198
203
|
btnStyle={{ paddingLeft: 0 }}
|
|
199
|
-
style={{ flexDirection: 'column', alignItems: 'flex-start' }}
|
|
200
|
-
titleWrapStyle={{ paddingHorizontal: 0 }}
|
|
201
|
-
titleStyle={{ marginRight: 0, marginLeft: 0 }}
|
|
204
|
+
style={{ flexDirection: 'column', alignItems: 'flex-start', justifyContent: 'center' }}
|
|
205
|
+
titleWrapStyle={{ paddingHorizontal: 0, width: '100%', justifyContent: 'center' }}
|
|
206
|
+
titleStyle={{ textAlign: 'center', marginRight: 0, marginLeft: 0 }}
|
|
202
207
|
/>
|
|
203
208
|
<BusinessLogo>
|
|
204
209
|
<View style={styles.logoWrapper}>
|
|
@@ -209,6 +214,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
|
209
214
|
/>
|
|
210
215
|
</View>
|
|
211
216
|
</BusinessLogo>
|
|
217
|
+
{!!order?.business_name && <OText style={{ textAlign: 'center', marginTop: 15 }} color={theme.colors.textNormal}>{order?.business_name}</OText>}
|
|
212
218
|
{order?.review ? (
|
|
213
219
|
<View style={styles.reviewedStyle}>
|
|
214
220
|
<OText color={theme.colors.primary}>{t('ORDER_REVIEWED', 'This order has been already reviewed')}</OText>
|
|
@@ -216,78 +222,92 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
|
216
222
|
) : (
|
|
217
223
|
<View style={{ flex: 1, justifyContent: 'flex-end' }}>
|
|
218
224
|
<FormReviews>
|
|
219
|
-
<OText mBottom={13} color={theme.colors.textNormal}>{t('HOW_WAS_YOUR_ORDER', 'How was your order?')}</OText>
|
|
220
|
-
|
|
221
|
-
<
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
<RatingTextContainer>
|
|
229
|
-
{qualificationList.map((qualification: any) => (
|
|
230
|
-
<View
|
|
231
|
-
key={qualification.key}
|
|
232
|
-
style={{ ...qualification.parentStyle, ...styles.ratingItemContainer }}
|
|
233
|
-
>
|
|
234
|
-
<TouchableOpacity
|
|
235
|
-
style={qualification.isInnerStyle && styles.ratingItem}
|
|
236
|
-
onPress={() => handleChangeStars(qualification.key)}
|
|
237
|
-
>
|
|
238
|
-
<View
|
|
239
|
-
style={{
|
|
240
|
-
...styles.ratingLineStyle,
|
|
241
|
-
backgroundColor: (qualification.pointerColor && !(stars.quality >= qualification.key)) ? theme.colors.dusk : 'transparent'
|
|
242
|
-
}}
|
|
243
|
-
/>
|
|
244
|
-
<OText size={12} color={stars.quality === qualification.key ? theme.colors.black : theme.colors.backgroundGray200}>{qualification.text}</OText>
|
|
245
|
-
</TouchableOpacity>
|
|
246
|
-
</View>
|
|
247
|
-
))}
|
|
248
|
-
</RatingTextContainer>
|
|
249
|
-
</RatingBarContainer>
|
|
250
|
-
|
|
251
|
-
<OText style={{ marginTop: 30 }} color={theme.colors.textNormal}>
|
|
252
|
-
{commentsList[stars?.quality || 1]?.title}
|
|
253
|
-
</OText>
|
|
254
|
-
<CommentsButtonGroup>
|
|
255
|
-
{commentsList[stars?.quality || 1]?.list?.map(commentItem => (
|
|
256
|
-
<OButton
|
|
257
|
-
key={commentItem.key}
|
|
258
|
-
text={commentItem.content}
|
|
259
|
-
bgColor={isSelectedComment(commentItem.key) ? theme.colors.primary : theme.colors.backgroundGray200}
|
|
260
|
-
borderColor={isSelectedComment(commentItem.key) ? theme.colors.primary : theme.colors.backgroundGray200}
|
|
261
|
-
textStyle={{
|
|
262
|
-
color: isSelectedComment(commentItem.key) ? theme.colors.white : theme.colors.black,
|
|
263
|
-
fontSize: 13,
|
|
264
|
-
paddingRight: isSelectedComment(commentItem.key) ? 15 : 0
|
|
265
|
-
}}
|
|
266
|
-
style={{ height: 35, paddingLeft: 5, paddingRight: 5, marginHorizontal: 3, marginVertical: 10 }}
|
|
267
|
-
imgRightSrc={isSelectedComment(commentItem.key) ? theme.images.general.close : null}
|
|
268
|
-
imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
|
|
269
|
-
onClick={() => handleChangeComment(commentItem)}
|
|
270
|
-
/>
|
|
271
|
-
))}
|
|
272
|
-
</CommentsButtonGroup>
|
|
273
|
-
|
|
274
|
-
<OText style={{ marginTop: 30 }} color={theme.colors.textNormal}>{t('REVIEW_COMMENT_QUESTION', 'Do you want to add something?')}</OText>
|
|
275
|
-
<Controller
|
|
276
|
-
control={control}
|
|
277
|
-
defaultValue=''
|
|
278
|
-
name='comments'
|
|
279
|
-
render={({ onChange }: any) => (
|
|
280
|
-
<OInput
|
|
281
|
-
name='comments'
|
|
282
|
-
onChange={(val: any) => {
|
|
283
|
-
onChange(val)
|
|
284
|
-
setExtraComment(val.target.value)
|
|
285
|
-
}}
|
|
286
|
-
style={styles.inputTextArea}
|
|
287
|
-
multiline
|
|
225
|
+
{/* <OText mBottom={13} color={theme.colors.textNormal}>{t('HOW_WAS_YOUR_ORDER', 'How was your order?')}</OText> */}
|
|
226
|
+
{false && (
|
|
227
|
+
<RatingBarContainer>
|
|
228
|
+
<LinearGradient
|
|
229
|
+
start={{ x: 0.0, y: 0.0 }}
|
|
230
|
+
end={{ x: qualificationList[stars.quality - 1]?.percent || 0, y: 0 }}
|
|
231
|
+
locations={[.9999, .9999]}
|
|
232
|
+
colors={[theme.colors.primary, theme.colors.backgroundGray200]}
|
|
233
|
+
style={styles.statusBar}
|
|
288
234
|
/>
|
|
235
|
+
<RatingTextContainer>
|
|
236
|
+
{qualificationList.map((qualification: any) => (
|
|
237
|
+
<View
|
|
238
|
+
key={qualification.key}
|
|
239
|
+
style={{ ...qualification.parentStyle, ...styles.ratingItemContainer }}
|
|
240
|
+
>
|
|
241
|
+
<TouchableOpacity
|
|
242
|
+
style={qualification.isInnerStyle && styles.ratingItem}
|
|
243
|
+
onPress={() => handleChangeStars(qualification.key)}
|
|
244
|
+
>
|
|
245
|
+
<View
|
|
246
|
+
style={{
|
|
247
|
+
...styles.ratingLineStyle,
|
|
248
|
+
backgroundColor: (qualification.pointerColor && !(stars.quality >= qualification.key)) ? theme.colors.dusk : 'transparent'
|
|
249
|
+
}}
|
|
250
|
+
/>
|
|
251
|
+
<OText size={12} color={stars.quality === qualification.key ? theme.colors.black : theme.colors.backgroundGray200}>{qualification.text}</OText>
|
|
252
|
+
</TouchableOpacity>
|
|
253
|
+
</View>
|
|
254
|
+
))}
|
|
255
|
+
</RatingTextContainer>
|
|
256
|
+
</RatingBarContainer>
|
|
257
|
+
)}
|
|
258
|
+
<RatingStarContainer>
|
|
259
|
+
{[...Array(5).keys()].map((index) => (<FontAwesome name={(index <= (stars?.quality - 1)) ? 'star' : 'star-o'} size={28} key={`star-symbol-${index}`} onPress={() => handleChangeStars(index + 1)} color={theme?.colors?.primary} />)
|
|
289
260
|
)}
|
|
290
|
-
|
|
261
|
+
</RatingStarContainer>
|
|
262
|
+
<PlacedDate>
|
|
263
|
+
<OText color={theme.colors.textNormal}>{t('DONOT_FORGET_RATE_YOUR_ORDER', 'Do not forget to rate your order placed on ')}</OText>
|
|
264
|
+
<OText color={theme.colors.textNormal} style={{ fontWeight: "bold" }}>{placedOnDate}</OText>
|
|
265
|
+
</PlacedDate>
|
|
266
|
+
{false && (
|
|
267
|
+
<>
|
|
268
|
+
<OText style={{ marginTop: 30 }} color={theme.colors.textNormal}>
|
|
269
|
+
{commentsList[stars?.quality || 1]?.title}
|
|
270
|
+
</OText>
|
|
271
|
+
<CommentsButtonGroup>
|
|
272
|
+
{commentsList[stars?.quality || 1]?.list?.map((commentItem: any) => (
|
|
273
|
+
<OButton
|
|
274
|
+
key={commentItem.key}
|
|
275
|
+
text={commentItem.content}
|
|
276
|
+
bgColor={isSelectedComment(commentItem.key) ? theme.colors.primary : theme.colors.backgroundGray200}
|
|
277
|
+
borderColor={isSelectedComment(commentItem.key) ? theme.colors.primary : theme.colors.backgroundGray200}
|
|
278
|
+
textStyle={{
|
|
279
|
+
color: isSelectedComment(commentItem.key) ? theme.colors.white : theme.colors.black,
|
|
280
|
+
fontSize: 13,
|
|
281
|
+
paddingRight: isSelectedComment(commentItem.key) ? 15 : 0
|
|
282
|
+
}}
|
|
283
|
+
style={{ height: 35, paddingLeft: 5, paddingRight: 5, marginHorizontal: 3, marginVertical: 10 }}
|
|
284
|
+
imgRightSrc={isSelectedComment(commentItem.key) ? theme.images.general.close : null}
|
|
285
|
+
imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
|
|
286
|
+
onClick={() => handleChangeComment(commentItem)}
|
|
287
|
+
/>
|
|
288
|
+
))}
|
|
289
|
+
</CommentsButtonGroup>
|
|
290
|
+
</>
|
|
291
|
+
)}
|
|
292
|
+
{/* <OText style={{ marginTop: 30 }} color={theme.colors.textNormal}>{t('REVIEW_COMMENT_QUESTION', 'Do you want to add something?')}</OText> */}
|
|
293
|
+
{false && (
|
|
294
|
+
<Controller
|
|
295
|
+
control={control}
|
|
296
|
+
defaultValue=''
|
|
297
|
+
name='comments'
|
|
298
|
+
render={({ onChange }: any) => (
|
|
299
|
+
<OInput
|
|
300
|
+
name='comments'
|
|
301
|
+
onChange={(val: any) => {
|
|
302
|
+
onChange(val)
|
|
303
|
+
setExtraComment(val.target.value)
|
|
304
|
+
}}
|
|
305
|
+
style={styles.inputTextArea}
|
|
306
|
+
multiline
|
|
307
|
+
/>
|
|
308
|
+
)}
|
|
309
|
+
/>
|
|
310
|
+
)}
|
|
291
311
|
</FormReviews>
|
|
292
312
|
</View>
|
|
293
313
|
)}
|
|
@@ -302,7 +322,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
|
302
322
|
</SkipButton>
|
|
303
323
|
<OButton
|
|
304
324
|
textStyle={{ color: theme.colors.white, paddingRight: 10 }}
|
|
305
|
-
text={t('
|
|
325
|
+
text={t('GOTO_REVIEW', 'Go to review')}
|
|
306
326
|
style={{ borderRadius: 8 }}
|
|
307
327
|
imgRightSrc={theme.images.general.arrow_right}
|
|
308
328
|
imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
|
|
@@ -42,3 +42,12 @@ export const RatingTextContainer = styled.View`
|
|
|
42
42
|
justify-content: space-between;
|
|
43
43
|
margin-top: 10px;
|
|
44
44
|
`
|
|
45
|
+
export const RatingStarContainer = styled.View`
|
|
46
|
+
flex-direction: row;
|
|
47
|
+
align-items: center;
|
|
48
|
+
justify-content: space-between;
|
|
49
|
+
margin-top: 10px;
|
|
50
|
+
`
|
|
51
|
+
export const PlacedDate = styled.View`
|
|
52
|
+
margin-top: 30px;
|
|
53
|
+
`
|
|
@@ -415,7 +415,7 @@ export interface ProductItemAccordionParams {
|
|
|
415
415
|
isFromCheckout?: any
|
|
416
416
|
}
|
|
417
417
|
export interface ReviewOrderParams {
|
|
418
|
-
order?: { id: number, businessId: number, logo: string, driver: any, products: Array<any>, review: any, user_review: any },
|
|
418
|
+
order?: { id: number, businessId: number, business_name?: string, delivery_datetime?: string, logo: string, driver: any, products: Array<any>, review: any, user_review: any },
|
|
419
419
|
stars?: any,
|
|
420
420
|
handleChangeInput?: any,
|
|
421
421
|
handleChangeRating?: any,
|