ordering-ui-react-native 0.16.47 → 0.16.48-release
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 +6 -5
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/ActiveOrders/index.tsx +61 -63
- package/src/components/ActiveOrders/styles.tsx +8 -14
- package/src/components/BusinessBasicInformation/index.tsx +11 -19
- package/src/components/BusinessInformation/index.tsx +33 -4
- package/src/components/BusinessInformation/styles.tsx +2 -2
- package/src/components/BusinessProductsList/index.tsx +10 -10
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +2 -1
- package/src/components/LanguageSelector/index.tsx +21 -16
- package/src/components/Messages/index.tsx +2 -2
- package/src/components/NotificationSetting/index.tsx +85 -0
- package/src/components/OrdersOption/index.tsx +54 -56
- package/src/components/PaymentOptions/index.tsx +298 -345
- package/src/components/PaymentOptionsWebView/index.tsx +120 -121
- package/src/components/ReviewDriver/index.tsx +1 -1
- package/src/components/ReviewOrder/index.tsx +2 -2
- package/src/components/ReviewProducts/index.tsx +11 -0
- package/src/components/SingleProductReview/index.tsx +8 -5
- package/src/components/StripeElementsForm/index.tsx +25 -16
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OBottomPopup.tsx +6 -2
- package/src/components/shared/OToast.tsx +4 -4
- package/src/index.tsx +2 -0
- package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
- package/src/utils/index.tsx +2 -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/BusinessController/index.tsx +2 -2
- package/themes/business/src/components/Chat/index.tsx +40 -32
- package/themes/business/src/components/DriverMap/index.tsx +7 -5
- package/themes/business/src/components/DriverSchedule/index.tsx +36 -19
- package/themes/business/src/components/LoginForm/index.tsx +111 -74
- package/themes/business/src/components/MapView/index.tsx +12 -1
- package/themes/business/src/components/MessagesOption/index.tsx +11 -1
- package/themes/business/src/components/NewOrderNotification/index.tsx +26 -41
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +33 -23
- package/themes/business/src/components/OrdersListManager/index.tsx +10 -3
- package/themes/business/src/components/OrdersOption/index.tsx +76 -77
- package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
- package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
- package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
- package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
- package/themes/business/src/components/PreviousOrders/index.tsx +331 -243
- package/themes/business/src/components/PreviousOrders/styles.tsx +30 -2
- package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
- package/themes/business/src/components/ReviewCustomer/index.tsx +39 -15
- package/themes/business/src/components/ScheduleBlocked/index.tsx +2 -2
- package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
- package/themes/business/src/components/UserProfileForm/index.tsx +2 -0
- package/themes/business/src/components/shared/ODropDown.tsx +42 -8
- package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
- package/themes/business/src/components/shared/OLink.tsx +24 -12
- package/themes/business/src/components/shared/OText.tsx +3 -2
- package/themes/business/src/types/index.tsx +25 -11
- package/themes/business/src/utils/index.tsx +10 -0
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/LoginForm/index.tsx +121 -10
- package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
- package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/types/index.d.ts +2 -0
- package/themes/original/index.tsx +6 -0
- package/themes/original/src/components/AddressDetails/index.tsx +10 -8
- package/themes/original/src/components/AddressForm/index.tsx +157 -140
- package/themes/original/src/components/AddressList/index.tsx +1 -1
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +218 -147
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +2 -2
- package/themes/original/src/components/BusinessController/index.tsx +231 -114
- package/themes/original/src/components/BusinessController/styles.tsx +14 -9
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
- package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
- package/themes/original/src/components/BusinessListingSearch/index.tsx +109 -139
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
- package/themes/original/src/components/BusinessProductsList/index.tsx +59 -60
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +175 -80
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +18 -11
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +35 -23
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +3 -2
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +275 -120
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +47 -10
- package/themes/original/src/components/BusinessesListing/index.tsx +80 -25
- package/themes/original/src/components/Cart/index.tsx +82 -15
- package/themes/original/src/components/Cart/styles.tsx +4 -0
- package/themes/original/src/components/CartContent/index.tsx +22 -16
- package/themes/original/src/components/Checkout/index.tsx +113 -117
- package/themes/original/src/components/Checkout/styles.tsx +4 -3
- package/themes/original/src/components/CitiesControl/index.tsx +89 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
- package/themes/original/src/components/DriverTips/index.tsx +4 -4
- package/themes/original/src/components/DriverTips/styles.tsx +2 -1
- package/themes/original/src/components/FavoriteList/index.tsx +69 -45
- package/themes/original/src/components/FloatingButton/index.tsx +13 -11
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/index.tsx +20 -19
- package/themes/original/src/components/GPSButton/styles.ts +3 -3
- package/themes/original/src/components/GoogleMap/index.tsx +20 -12
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +25 -10
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +4 -0
- package/themes/original/src/components/HelpGuide/index.tsx +9 -8
- package/themes/original/src/components/HelpOrder/index.tsx +9 -8
- package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
- package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
- package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
- package/themes/original/src/components/LoginForm/index.tsx +98 -41
- package/themes/original/src/components/LottieAnimation/index.tsx +69 -0
- package/themes/original/src/components/Messages/index.tsx +35 -20
- package/themes/original/src/components/MomentOption/index.tsx +8 -6
- package/themes/original/src/components/MultiCart/index.tsx +63 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
- package/themes/original/src/components/MultiCheckout/index.tsx +10 -2
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +34 -16
- package/themes/original/src/components/MyOrders/index.tsx +88 -22
- package/themes/original/src/components/NavBar/index.tsx +11 -5
- package/themes/original/src/components/NetworkError/index.tsx +5 -3
- package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
- package/themes/original/src/components/Notifications/index.tsx +148 -0
- package/themes/original/src/components/Notifications/styles.tsx +17 -0
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +167 -0
- package/themes/original/src/components/OrderDetails/index.tsx +200 -39
- package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
- package/themes/original/src/components/OrderItAgain/index.tsx +75 -0
- package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
- package/themes/original/src/components/OrderProgress/index.tsx +77 -66
- package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
- package/themes/original/src/components/OrderSummary/index.tsx +2 -35
- package/themes/original/src/components/OrderTypeSelector/index.tsx +85 -36
- package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +94 -98
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
- package/themes/original/src/components/OrdersOption/index.tsx +102 -56
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +1 -2
- package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
- package/themes/original/src/components/PlaceSpot/index.tsx +249 -47
- package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
- package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
- package/themes/original/src/components/ProductForm/index.tsx +639 -664
- package/themes/original/src/components/ProductForm/styles.tsx +10 -11
- package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
- package/themes/original/src/components/ProductOption/index.tsx +1 -1
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +0 -1
- package/themes/original/src/components/ProfessionalFilter/index.tsx +2 -1
- package/themes/original/src/components/ProfessionalProfile/index.tsx +19 -8
- package/themes/original/src/components/Promotions/index.tsx +232 -219
- package/themes/original/src/components/Promotions/styles.tsx +7 -2
- package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
- package/themes/original/src/components/ReviewOrder/index.tsx +120 -108
- package/themes/original/src/components/ReviewOrder/styles.tsx +5 -7
- package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
- package/themes/original/src/components/ReviewTrigger/index.tsx +136 -0
- package/themes/original/src/components/ReviewTrigger/styles.tsx +41 -0
- package/themes/original/src/components/ServiceForm/index.tsx +332 -264
- package/themes/original/src/components/SignupForm/index.tsx +160 -113
- package/themes/original/src/components/SingleOrderCard/index.tsx +266 -183
- package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
- package/themes/original/src/components/SingleProductCard/index.tsx +198 -112
- package/themes/original/src/components/SingleProductCard/styles.tsx +3 -10
- package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
- package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
- package/themes/original/src/components/StripeElementsForm/index.tsx +13 -2
- package/themes/original/src/components/UpsellingProducts/index.tsx +15 -5
- package/themes/original/src/components/UserDetails/index.tsx +5 -3
- package/themes/original/src/components/UserFormDetails/index.tsx +6 -48
- package/themes/original/src/components/UserProfile/index.tsx +56 -31
- package/themes/original/src/components/UserProfile/styles.ts +17 -0
- package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
- package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
- package/themes/original/src/components/Wallets/index.tsx +176 -164
- package/themes/original/src/components/Wallets/styles.tsx +12 -8
- package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
- package/themes/original/src/components/shared/OBottomPopup.tsx +48 -15
- package/themes/original/src/components/shared/OButton.tsx +10 -3
- package/themes/original/src/components/shared/OIcon.tsx +8 -1
- package/themes/original/src/components/shared/OInput.tsx +10 -1
- package/themes/original/src/layouts/Container.tsx +13 -9
- package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
- package/themes/original/src/types/index.tsx +83 -28
- package/themes/original/src/utils/index.tsx +103 -58
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
|
-
import
|
|
3
|
-
import { OrderReview as ReviewOrderController, useLanguage, useToast, ToastType, useUtils } from 'ordering-components/native'
|
|
2
|
+
import { OrderReview as ReviewOrderController, useLanguage, useToast, ToastType } from 'ordering-components/native'
|
|
4
3
|
import { useForm, Controller } from 'react-hook-form'
|
|
5
4
|
import LinearGradient from 'react-native-linear-gradient'
|
|
6
5
|
|
|
@@ -13,8 +12,7 @@ import {
|
|
|
13
12
|
SkipButton,
|
|
14
13
|
RatingBarContainer,
|
|
15
14
|
RatingTextContainer,
|
|
16
|
-
|
|
17
|
-
PlacedDate
|
|
15
|
+
MultiLogosContainer
|
|
18
16
|
} from './styles'
|
|
19
17
|
import { OButton, OIcon, OInput, OText } from '../shared'
|
|
20
18
|
import { TouchableOpacity, StyleSheet, View, I18nManager } from 'react-native';
|
|
@@ -91,11 +89,11 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
|
91
89
|
const [, t] = useLanguage()
|
|
92
90
|
const [, { showToast }] = useToast()
|
|
93
91
|
const { handleSubmit, control, errors } = useForm()
|
|
94
|
-
|
|
92
|
+
|
|
95
93
|
const [alertState, setAlertState] = useState<{ open: boolean, content: Array<any>, success?: boolean }>({ open: false, content: [], success: false })
|
|
96
94
|
const [comments, setComments] = useState<Array<any>>([])
|
|
97
95
|
const [extraComment, setExtraComment] = useState('')
|
|
98
|
-
const
|
|
96
|
+
const [enableProduct, setEnableProduct] = useState(true)
|
|
99
97
|
|
|
100
98
|
const onSubmit = () => {
|
|
101
99
|
if (Object.values(stars).some((value: any) => value === 0)) {
|
|
@@ -109,6 +107,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
|
109
107
|
handleReviewState && handleReviewState(order?.id)
|
|
110
108
|
setIsReviewed && setIsReviewed(true)
|
|
111
109
|
setAlertState({ ...alertState, success: true })
|
|
110
|
+
!enableProduct && navigation?.canGoBack() && navigation.goBack()
|
|
112
111
|
}
|
|
113
112
|
|
|
114
113
|
const qualificationList = [
|
|
@@ -145,7 +144,16 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
|
145
144
|
if (!order?.review) {
|
|
146
145
|
onSubmit()
|
|
147
146
|
} else {
|
|
148
|
-
|
|
147
|
+
skipOrderReview()
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const skipOrderReview = () => {
|
|
152
|
+
if (enableProduct) onNavigationRedirect('ReviewProducts', { order: order })
|
|
153
|
+
else if (order?.driver && !order?.user_review) {
|
|
154
|
+
onNavigationRedirect('ReviewDriver', { order: order })
|
|
155
|
+
} else {
|
|
156
|
+
navigation?.canGoBack() && navigation.goBack()
|
|
149
157
|
}
|
|
150
158
|
}
|
|
151
159
|
|
|
@@ -191,30 +199,48 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
|
191
199
|
setStars({ ...stars, comments: _comment })
|
|
192
200
|
}, [comments, extraComment])
|
|
193
201
|
|
|
202
|
+
useEffect(() => {
|
|
203
|
+
setEnableProduct(!order?.products.every(product => product?.deleted))
|
|
204
|
+
}, [order])
|
|
205
|
+
|
|
194
206
|
return (
|
|
195
207
|
<>
|
|
196
208
|
<ReviewOrderContainer>
|
|
197
209
|
<NavBar
|
|
198
|
-
title={t('
|
|
210
|
+
title={t('REVIEW_ORDER', 'Review your Order')}
|
|
199
211
|
titleAlign={'center'}
|
|
200
|
-
leftImg={theme.images.general.close}
|
|
201
212
|
onActionLeft={() => navigation?.canGoBack() && navigation.goBack()}
|
|
202
213
|
showCall={false}
|
|
203
214
|
btnStyle={{ paddingLeft: 0 }}
|
|
204
|
-
style={{ flexDirection: 'column', alignItems: 'flex-start'
|
|
205
|
-
titleWrapStyle={{ paddingHorizontal: 0
|
|
206
|
-
titleStyle={{
|
|
215
|
+
style={{ flexDirection: 'column', alignItems: 'flex-start' }}
|
|
216
|
+
titleWrapStyle={{ paddingHorizontal: 0 }}
|
|
217
|
+
titleStyle={{ marginRight: 0, marginLeft: 0 }}
|
|
207
218
|
/>
|
|
208
|
-
<BusinessLogo>
|
|
209
|
-
|
|
210
|
-
<
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
219
|
+
<BusinessLogo isMulti={order?.business?.length > 1}>
|
|
220
|
+
{typeof order?.logo === 'string' || !order?.logo ? (
|
|
221
|
+
<View style={styles.logoWrapper}>
|
|
222
|
+
<OIcon
|
|
223
|
+
url={order?.logo}
|
|
224
|
+
width={80}
|
|
225
|
+
height={80}
|
|
226
|
+
/>
|
|
227
|
+
</View>
|
|
228
|
+
) : (
|
|
229
|
+
<MultiLogosContainer>
|
|
230
|
+
{order?.logo?.map((logo : string, i : number) => (
|
|
231
|
+
<React.Fragment key={logo}>
|
|
232
|
+
<View style={styles.logoWrapper}>
|
|
233
|
+
<OIcon
|
|
234
|
+
url={logo}
|
|
235
|
+
width={80}
|
|
236
|
+
height={80}
|
|
237
|
+
/>
|
|
238
|
+
</View>
|
|
239
|
+
</React.Fragment>
|
|
240
|
+
))}
|
|
241
|
+
</MultiLogosContainer>
|
|
242
|
+
)}
|
|
216
243
|
</BusinessLogo>
|
|
217
|
-
{!!order?.business_name && <OText style={{ textAlign: 'center', marginTop: 15 }} color={theme.colors.textNormal}>{order?.business_name}</OText>}
|
|
218
244
|
{order?.review ? (
|
|
219
245
|
<View style={styles.reviewedStyle}>
|
|
220
246
|
<OText color={theme.colors.primary}>{t('ORDER_REVIEWED', 'This order has been already reviewed')}</OText>
|
|
@@ -222,92 +248,78 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
|
222
248
|
) : (
|
|
223
249
|
<View style={{ flex: 1, justifyContent: 'flex-end' }}>
|
|
224
250
|
<FormReviews>
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
<
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
251
|
+
<OText mBottom={13} color={theme.colors.textNormal}>{t('HOW_WAS_YOUR_ORDER', 'How was your order?')}</OText>
|
|
252
|
+
<RatingBarContainer>
|
|
253
|
+
<LinearGradient
|
|
254
|
+
start={{ x: 0.0, y: 0.0 }}
|
|
255
|
+
end={{ x: qualificationList[stars.quality - 1]?.percent || 0, y: 0 }}
|
|
256
|
+
locations={[.9999, .9999]}
|
|
257
|
+
colors={[theme.colors.primary, theme.colors.backgroundGray200]}
|
|
258
|
+
style={styles.statusBar}
|
|
259
|
+
/>
|
|
260
|
+
<RatingTextContainer>
|
|
261
|
+
{qualificationList.map((qualification: any) => (
|
|
262
|
+
<View
|
|
263
|
+
key={qualification.key}
|
|
264
|
+
style={{ ...qualification.parentStyle, ...styles.ratingItemContainer }}
|
|
265
|
+
>
|
|
266
|
+
<TouchableOpacity
|
|
267
|
+
style={qualification.isInnerStyle && styles.ratingItem}
|
|
268
|
+
onPress={() => handleChangeStars(qualification.key)}
|
|
240
269
|
>
|
|
241
|
-
<
|
|
242
|
-
style={
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
270
|
+
<View
|
|
271
|
+
style={{
|
|
272
|
+
...styles.ratingLineStyle,
|
|
273
|
+
backgroundColor: (qualification.pointerColor && !(stars.quality >= qualification.key)) ? theme.colors.dusk : 'transparent'
|
|
274
|
+
}}
|
|
275
|
+
/>
|
|
276
|
+
<OText size={12} color={stars.quality === qualification.key ? theme.colors.black : theme.colors.backgroundGray200}>{qualification.text}</OText>
|
|
277
|
+
</TouchableOpacity>
|
|
278
|
+
</View>
|
|
279
|
+
))}
|
|
280
|
+
</RatingTextContainer>
|
|
281
|
+
</RatingBarContainer>
|
|
282
|
+
|
|
283
|
+
<OText style={{ marginTop: 30 }} color={theme.colors.textNormal}>
|
|
284
|
+
{commentsList[stars?.quality || 1]?.title}
|
|
285
|
+
</OText>
|
|
286
|
+
<CommentsButtonGroup>
|
|
287
|
+
{commentsList[stars?.quality || 1]?.list?.map(commentItem => (
|
|
288
|
+
<OButton
|
|
289
|
+
key={commentItem.key}
|
|
290
|
+
text={commentItem.content}
|
|
291
|
+
bgColor={isSelectedComment(commentItem.key) ? theme.colors.primary : theme.colors.backgroundGray200}
|
|
292
|
+
borderColor={isSelectedComment(commentItem.key) ? theme.colors.primary : theme.colors.backgroundGray200}
|
|
293
|
+
textStyle={{
|
|
294
|
+
color: isSelectedComment(commentItem.key) ? theme.colors.white : theme.colors.black,
|
|
295
|
+
fontSize: 13,
|
|
296
|
+
paddingRight: isSelectedComment(commentItem.key) ? 15 : 0
|
|
297
|
+
}}
|
|
298
|
+
style={{ height: 35, paddingLeft: 5, paddingRight: 5, marginHorizontal: 3, marginVertical: 10 }}
|
|
299
|
+
imgRightSrc={isSelectedComment(commentItem.key) ? theme.images.general.close : null}
|
|
300
|
+
imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
|
|
301
|
+
onClick={() => handleChangeComment(commentItem)}
|
|
302
|
+
/>
|
|
303
|
+
))}
|
|
304
|
+
</CommentsButtonGroup>
|
|
305
|
+
|
|
306
|
+
<OText style={{ marginTop: 30 }} color={theme.colors.textNormal}>{t('REVIEW_COMMENT_QUESTION', 'Do you want to add something?')}</OText>
|
|
307
|
+
<Controller
|
|
308
|
+
control={control}
|
|
309
|
+
defaultValue=''
|
|
310
|
+
name='comments'
|
|
311
|
+
render={({ onChange }: any) => (
|
|
312
|
+
<OInput
|
|
313
|
+
name='comments'
|
|
314
|
+
onChange={(val: any) => {
|
|
315
|
+
onChange(val)
|
|
316
|
+
setExtraComment(val.target.value)
|
|
317
|
+
}}
|
|
318
|
+
style={styles.inputTextArea}
|
|
319
|
+
multiline
|
|
320
|
+
/>
|
|
260
321
|
)}
|
|
261
|
-
|
|
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
|
-
)}
|
|
322
|
+
/>
|
|
311
323
|
</FormReviews>
|
|
312
324
|
</View>
|
|
313
325
|
)}
|
|
@@ -316,13 +328,13 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
|
316
328
|
<FloatingBottomContainer>
|
|
317
329
|
<ActionContainer>
|
|
318
330
|
<SkipButton
|
|
319
|
-
onPress={() =>
|
|
331
|
+
onPress={() => skipOrderReview()}
|
|
320
332
|
>
|
|
321
333
|
<OText weight={700} size={18} color={theme.colors.textNormal}>{t('FRONT_VISUALS_SKIP', 'Skip')}</OText>
|
|
322
334
|
</SkipButton>
|
|
323
335
|
<OButton
|
|
324
336
|
textStyle={{ color: theme.colors.white, paddingRight: 10 }}
|
|
325
|
-
text={t('
|
|
337
|
+
text={t('CONTINUE', 'Continue')}
|
|
326
338
|
style={{ borderRadius: 8 }}
|
|
327
339
|
imgRightSrc={theme.images.general.arrow_right}
|
|
328
340
|
imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
|
|
@@ -338,7 +350,7 @@ export const ReviewOrder = (props: ReviewOrderParams) => {
|
|
|
338
350
|
const reviewOrderProps = {
|
|
339
351
|
...props,
|
|
340
352
|
UIComponent: ReviewOrderUI,
|
|
341
|
-
defaultStar: 5
|
|
353
|
+
defaultStar: props?.defaultStar || 5
|
|
342
354
|
}
|
|
343
355
|
return <ReviewOrderController {...reviewOrderProps} />
|
|
344
356
|
}
|
|
@@ -42,12 +42,10 @@ export const RatingTextContainer = styled.View`
|
|
|
42
42
|
justify-content: space-between;
|
|
43
43
|
margin-top: 10px;
|
|
44
44
|
`
|
|
45
|
-
|
|
45
|
+
|
|
46
|
+
export const MultiLogosContainer = styled.View`
|
|
47
|
+
display: flex;
|
|
48
|
+
justify-content: space-around;
|
|
46
49
|
flex-direction: row;
|
|
47
|
-
|
|
48
|
-
justify-content: space-between;
|
|
49
|
-
margin-top: 10px;
|
|
50
|
-
`
|
|
51
|
-
export const PlacedDate = styled.View`
|
|
52
|
-
margin-top: 30px;
|
|
50
|
+
width: 100%;
|
|
53
51
|
`
|
|
@@ -56,7 +56,7 @@ const ReviewProductsUI = (props: ReviewProductParams) => {
|
|
|
56
56
|
if (order?.driver && !order?.user_review) {
|
|
57
57
|
onNavigationRedirect('ReviewDriver', { order: order })
|
|
58
58
|
} else {
|
|
59
|
-
onNavigationRedirect('MyOrders')
|
|
59
|
+
onNavigationRedirect('BottomTab', { screen: 'MyOrders' })
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
}, [formState])
|
|
@@ -67,14 +67,14 @@ const ReviewProductsUI = (props: ReviewProductParams) => {
|
|
|
67
67
|
<NavBar
|
|
68
68
|
title={t('REVIEW_PRODUCT', 'Review product')}
|
|
69
69
|
titleAlign={'center'}
|
|
70
|
-
onActionLeft={() => onNavigationRedirect('MyOrders')}
|
|
70
|
+
onActionLeft={() => onNavigationRedirect('BottomTab', { screen: 'MyOrders' })}
|
|
71
71
|
showCall={false}
|
|
72
72
|
btnStyle={{ paddingLeft: 0 }}
|
|
73
73
|
style={{ flexDirection: 'column', alignItems: 'flex-start' }}
|
|
74
74
|
titleWrapStyle={{ paddingHorizontal: 0 }}
|
|
75
75
|
titleStyle={{ marginRight: 0, marginLeft: 0 }}
|
|
76
76
|
/>
|
|
77
|
-
{order?.products?.map((product: any) => (
|
|
77
|
+
{order?.products?.map((product: any) => !product?.deleted && (
|
|
78
78
|
<SingleProductReview
|
|
79
79
|
key={product.id}
|
|
80
80
|
product={product}
|
|
@@ -87,7 +87,10 @@ const ReviewProductsUI = (props: ReviewProductParams) => {
|
|
|
87
87
|
<FloatingBottomContainer>
|
|
88
88
|
<ActionContainer>
|
|
89
89
|
<SkipButton
|
|
90
|
-
onPress={() => (order?.driver && !order?.user_review) ?
|
|
90
|
+
onPress={() => (order?.driver && !order?.user_review) ?
|
|
91
|
+
onNavigationRedirect('ReviewDriver', { order: order }) :
|
|
92
|
+
onNavigationRedirect('BottomTab', { screen: 'MyOrders' })
|
|
93
|
+
}
|
|
91
94
|
>
|
|
92
95
|
<OText weight={700} size={18} color={theme.colors.textNormal}>{t('FRONT_VISUALS_SKIP', 'Skip')}</OText>
|
|
93
96
|
</SkipButton>
|
|
@@ -95,7 +98,7 @@ const ReviewProductsUI = (props: ReviewProductParams) => {
|
|
|
95
98
|
textStyle={{ color: theme.colors.white, paddingRight: 10 }}
|
|
96
99
|
text={order?.driver && !order?.user_review ? t('CONTINUE', 'Continue') : t('SEND_REVIEW', 'Send Review')}
|
|
97
100
|
style={{ borderRadius: 8 }}
|
|
98
|
-
|
|
101
|
+
imgRightSrc={theme.images.general.arrow_right}
|
|
99
102
|
imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
|
|
100
103
|
isDisabled={formState.loading || formState?.changes?.length === 0}
|
|
101
104
|
onClick={() => handleContinueClick()}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import FontAwesome from 'react-native-vector-icons/FontAwesome';
|
|
3
|
+
import { useLanguage, useUtils } from 'ordering-components/native'
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
ReviewOrderContainer,
|
|
7
|
+
BusinessLogo,
|
|
8
|
+
FormReviews,
|
|
9
|
+
ActionContainer,
|
|
10
|
+
RatingStarContainer,
|
|
11
|
+
PlacedDate,
|
|
12
|
+
MultiLogosContainer
|
|
13
|
+
} from './styles'
|
|
14
|
+
import { OButton, OIcon, OText } from '../shared'
|
|
15
|
+
import { StyleSheet, View, I18nManager } from 'react-native';
|
|
16
|
+
import { FloatingBottomContainer } from '../../layouts/FloatingBottomContainer'
|
|
17
|
+
|
|
18
|
+
import { useTheme } from 'styled-components/native'
|
|
19
|
+
|
|
20
|
+
export const ReviewTrigger = (props: any) => {
|
|
21
|
+
const {
|
|
22
|
+
order,
|
|
23
|
+
handleOpenOrderReview
|
|
24
|
+
} = props
|
|
25
|
+
|
|
26
|
+
const theme = useTheme()
|
|
27
|
+
|
|
28
|
+
const styles = StyleSheet.create({
|
|
29
|
+
logoWrapper: {
|
|
30
|
+
shadowColor: theme.colors.black,
|
|
31
|
+
shadowRadius: 3,
|
|
32
|
+
shadowOffset: { width: 1, height: 4 },
|
|
33
|
+
elevation: 3,
|
|
34
|
+
borderRadius: 8,
|
|
35
|
+
shadowOpacity: 0.1,
|
|
36
|
+
overflow: 'hidden'
|
|
37
|
+
},
|
|
38
|
+
inputTextArea: {
|
|
39
|
+
borderColor: theme.colors.lightGray,
|
|
40
|
+
borderRadius: 8,
|
|
41
|
+
marginTop: 10,
|
|
42
|
+
marginBottom: 40,
|
|
43
|
+
height: 100,
|
|
44
|
+
alignItems: 'flex-start'
|
|
45
|
+
},
|
|
46
|
+
statusBar: {
|
|
47
|
+
transform: [{ scaleX: I18nManager.isRTL ? -1 : 1 }],
|
|
48
|
+
height: 10,
|
|
49
|
+
borderRadius: 5,
|
|
50
|
+
marginTop: 5
|
|
51
|
+
},
|
|
52
|
+
ratingItemContainer: {
|
|
53
|
+
position: 'absolute',
|
|
54
|
+
top: -20
|
|
55
|
+
},
|
|
56
|
+
ratingItem: {
|
|
57
|
+
left: '-50%',
|
|
58
|
+
flexDirection: 'column',
|
|
59
|
+
alignItems: 'center'
|
|
60
|
+
},
|
|
61
|
+
ratingLineStyle: {
|
|
62
|
+
height: 10,
|
|
63
|
+
width: 1,
|
|
64
|
+
marginBottom: 10,
|
|
65
|
+
backgroundColor: theme.colors.dusk
|
|
66
|
+
},
|
|
67
|
+
reviewedStyle: {
|
|
68
|
+
flexDirection: 'row',
|
|
69
|
+
justifyContent: 'center',
|
|
70
|
+
marginVertical: 20
|
|
71
|
+
},
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
const [, t] = useLanguage()
|
|
75
|
+
const [{ parseDate }] = useUtils()
|
|
76
|
+
const placedOnDate = parseDate(order?.delivery_datetime, { utc: true, outputFormat: 'dddd MMMM DD, YYYY' })
|
|
77
|
+
const [star, setStar] = useState(5)
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<>
|
|
81
|
+
<ReviewOrderContainer>
|
|
82
|
+
<BusinessLogo>
|
|
83
|
+
{typeof order?.logo === 'string' || !order?.logo ? (
|
|
84
|
+
<View style={styles.logoWrapper}>
|
|
85
|
+
<OIcon
|
|
86
|
+
url={order?.logo}
|
|
87
|
+
width={80}
|
|
88
|
+
height={80}
|
|
89
|
+
/>
|
|
90
|
+
</View>
|
|
91
|
+
) : (
|
|
92
|
+
<MultiLogosContainer>
|
|
93
|
+
{order?.logo?.map((logo : string, i : number) => (
|
|
94
|
+
<React.Fragment key={logo}>
|
|
95
|
+
<View style={styles.logoWrapper}>
|
|
96
|
+
<OIcon
|
|
97
|
+
url={logo}
|
|
98
|
+
width={80}
|
|
99
|
+
height={80}
|
|
100
|
+
/>
|
|
101
|
+
</View>
|
|
102
|
+
</React.Fragment>
|
|
103
|
+
))}
|
|
104
|
+
</MultiLogosContainer>
|
|
105
|
+
|
|
106
|
+
)}
|
|
107
|
+
</BusinessLogo>
|
|
108
|
+
{!!order?.business_name && <OText style={{ textAlign: 'center', marginTop: 15 }} color={theme.colors.textNormal}>{order?.business_name}</OText>}
|
|
109
|
+
<View style={{ flex: 1, justifyContent: 'flex-end' }}>
|
|
110
|
+
<FormReviews>
|
|
111
|
+
<RatingStarContainer>
|
|
112
|
+
{[...Array(5).keys()].map((index: number) => (<FontAwesome name={(index <= (star - 1)) ? 'star' : 'star-o'} size={28} key={`star-symbol-${index}`} onPress={() => setStar(index + 1)} color={theme?.colors?.primary} />)
|
|
113
|
+
)}
|
|
114
|
+
</RatingStarContainer>
|
|
115
|
+
<PlacedDate>
|
|
116
|
+
<OText color={theme.colors.textNormal}>{t('DONOT_FORGET_RATE_YOUR_ORDER', 'Do not forget to rate your order placed on ')}</OText>
|
|
117
|
+
<OText color={theme.colors.textNormal} style={{ fontWeight: "bold" }}>{placedOnDate}</OText>
|
|
118
|
+
</PlacedDate>
|
|
119
|
+
</FormReviews>
|
|
120
|
+
</View>
|
|
121
|
+
</ReviewOrderContainer>
|
|
122
|
+
<FloatingBottomContainer borderTopWidth={0} borderRadius={10}>
|
|
123
|
+
<ActionContainer>
|
|
124
|
+
<OButton
|
|
125
|
+
textStyle={{ color: theme.colors.white, paddingRight: 10 }}
|
|
126
|
+
text={t('GOTO_REVIEW', 'Go to review')}
|
|
127
|
+
style={{ borderRadius: 8 }}
|
|
128
|
+
imgRightSrc={theme.images.general.arrow_right}
|
|
129
|
+
imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
|
|
130
|
+
onClick={() => handleOpenOrderReview(star)}
|
|
131
|
+
/>
|
|
132
|
+
</ActionContainer>
|
|
133
|
+
</FloatingBottomContainer>
|
|
134
|
+
</>
|
|
135
|
+
)
|
|
136
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import styled from 'styled-components/native'
|
|
2
|
+
|
|
3
|
+
export const ReviewOrderContainer = styled.ScrollView`
|
|
4
|
+
padding: 0 25px;
|
|
5
|
+
margin-bottom: 100px;
|
|
6
|
+
`
|
|
7
|
+
|
|
8
|
+
export const BusinessLogo = styled.View`
|
|
9
|
+
margin-vertical: 5px;
|
|
10
|
+
align-items: center;
|
|
11
|
+
`
|
|
12
|
+
|
|
13
|
+
export const FormReviews = styled.View`
|
|
14
|
+
flex: 1;
|
|
15
|
+
height: 100%;
|
|
16
|
+
margin-top: 10px;
|
|
17
|
+
`
|
|
18
|
+
|
|
19
|
+
export const ActionContainer = styled.View`
|
|
20
|
+
flex-direction: row;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
padding: 3px 30px;
|
|
24
|
+
`
|
|
25
|
+
|
|
26
|
+
export const RatingStarContainer = styled.View`
|
|
27
|
+
flex-direction: row;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: space-between;
|
|
30
|
+
margin-top: 10px;
|
|
31
|
+
`
|
|
32
|
+
export const PlacedDate = styled.View`
|
|
33
|
+
margin-top: 30px;
|
|
34
|
+
`
|
|
35
|
+
|
|
36
|
+
export const MultiLogosContainer = styled.View`
|
|
37
|
+
display: flex;
|
|
38
|
+
justify-content: space-around;
|
|
39
|
+
flex-direction: row;
|
|
40
|
+
width: 100%;
|
|
41
|
+
`
|