ordering-ui-react-native 0.16.95 → 0.16.96-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 +5 -5
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/ActiveOrders/styles.tsx +8 -14
- package/src/components/BusinessInformation/index.tsx +11 -4
- package/src/components/BusinessInformation/styles.tsx +2 -2
- package/src/components/BusinessProductsList/index.tsx +1 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/OrderCreating/index.tsx +1 -21
- package/src/components/OrdersOption/index.tsx +54 -56
- package/src/components/PaymentOptionsWebView/index.tsx +119 -120
- package/src/components/SingleProductReview/index.tsx +7 -4
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +4 -4
- package/src/utils/index.tsx +7 -1
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
- package/themes/business/src/components/BusinessController/index.tsx +2 -3
- package/themes/business/src/components/Chat/index.tsx +146 -135
- package/themes/business/src/components/DriverMap/index.tsx +22 -9
- package/themes/business/src/components/GoogleMap/index.tsx +58 -57
- package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
- package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/business/src/components/LoginForm/index.tsx +239 -80
- package/themes/business/src/components/LoginForm/styles.tsx +10 -0
- package/themes/business/src/components/MapView/index.tsx +18 -7
- package/themes/business/src/components/NewOrderNotification/index.tsx +33 -43
- package/themes/business/src/components/OrderDetails/Delivery.tsx +4 -3
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +96 -50
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +59 -62
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
- package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
- package/themes/business/src/components/OrderMessage/index.tsx +18 -17
- package/themes/business/src/components/OrdersOption/index.tsx +33 -75
- package/themes/business/src/components/OrdersOptionBusiness/index.tsx +1 -1
- package/themes/business/src/components/PreviousMessages/index.tsx +16 -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 +447 -247
- package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
- package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
- package/themes/business/src/components/ReviewCustomer/index.tsx +42 -25
- package/themes/business/src/components/StoresList/index.tsx +2 -2
- package/themes/business/src/components/shared/OLink.tsx +33 -13
- package/themes/business/src/components/shared/OModal.tsx +16 -9
- package/themes/business/src/components/shared/OText.tsx +8 -2
- package/themes/business/src/types/index.tsx +33 -2
- package/themes/business/src/utils/index.tsx +53 -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/Otp/index.tsx +92 -0
- package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/kiosk/src/components/LoginForm/index.tsx +473 -151
- package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
- 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/PhoneInputNumber/index.tsx +3 -2
- package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
- package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
- package/themes/kiosk/src/layouts/Container.tsx +7 -1
- package/themes/kiosk/src/types/index.d.ts +13 -0
- package/themes/kiosk/src/utils/index.tsx +15 -0
- package/themes/original/index.tsx +8 -0
- package/themes/original/src/components/AddressDetails/index.tsx +29 -11
- package/themes/original/src/components/AddressForm/index.tsx +152 -117
- package/themes/original/src/components/AddressList/index.tsx +26 -21
- package/themes/original/src/components/AddressList/styles.tsx +4 -2
- package/themes/original/src/components/AnalyticsSegment/index.tsx +164 -8
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +125 -82
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +9 -4
- package/themes/original/src/components/BusinessController/index.tsx +145 -68
- package/themes/original/src/components/BusinessController/styles.tsx +22 -9
- package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
- package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
- package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +24 -23
- package/themes/original/src/components/BusinessListingSearch/index.tsx +52 -24
- package/themes/original/src/components/BusinessPreorder/index.tsx +96 -15
- package/themes/original/src/components/BusinessProductsList/index.tsx +20 -11
- package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +617 -490
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +7 -13
- package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -3
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +98 -78
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
- package/themes/original/src/components/BusinessesListing/index.tsx +6 -6
- package/themes/original/src/components/Cart/index.tsx +87 -43
- package/themes/original/src/components/CartContent/index.tsx +77 -15
- package/themes/original/src/components/CartContent/styles.tsx +11 -1
- package/themes/original/src/components/Checkout/index.tsx +294 -175
- package/themes/original/src/components/Checkout/styles.tsx +4 -2
- 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/CouponControl/index.tsx +10 -3
- package/themes/original/src/components/DriverTips/index.tsx +52 -37
- package/themes/original/src/components/DriverTips/styles.tsx +2 -1
- 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/FavoriteList/index.tsx +70 -80
- package/themes/original/src/components/FloatingButton/index.tsx +1 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/styles.ts +3 -3
- package/themes/original/src/components/GoogleMap/index.tsx +10 -1
- package/themes/original/src/components/Help/index.tsx +8 -8
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +11 -22
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
- package/themes/original/src/components/HelpGuide/index.tsx +12 -16
- package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
- package/themes/original/src/components/HelpOrder/index.tsx +12 -25
- package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
- package/themes/original/src/components/Home/index.tsx +13 -4
- package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
- package/themes/original/src/components/LastOrder/index.tsx +1 -34
- 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 +43 -19
- package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
- package/themes/original/src/components/MessageListing/index.tsx +16 -42
- package/themes/original/src/components/Messages/index.tsx +32 -10
- package/themes/original/src/components/MomentOption/index.tsx +195 -88
- package/themes/original/src/components/MultiCart/index.tsx +50 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +117 -96
- package/themes/original/src/components/MultiCheckout/index.tsx +247 -83
- package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +67 -20
- package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
- package/themes/original/src/components/MyOrders/index.tsx +66 -17
- package/themes/original/src/components/NavBar/index.tsx +6 -11
- package/themes/original/src/components/NotFoundSource/index.tsx +1 -1
- package/themes/original/src/components/Notifications/index.tsx +144 -0
- package/themes/original/src/components/Notifications/styles.tsx +20 -0
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +59 -0
- package/themes/original/src/components/OrderDetails/index.tsx +110 -221
- package/themes/original/src/components/OrderDetails/styles.tsx +10 -1
- package/themes/original/src/components/OrderItAgain/index.tsx +47 -43
- package/themes/original/src/components/OrderProgress/index.tsx +74 -112
- package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
- package/themes/original/src/components/OrderSummary/index.tsx +66 -29
- package/themes/original/src/components/OrderTypeSelector/index.tsx +4 -3
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +28 -19
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
- package/themes/original/src/components/OrdersOption/index.tsx +76 -83
- package/themes/original/src/components/PageBanner/index.tsx +171 -0
- package/themes/original/src/components/PageBanner/styles.tsx +11 -0
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +2 -2
- package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
- package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
- package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
- package/themes/original/src/components/ProductForm/index.tsx +240 -261
- package/themes/original/src/components/ProductForm/styles.tsx +4 -7
- package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -10
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
- package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
- package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -49
- package/themes/original/src/components/ProfessionalProfile/index.tsx +54 -14
- package/themes/original/src/components/Promotions/index.tsx +234 -220
- package/themes/original/src/components/Promotions/styles.tsx +10 -3
- package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
- package/themes/original/src/components/ReviewOrder/index.tsx +43 -11
- package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
- package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
- package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
- package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
- package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
- package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
- package/themes/original/src/components/ServiceForm/index.tsx +377 -270
- package/themes/original/src/components/Sessions/index.tsx +11 -8
- package/themes/original/src/components/Sessions/styles.tsx +5 -0
- package/themes/original/src/components/SignupForm/index.tsx +79 -66
- package/themes/original/src/components/SingleOrderCard/index.tsx +126 -57
- package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
- package/themes/original/src/components/SingleProductCard/index.tsx +111 -49
- package/themes/original/src/components/SingleProductCard/styles.tsx +27 -13
- 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/StripeCardsList/index.tsx +1 -1
- package/themes/original/src/components/StripeElementsForm/index.tsx +4 -1
- package/themes/original/src/components/UpsellingProducts/index.tsx +238 -218
- package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
- package/themes/original/src/components/UserDetails/index.tsx +8 -4
- package/themes/original/src/components/UserFormDetails/index.tsx +53 -54
- package/themes/original/src/components/UserProfile/index.tsx +58 -35
- package/themes/original/src/components/UserProfile/styles.ts +17 -0
- package/themes/original/src/components/UserProfileForm/index.tsx +21 -28
- package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
- package/themes/original/src/components/Wallets/index.tsx +20 -19
- package/themes/original/src/components/Wallets/styles.tsx +2 -0
- 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 +1 -1
- package/themes/original/src/components/shared/OButton.tsx +6 -2
- package/themes/original/src/components/shared/OIcon.tsx +8 -1
- package/themes/original/src/components/shared/OInput.tsx +10 -1
- package/themes/original/src/components/shared/OModal.tsx +3 -3
- package/themes/original/src/layouts/Container.tsx +13 -9
- package/themes/original/src/types/index.tsx +45 -7
- package/themes/original/src/utils/index.tsx +359 -58
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import React, { useEffect } from 'react'
|
|
2
|
+
import {
|
|
3
|
+
UserFormDetails as NotificationsController,
|
|
4
|
+
useLanguage,
|
|
5
|
+
useSession,
|
|
6
|
+
useOrderingTheme,
|
|
7
|
+
useToast,
|
|
8
|
+
ToastType,
|
|
9
|
+
} from 'ordering-components/native'
|
|
10
|
+
import { NotificationsGroupSwitchWrapper, SwitchWrapper, Container } from './styles'
|
|
11
|
+
import { StyleSheet, View } from 'react-native'
|
|
12
|
+
import { useState } from 'react'
|
|
13
|
+
import { useTheme } from 'styled-components/native';
|
|
14
|
+
import Spinner from 'react-native-loading-spinner-overlay';
|
|
15
|
+
import ToggleSwitch from 'toggle-switch-react-native'
|
|
16
|
+
import NavBar from '../NavBar'
|
|
17
|
+
import { OText } from '../shared'
|
|
18
|
+
|
|
19
|
+
const NotificationsUI = (props: any) => {
|
|
20
|
+
const {
|
|
21
|
+
navigation,
|
|
22
|
+
singleNotifications,
|
|
23
|
+
handleChangePromotions,
|
|
24
|
+
userData
|
|
25
|
+
} = props
|
|
26
|
+
|
|
27
|
+
const theme = useTheme();
|
|
28
|
+
const [{ user: userSession }] = useSession()
|
|
29
|
+
const [, t] = useLanguage();
|
|
30
|
+
const [, { showToast }] = useToast();
|
|
31
|
+
const [orderingTheme] = useOrderingTheme()
|
|
32
|
+
|
|
33
|
+
const user = userData || userSession
|
|
34
|
+
|
|
35
|
+
const [notificationsList, setNotificationsList] = useState({
|
|
36
|
+
email: singleNotifications?.result?.result
|
|
37
|
+
? !!singleNotifications?.result?.result?.settings?.email?.newsletter
|
|
38
|
+
: !!(singleNotifications?.changes?.settings?.email?.newsletter ?? (user && user?.settings?.email?.newsletter)),
|
|
39
|
+
sms: singleNotifications?.result?.result
|
|
40
|
+
? !!singleNotifications?.result?.result?.settings?.sms?.newsletter
|
|
41
|
+
: !!(singleNotifications?.changes?.settings?.sms?.newsletter ?? (user && user?.settings?.sms?.newsletter)),
|
|
42
|
+
notification: singleNotifications?.result?.result
|
|
43
|
+
? !!singleNotifications?.result?.result?.settings?.notification?.newsletter
|
|
44
|
+
: !!(singleNotifications?.changes?.settings?.notification?.newsletter ?? (user && user?.settings?.notification?.newsletter))
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
const goToBack = () => navigation?.canGoBack() && navigation.goBack()
|
|
48
|
+
const showCustomerPromotions = !orderingTheme?.theme?.profile?.components?.promotions?.hidden
|
|
49
|
+
const showNotifications = !orderingTheme?.theme?.profile?.components?.notification_settings?.hidden
|
|
50
|
+
|
|
51
|
+
const handleEditNotifications = (key: any, value: any) => {
|
|
52
|
+
setNotificationsList({
|
|
53
|
+
...notificationsList,
|
|
54
|
+
[key]: value
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
if (singleNotifications.result.result && !singleNotifications.loading) {
|
|
60
|
+
if (!singleNotifications.result?.error) {
|
|
61
|
+
showToast(ToastType.Success, t('UPDATE_SUCCESSFULLY', 'Update successfully'));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}, [singleNotifications.result])
|
|
65
|
+
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
const isSingle = true
|
|
68
|
+
handleChangePromotions(notificationsList, isSingle)
|
|
69
|
+
}, [notificationsList])
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<Container>
|
|
73
|
+
<NavBar
|
|
74
|
+
title={t('NOTIFICATIONS', 'Notifications')}
|
|
75
|
+
titleAlign={'center'}
|
|
76
|
+
onActionLeft={goToBack}
|
|
77
|
+
showCall={false}
|
|
78
|
+
style={{
|
|
79
|
+
paddingHorizontal: 40,
|
|
80
|
+
paddingVertical: 0,
|
|
81
|
+
}}
|
|
82
|
+
/>
|
|
83
|
+
{showCustomerPromotions && showNotifications && (
|
|
84
|
+
<>
|
|
85
|
+
<Spinner visible={singleNotifications?.loading} />
|
|
86
|
+
<NotificationsGroupSwitchWrapper>
|
|
87
|
+
<OText style={{ ...styles.title }}>{t('MARKETING_NOTIFICATIONS', 'Marketing Notifications')}</OText>
|
|
88
|
+
<SwitchWrapper>
|
|
89
|
+
<OText>{t('EMAILS', 'Emails')}</OText>
|
|
90
|
+
<ToggleSwitch
|
|
91
|
+
isOn={notificationsList?.email}
|
|
92
|
+
onColor={theme.colors.primary}
|
|
93
|
+
size="small"
|
|
94
|
+
disabled={singleNotifications?.loading}
|
|
95
|
+
offColor={theme.colors.disabled}
|
|
96
|
+
animationSpeed={400}
|
|
97
|
+
onToggle={() => handleEditNotifications('email', !notificationsList?.email)}
|
|
98
|
+
/>
|
|
99
|
+
</SwitchWrapper>
|
|
100
|
+
<SwitchWrapper>
|
|
101
|
+
<OText>{t('SMS', 'Sms')}</OText>
|
|
102
|
+
<ToggleSwitch
|
|
103
|
+
isOn={notificationsList?.sms}
|
|
104
|
+
onColor={theme.colors.primary}
|
|
105
|
+
size="small"
|
|
106
|
+
disabled={singleNotifications?.loading}
|
|
107
|
+
offColor={theme.colors.disabled}
|
|
108
|
+
animationSpeed={400}
|
|
109
|
+
onToggle={() => handleEditNotifications('sms', !notificationsList?.sms)}
|
|
110
|
+
/>
|
|
111
|
+
</SwitchWrapper>
|
|
112
|
+
<SwitchWrapper>
|
|
113
|
+
<OText>{t('PUSH_NOTIFICATIONS', 'Push Notifications')}</OText>
|
|
114
|
+
<ToggleSwitch
|
|
115
|
+
isOn={notificationsList?.notification}
|
|
116
|
+
onColor={theme.colors.primary}
|
|
117
|
+
size="small"
|
|
118
|
+
disabled={singleNotifications?.loading}
|
|
119
|
+
offColor={theme.colors.disabled}
|
|
120
|
+
animationSpeed={400}
|
|
121
|
+
onToggle={() => handleEditNotifications('notification', !notificationsList?.notification)}
|
|
122
|
+
/>
|
|
123
|
+
</SwitchWrapper>
|
|
124
|
+
</NotificationsGroupSwitchWrapper>
|
|
125
|
+
</>
|
|
126
|
+
)}
|
|
127
|
+
</Container>
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const styles = StyleSheet.create({
|
|
132
|
+
title: {
|
|
133
|
+
marginBottom: 24,
|
|
134
|
+
fontWeight: 'bold',
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
export const NotificationsList = (props: any) => {
|
|
139
|
+
const notificationsListProps = {
|
|
140
|
+
...props,
|
|
141
|
+
UIComponent: NotificationsUI
|
|
142
|
+
}
|
|
143
|
+
return <NotificationsController {...notificationsListProps} />
|
|
144
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import styled from 'styled-components/native'
|
|
2
|
+
|
|
3
|
+
export const Container = styled.ScrollView`
|
|
4
|
+
position: relative;
|
|
5
|
+
flex: 1;
|
|
6
|
+
padding: 20px;
|
|
7
|
+
`
|
|
8
|
+
|
|
9
|
+
export const NotificationsGroupSwitchWrapper = styled.View`
|
|
10
|
+
flex-grow: 1;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
padding: 0 20px;
|
|
13
|
+
`
|
|
14
|
+
|
|
15
|
+
export const SwitchWrapper = styled.View`
|
|
16
|
+
flex-direction: row;
|
|
17
|
+
justify-content: space-between;
|
|
18
|
+
align-items: center;
|
|
19
|
+
margin-bottom: 12px;
|
|
20
|
+
`
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
|
+
import { useUtils } from 'ordering-components/native'
|
|
3
|
+
import moment from 'moment'
|
|
4
|
+
|
|
5
|
+
export const OrderEta = (props: any) => {
|
|
6
|
+
const {
|
|
7
|
+
order,
|
|
8
|
+
outputFormat
|
|
9
|
+
} = props
|
|
10
|
+
|
|
11
|
+
const [{ parseDate }] = useUtils()
|
|
12
|
+
const [estimatedDeliveryTime, setEstimatedDeliveryTime] = useState(null)
|
|
13
|
+
|
|
14
|
+
const getEstimatedDeliveryTime = () => {
|
|
15
|
+
let _estimatedTime
|
|
16
|
+
let totalEta = 0
|
|
17
|
+
const _delivery = order?.delivery_datetime_utc
|
|
18
|
+
? order?.delivery_datetime_utc
|
|
19
|
+
: order?.delivery_datetime
|
|
20
|
+
if (order?.eta_current_status_time) {
|
|
21
|
+
const currentStatueEta = order?.eta_current_status_time
|
|
22
|
+
totalEta += currentStatueEta
|
|
23
|
+
let nextStatusTimes = 0
|
|
24
|
+
if (order?.eta_next_status_times) {
|
|
25
|
+
Object.keys(order.eta_next_status_times).map(key => {
|
|
26
|
+
if (!key.includes('status_penalty')) {
|
|
27
|
+
nextStatusTimes += order.eta_next_status_times[key]
|
|
28
|
+
}
|
|
29
|
+
})
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
totalEta += nextStatusTimes
|
|
33
|
+
|
|
34
|
+
const diffTimeAsSeconds = moment.utc(order?.reporting_data?.at[`status:${order.status}`]).add(order?.eta_current_status_time, 'minutes').diff(moment().utc(), 'seconds')
|
|
35
|
+
const diffTimeAsMinutes = Math.ceil(diffTimeAsSeconds / 60)
|
|
36
|
+
if (diffTimeAsMinutes <= 0) {
|
|
37
|
+
totalEta += (Math.floor(Math.abs(diffTimeAsMinutes / order?.eta_current_status_time) + 1) * order?.eta_current_status_penalty_time)
|
|
38
|
+
}
|
|
39
|
+
_estimatedTime = parseDate(moment(_delivery).add(totalEta, 'minutes'))
|
|
40
|
+
} else {
|
|
41
|
+
_estimatedTime = parseDate(moment(_delivery).add(order?.eta_time, 'minutes'))
|
|
42
|
+
}
|
|
43
|
+
setEstimatedDeliveryTime(_estimatedTime)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
getEstimatedDeliveryTime()
|
|
48
|
+
const interval = setInterval(() => {
|
|
49
|
+
getEstimatedDeliveryTime()
|
|
50
|
+
}, 1000)
|
|
51
|
+
return () => clearInterval(interval)
|
|
52
|
+
}, [order])
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<>
|
|
56
|
+
{!outputFormat ? estimatedDeliveryTime : moment(estimatedDeliveryTime).format(outputFormat)}
|
|
57
|
+
</>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
1
|
+
import React, { useState, useEffect, useMemo } from 'react';
|
|
2
2
|
import { View, StyleSheet, BackHandler, Platform, Linking, RefreshControl } from 'react-native';
|
|
3
3
|
import LinearGradient from 'react-native-linear-gradient';
|
|
4
4
|
import { _setStoreData } from '../../providers/StoreUtil';
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
useConfig
|
|
11
11
|
} from 'ordering-components/native';
|
|
12
12
|
import { useTheme } from 'styled-components/native';
|
|
13
|
+
import { showLocation } from 'react-native-map-link';
|
|
13
14
|
import {
|
|
14
15
|
OrderDetailsContainer,
|
|
15
16
|
Header,
|
|
@@ -31,14 +32,15 @@ import {
|
|
|
31
32
|
Map,
|
|
32
33
|
Divider,
|
|
33
34
|
OrderAction,
|
|
34
|
-
PlaceSpotWrapper
|
|
35
|
+
PlaceSpotWrapper,
|
|
36
|
+
ProfessionalPhoto
|
|
35
37
|
} from './styles';
|
|
36
38
|
import { OButton, OIcon, OModal, OText } from '../shared';
|
|
37
39
|
import { ProductItemAccordion } from '../ProductItemAccordion';
|
|
38
40
|
import { TouchableOpacity } from 'react-native-gesture-handler';
|
|
39
41
|
import { OrderDetailsParams } from '../../types';
|
|
40
42
|
import { GoogleMap } from '../GoogleMap';
|
|
41
|
-
import { verifyDecimals } from '../../utils';
|
|
43
|
+
import { verifyDecimals, getOrderStatus } from '../../utils';
|
|
42
44
|
import { OSRow } from '../OrderSummary/styles';
|
|
43
45
|
import AntIcon from 'react-native-vector-icons/AntDesign'
|
|
44
46
|
import { TaxInformation } from '../TaxInformation';
|
|
@@ -46,6 +48,7 @@ import { Placeholder, PlaceholderLine } from 'rn-placeholder';
|
|
|
46
48
|
import NavBar from '../NavBar'
|
|
47
49
|
import { OrderHistory } from './OrderHistory';
|
|
48
50
|
import { PlaceSpot } from '../PlaceSpot'
|
|
51
|
+
import { OrderEta } from './OrderEta'
|
|
49
52
|
export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
50
53
|
const {
|
|
51
54
|
navigation,
|
|
@@ -68,6 +71,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
68
71
|
},
|
|
69
72
|
statusBar: {
|
|
70
73
|
height: 12,
|
|
74
|
+
borderRadius: 8
|
|
71
75
|
},
|
|
72
76
|
logo: {
|
|
73
77
|
width: 75,
|
|
@@ -93,6 +97,12 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
93
97
|
display: 'flex',
|
|
94
98
|
alignItems: 'center',
|
|
95
99
|
flexDirection: 'row'
|
|
100
|
+
},
|
|
101
|
+
professionalBlock: {
|
|
102
|
+
borderBottomColor: theme.colors.border,
|
|
103
|
+
borderBottomWidth: 1,
|
|
104
|
+
marginVertical: 10,
|
|
105
|
+
paddingVertical: 5
|
|
96
106
|
}
|
|
97
107
|
});
|
|
98
108
|
|
|
@@ -108,7 +118,10 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
108
118
|
const { order, businessData } = props.order;
|
|
109
119
|
const mapValidStatuses = [9, 19, 23]
|
|
110
120
|
const placeSpotTypes = [3, 4, 5]
|
|
111
|
-
|
|
121
|
+
const directionTypes = [2, 3, 4, 5]
|
|
122
|
+
const activeStatus = [0, 3, 4, 7, 8, 9, 14, 18, 19, 20, 21, 22, 23]
|
|
123
|
+
const enabledPoweredByOrdering = configs?.powered_by_ordering_module?.value
|
|
124
|
+
const hideDeliveryDate = theme?.confirmation?.components?.order?.components?.date?.hidden
|
|
112
125
|
const walletName: any = {
|
|
113
126
|
cash: {
|
|
114
127
|
name: t('PAY_WITH_CASH_WALLET', 'Pay with Cash Wallet'),
|
|
@@ -118,205 +131,6 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
118
131
|
}
|
|
119
132
|
}
|
|
120
133
|
|
|
121
|
-
const getOrderStatus = (s: string) => {
|
|
122
|
-
const status = parseInt(s);
|
|
123
|
-
const orderStatus = [
|
|
124
|
-
{
|
|
125
|
-
key: 0,
|
|
126
|
-
value: t('PENDING', 'Pending'),
|
|
127
|
-
slug: 'PENDING',
|
|
128
|
-
percentage: 0.25,
|
|
129
|
-
image: theme.images.order.status0,
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
key: 1,
|
|
133
|
-
value: t('COMPLETED', 'Completed'),
|
|
134
|
-
slug: 'COMPLETED',
|
|
135
|
-
percentage: 1,
|
|
136
|
-
image: theme.images.order.status1,
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
key: 2,
|
|
140
|
-
value: t('REJECTED', 'Rejected'),
|
|
141
|
-
slug: 'REJECTED',
|
|
142
|
-
percentage: 0,
|
|
143
|
-
image: theme.images.order.status2,
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
key: 3,
|
|
147
|
-
value: t('DRIVER_IN_BUSINESS', 'Driver in business'),
|
|
148
|
-
slug: 'DRIVER_IN_BUSINESS',
|
|
149
|
-
percentage: 0.6,
|
|
150
|
-
image: theme.images.order.status3,
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
key: 4,
|
|
154
|
-
value: t('PREPARATION_COMPLETED', 'Preparation Completed'),
|
|
155
|
-
slug: 'PREPARATION_COMPLETED',
|
|
156
|
-
percentage: 0.7,
|
|
157
|
-
image: theme.images.order.status4,
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
key: 5,
|
|
161
|
-
value: t('REJECTED_BY_BUSINESS', 'Rejected by business'),
|
|
162
|
-
slug: 'REJECTED_BY_BUSINESS',
|
|
163
|
-
percentage: 0,
|
|
164
|
-
image: theme.images.order.status5,
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
key: 6,
|
|
168
|
-
value: t('REJECTED_BY_DRIVER', 'Rejected by Driver'),
|
|
169
|
-
slug: 'REJECTED_BY_DRIVER',
|
|
170
|
-
percentage: 0,
|
|
171
|
-
image: theme.images.order.status6,
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
key: 7,
|
|
175
|
-
value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business'),
|
|
176
|
-
slug: 'ACCEPTED_BY_BUSINESS',
|
|
177
|
-
percentage: 0.35,
|
|
178
|
-
image: theme.images.order.status7,
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
key: 8,
|
|
182
|
-
value: t('ACCEPTED_BY_DRIVER', 'Accepted by driver'),
|
|
183
|
-
slug: 'ACCEPTED_BY_DRIVER',
|
|
184
|
-
percentage: 0.45,
|
|
185
|
-
image: theme.images.order.status8,
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
key: 9,
|
|
189
|
-
value: t('PICK_UP_COMPLETED_BY_DRIVER', 'Pick up completed by driver'),
|
|
190
|
-
slug: 'PICK_UP_COMPLETED_BY_DRIVER',
|
|
191
|
-
percentage: 0.8,
|
|
192
|
-
image: theme.images.order.status9,
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
key: 10,
|
|
196
|
-
value: t('PICK_UP_FAILED_BY_DRIVER', 'Pick up Failed by driver'),
|
|
197
|
-
slug: 'PICK_UP_FAILED_BY_DRIVER',
|
|
198
|
-
percentage: 0,
|
|
199
|
-
image: theme.images.order.status10,
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
key: 11,
|
|
203
|
-
value: t(
|
|
204
|
-
'DELIVERY_COMPLETED_BY_DRIVER',
|
|
205
|
-
'Delivery completed by driver',
|
|
206
|
-
),
|
|
207
|
-
slug: 'DELIVERY_COMPLETED_BY_DRIVER',
|
|
208
|
-
percentage: 1,
|
|
209
|
-
image: theme.images.order.status11,
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
key: 12,
|
|
213
|
-
value: t('DELIVERY_FAILED_BY_DRIVER', 'Delivery Failed by driver'),
|
|
214
|
-
slug: 'DELIVERY_FAILED_BY_DRIVER',
|
|
215
|
-
percentage: 0,
|
|
216
|
-
image: theme.images.order.status12,
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
key: 13,
|
|
220
|
-
value: t('PREORDER', 'PreOrder'),
|
|
221
|
-
slug: 'PREORDER',
|
|
222
|
-
percentage: 0,
|
|
223
|
-
image: theme.images.order.status13,
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
key: 14,
|
|
227
|
-
value: t('ORDER_NOT_READY', 'Order not ready'),
|
|
228
|
-
slug: 'ORDER_NOT_READY',
|
|
229
|
-
percentage: 0,
|
|
230
|
-
image: theme.images.order.status13,
|
|
231
|
-
},
|
|
232
|
-
{
|
|
233
|
-
key: 15,
|
|
234
|
-
value: t(
|
|
235
|
-
'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
|
|
236
|
-
'Order picked up completed by customer',
|
|
237
|
-
),
|
|
238
|
-
slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
|
|
239
|
-
percentage: 100,
|
|
240
|
-
image: theme.images.order.status1,
|
|
241
|
-
},
|
|
242
|
-
{
|
|
243
|
-
key: 16,
|
|
244
|
-
value: t('CANCELLED_BY_CUSTOMER', 'Cancelled by customer'),
|
|
245
|
-
slug: 'CANCELLED_BY_CUSTOMER',
|
|
246
|
-
percentage: 0,
|
|
247
|
-
image: theme.images.order.status2,
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
key: 17,
|
|
251
|
-
value: t(
|
|
252
|
-
'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
|
|
253
|
-
'Order not picked up by customer',
|
|
254
|
-
),
|
|
255
|
-
slug: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
|
|
256
|
-
percentage: 0,
|
|
257
|
-
image: theme.images.order.status2,
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
key: 18,
|
|
261
|
-
value: t(
|
|
262
|
-
'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
|
|
263
|
-
'Driver almost arrived to business',
|
|
264
|
-
),
|
|
265
|
-
slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
|
|
266
|
-
percentage: 0.15,
|
|
267
|
-
image: theme.images.order.status3,
|
|
268
|
-
},
|
|
269
|
-
{
|
|
270
|
-
key: 19,
|
|
271
|
-
value: t(
|
|
272
|
-
'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
|
|
273
|
-
'Driver almost arrived to customer',
|
|
274
|
-
),
|
|
275
|
-
slug: 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
|
|
276
|
-
percentage: 0.9,
|
|
277
|
-
image: theme.images.order.status11,
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
key: 20,
|
|
281
|
-
value: t(
|
|
282
|
-
'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
|
|
283
|
-
'Customer almost arrived to business',
|
|
284
|
-
),
|
|
285
|
-
slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
|
|
286
|
-
percentage: 90,
|
|
287
|
-
image: theme.images.order.status7,
|
|
288
|
-
},
|
|
289
|
-
{
|
|
290
|
-
key: 21,
|
|
291
|
-
value: t(
|
|
292
|
-
'ORDER_CUSTOMER_ARRIVED_BUSINESS',
|
|
293
|
-
'Customer arrived to business',
|
|
294
|
-
),
|
|
295
|
-
slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
|
|
296
|
-
percentage: 95,
|
|
297
|
-
image: theme.images.order.status7,
|
|
298
|
-
},
|
|
299
|
-
{
|
|
300
|
-
key: 22,
|
|
301
|
-
value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
|
|
302
|
-
slug: 'ORDER_LOOKING_FOR_DRIVER',
|
|
303
|
-
percentage: 35,
|
|
304
|
-
image: theme.images.order.status8
|
|
305
|
-
},
|
|
306
|
-
{
|
|
307
|
-
key: 23,
|
|
308
|
-
value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
|
|
309
|
-
slug: 'ORDER_DRIVER_ON_WAY',
|
|
310
|
-
percentage: 45,
|
|
311
|
-
image: theme.images.order.status8
|
|
312
|
-
}
|
|
313
|
-
];
|
|
314
|
-
|
|
315
|
-
const objectStatus = orderStatus.find((o) => o.key === status);
|
|
316
|
-
|
|
317
|
-
return objectStatus && objectStatus;
|
|
318
|
-
};
|
|
319
|
-
|
|
320
134
|
const handleGoToMessages = (type: string) => {
|
|
321
135
|
readMessages && readMessages();
|
|
322
136
|
navigation.navigate(
|
|
@@ -447,6 +261,59 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
447
261
|
lng: parseFloat(location?.location?.split(',')[1].replace(/[^-.0-9]/g, ''))
|
|
448
262
|
} : location)
|
|
449
263
|
|
|
264
|
+
const getProductList = () => {
|
|
265
|
+
const professionalList = order?.products.reduce((prev: any, current: any) => {
|
|
266
|
+
const found = prev.find((item: any) => item.id === current?.calendar_event?.professional?.id)
|
|
267
|
+
if (found || !current?.calendar_event) {
|
|
268
|
+
return prev
|
|
269
|
+
}
|
|
270
|
+
return [...prev, current?.calendar_event?.professional]
|
|
271
|
+
}, [])
|
|
272
|
+
|
|
273
|
+
return (
|
|
274
|
+
<>
|
|
275
|
+
{professionalList?.length > 0 && professionalList.map((professional: any, i: number) => (
|
|
276
|
+
<View key={i} style={styles.professionalBlock}>
|
|
277
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', width: '100%' }}>
|
|
278
|
+
{professional?.photo ? (
|
|
279
|
+
<ProfessionalPhoto
|
|
280
|
+
source={{
|
|
281
|
+
uri: professional?.photo
|
|
282
|
+
}}
|
|
283
|
+
imageStyle={{ borderRadius: 8 }}
|
|
284
|
+
/>
|
|
285
|
+
) : (
|
|
286
|
+
<OIcon
|
|
287
|
+
src={theme.images.general.user}
|
|
288
|
+
cover={false}
|
|
289
|
+
width={80}
|
|
290
|
+
height={80}
|
|
291
|
+
/>
|
|
292
|
+
)}
|
|
293
|
+
<OText size={12} lineHeight={18} weight={'500'} numberOfLines={1}>{professional?.name} {professional?.lastname}</OText>
|
|
294
|
+
</View>
|
|
295
|
+
{order?.products.filter((product: any) => product?.calendar_event?.professional?.id === professional?.id).map((product: any, i: number) => (
|
|
296
|
+
<ProductItemAccordion
|
|
297
|
+
key={product?.id || i}
|
|
298
|
+
product={product}
|
|
299
|
+
isFromCheckout
|
|
300
|
+
/>
|
|
301
|
+
))}
|
|
302
|
+
</View>
|
|
303
|
+
))}
|
|
304
|
+
{order?.products.filter((product: any) => !product?.calendar_event).map((product: any, i: number) => (
|
|
305
|
+
<ProductItemAccordion
|
|
306
|
+
key={product?.id || i}
|
|
307
|
+
product={product}
|
|
308
|
+
isFromCheckout
|
|
309
|
+
/>
|
|
310
|
+
))}
|
|
311
|
+
</>
|
|
312
|
+
)
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
const sortedProductList = useMemo(() => getProductList(), [order?.products])
|
|
316
|
+
|
|
450
317
|
useEffect(() => {
|
|
451
318
|
if (driverLocation) {
|
|
452
319
|
parsedLocations[0] = {
|
|
@@ -530,12 +397,21 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
530
397
|
style={{ marginTop: Platform.OS === 'ios' ? 0 : 20 }}
|
|
531
398
|
titleWrapStyle={{ paddingHorizontal: 0 }}
|
|
532
399
|
titleStyle={{ marginRight: 0, marginLeft: 0 }}
|
|
533
|
-
subTitle={<OText size={12} lineHeight={18} color={theme.colors.textNormal}>
|
|
534
|
-
{order?.
|
|
535
|
-
|
|
536
|
-
|
|
400
|
+
subTitle={!hideDeliveryDate && <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
|
|
401
|
+
{activeStatus.includes(order?.status) ? (
|
|
402
|
+
<OrderEta order={order} />
|
|
403
|
+
) : (
|
|
404
|
+
parseDate(order?.reporting_data?.at[`status:${order.status}`])
|
|
405
|
+
)}
|
|
537
406
|
</OText>}
|
|
538
407
|
/>
|
|
408
|
+
{enabledPoweredByOrdering && (
|
|
409
|
+
<View style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
410
|
+
<OText>
|
|
411
|
+
Powered By Ordering.co
|
|
412
|
+
</OText>
|
|
413
|
+
</View>
|
|
414
|
+
)}
|
|
539
415
|
<OrderInfo>
|
|
540
416
|
<OrderData>
|
|
541
417
|
<View style={styles.linkWrapper}>
|
|
@@ -551,7 +427,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
551
427
|
onPress={() => handleClickOrderReview(order)}
|
|
552
428
|
>
|
|
553
429
|
<OText
|
|
554
|
-
size={
|
|
430
|
+
size={12}
|
|
555
431
|
lineHeight={15}
|
|
556
432
|
color={theme.colors.primary}
|
|
557
433
|
style={{ textDecorationLine: 'underline' }}
|
|
@@ -567,7 +443,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
567
443
|
|
|
568
444
|
>
|
|
569
445
|
<OText
|
|
570
|
-
size={
|
|
446
|
+
size={12}
|
|
571
447
|
lineHeight={15}
|
|
572
448
|
color={theme.colors.primary}
|
|
573
449
|
style={{ textDecorationLine: 'underline', textTransform: 'capitalize' }}
|
|
@@ -682,6 +558,26 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
682
558
|
{order?.business?.address}
|
|
683
559
|
</OText>
|
|
684
560
|
</View>
|
|
561
|
+
{directionTypes.includes(order?.delivery_type) && (
|
|
562
|
+
<OButton
|
|
563
|
+
text={t('GET_DIRECTIONS', 'Get Directions')}
|
|
564
|
+
imgRightSrc=''
|
|
565
|
+
textStyle={{ color: theme.colors.white }}
|
|
566
|
+
style={{
|
|
567
|
+
alignSelf: 'center',
|
|
568
|
+
borderRadius: 10,
|
|
569
|
+
marginTop: 30
|
|
570
|
+
}}
|
|
571
|
+
onClick={() => showLocation({
|
|
572
|
+
latitude: order?.business?.location?.lat,
|
|
573
|
+
longitude: order?.business?.location?.lng,
|
|
574
|
+
naverCallerName: 'com.reactnativeappstemplate5',
|
|
575
|
+
dialogTitle: t('GET_DIRECTIONS', 'Get Directions'),
|
|
576
|
+
dialogMessage: t('WHAT_APP_WOULD_YOU_USE', 'What app would you like to use?'),
|
|
577
|
+
cancelText: t('CANCEL', 'Cancel'),
|
|
578
|
+
})}
|
|
579
|
+
/>
|
|
580
|
+
)}
|
|
685
581
|
</OrderBusiness>
|
|
686
582
|
|
|
687
583
|
{placeSpotTypes.includes(order?.delivery_type) && (
|
|
@@ -761,7 +657,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
761
657
|
<>
|
|
762
658
|
{order?.driver?.location && mapValidStatuses.includes(parseInt(order?.status)) && (
|
|
763
659
|
<Map>
|
|
764
|
-
|
|
660
|
+
<GoogleMap
|
|
765
661
|
location={typeof order?.driver?.location?.location === 'string'
|
|
766
662
|
? {
|
|
767
663
|
lat: parseFloat(driverLocationString[0]),
|
|
@@ -875,14 +771,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
875
771
|
</OrderAction>
|
|
876
772
|
</HeaderInfo>
|
|
877
773
|
<OrderProducts>
|
|
878
|
-
{
|
|
879
|
-
order?.products.map((product: any, i: number) => (
|
|
880
|
-
<ProductItemAccordion
|
|
881
|
-
key={product?.id || i}
|
|
882
|
-
product={product}
|
|
883
|
-
isFromCheckout
|
|
884
|
-
/>
|
|
885
|
-
))}
|
|
774
|
+
{sortedProductList}
|
|
886
775
|
</OrderProducts>
|
|
887
776
|
<OrderBill>
|
|
888
777
|
<View style={{ height: 1, backgroundColor: theme.colors.border, marginBottom: 17 }} />
|
|
@@ -1050,8 +939,8 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
1050
939
|
)}
|
|
1051
940
|
<Total>
|
|
1052
941
|
<Table>
|
|
1053
|
-
<OText size={
|
|
1054
|
-
<OText size={
|
|
942
|
+
<OText size={14} style={{ fontWeight: 'bold' }} color={theme.colors.textNormal}>{t('TOTAL', 'Total')}</OText>
|
|
943
|
+
<OText size={14} style={{ fontWeight: 'bold' }} color={theme.colors.textNormal}>
|
|
1055
944
|
{parsePrice(order?.summary?.total ?? order?.total)}
|
|
1056
945
|
</OText>
|
|
1057
946
|
</Table>
|
|
@@ -1085,7 +974,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
1085
974
|
<OText>
|
|
1086
975
|
{event?.wallet_event
|
|
1087
976
|
? walletName[event?.wallet_event?.wallet?.type]?.name
|
|
1088
|
-
: event?.paymethod?.name}
|
|
977
|
+
: t(event?.paymethod?.name.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)}
|
|
1089
978
|
</OText>
|
|
1090
979
|
{event?.data?.charge_id && (
|
|
1091
980
|
<OText>
|
|
@@ -5,7 +5,6 @@ export const OrderDetailsContainer = styled.ScrollView`
|
|
|
5
5
|
`
|
|
6
6
|
|
|
7
7
|
export const NavBack = styled.TouchableOpacity`
|
|
8
|
-
|
|
9
8
|
`
|
|
10
9
|
|
|
11
10
|
|
|
@@ -132,3 +131,13 @@ export const OrderAction = styled.View`
|
|
|
132
131
|
export const PlaceSpotWrapper = styled.View`
|
|
133
132
|
padding-horizontal: 40px;
|
|
134
133
|
`
|
|
134
|
+
|
|
135
|
+
export const ProfessionalPhoto = styled.ImageBackground`
|
|
136
|
+
width: 100%;
|
|
137
|
+
position: relative;
|
|
138
|
+
max-height: 80px;
|
|
139
|
+
height: 80px;
|
|
140
|
+
width: 80px;
|
|
141
|
+
resize-mode: cover;
|
|
142
|
+
margin-right: 10px;
|
|
143
|
+
`;
|