ordering-ui-react-native 0.17.87 → 0.17.88-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 +8 -7
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessInformation/index.tsx +10 -9
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/OrderCreating/index.tsx +1 -21
- package/src/components/PaymentOptionsWebView/index.tsx +29 -8
- package/src/components/PhoneInputNumber/index.tsx +6 -2
- package/src/components/StripeMethodForm/index.tsx +136 -102
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +3 -2
- package/src/types/index.tsx +5 -0
- package/src/utils/index.tsx +5 -0
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +33 -26
- package/themes/business/src/components/BusinessController/index.tsx +0 -1
- package/themes/business/src/components/Chat/index.tsx +163 -123
- package/themes/business/src/components/DriverMap/index.tsx +17 -6
- package/themes/business/src/components/DriverSchedule/index.tsx +45 -8
- package/themes/business/src/components/FloatingButton/index.tsx +34 -31
- package/themes/business/src/components/GoogleMap/index.tsx +58 -57
- package/themes/business/src/components/LoginForm/Otp/index.tsx +31 -3
- package/themes/business/src/components/LoginForm/index.tsx +15 -22
- package/themes/business/src/components/MapView/index.tsx +8 -8
- package/themes/business/src/components/MessagesOption/index.tsx +20 -93
- package/themes/business/src/components/NewOrderNotification/index.tsx +123 -96
- package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
- package/themes/business/src/components/OrderDetails/Delivery.tsx +202 -12
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +84 -37
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +81 -66
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +200 -0
- package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
- package/themes/business/src/components/OrderMessage/index.tsx +19 -18
- package/themes/business/src/components/OrderSummary/index.tsx +114 -123
- package/themes/business/src/components/OrdersOption/index.tsx +22 -22
- package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
- package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +17 -12
- package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
- package/themes/business/src/components/PreviousOrders/index.tsx +198 -221
- package/themes/business/src/components/ProductItemAccordion/index.tsx +7 -1
- package/themes/business/src/components/ReviewCustomer/index.tsx +18 -13
- package/themes/business/src/components/StoresList/index.tsx +3 -4
- package/themes/business/src/components/UserProfileForm/index.tsx +14 -15
- package/themes/business/src/components/shared/OModal.tsx +16 -9
- package/themes/business/src/types/index.tsx +25 -10
- package/themes/business/src/utils/index.tsx +29 -2
- 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/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/Intro/index.tsx +16 -1
- package/themes/kiosk/src/components/LoginForm/index.tsx +7 -9
- 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 +2 -2
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/original/index.tsx +1 -1
- package/themes/original/src/components/AddressDetails/index.tsx +19 -3
- package/themes/original/src/components/AddressForm/index.tsx +35 -17
- package/themes/original/src/components/AddressList/index.tsx +5 -8
- package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +73 -37
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +10 -12
- package/themes/original/src/components/BusinessController/index.tsx +35 -44
- package/themes/original/src/components/BusinessController/styles.tsx +12 -5
- 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 +140 -85
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +15 -20
- package/themes/original/src/components/BusinessListingSearch/index.tsx +347 -336
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +0 -18
- package/themes/original/src/components/BusinessPreorder/index.tsx +103 -19
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -2
- package/themes/original/src/components/BusinessProductsList/index.tsx +15 -7
- package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
- package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
- package/themes/original/src/components/BusinessProductsListing/index.tsx +663 -556
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -3
- package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +38 -405
- package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
- package/themes/original/src/components/Cart/index.tsx +60 -51
- package/themes/original/src/components/CartContent/index.tsx +102 -58
- package/themes/original/src/components/CartContent/styles.tsx +6 -6
- package/themes/original/src/components/Checkout/index.tsx +280 -35
- package/themes/original/src/components/CitiesControl/index.tsx +1 -1
- package/themes/original/src/components/CouponControl/index.tsx +10 -3
- package/themes/original/src/components/DriverTips/index.tsx +52 -34
- package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
- package/themes/original/src/components/Favorite/index.tsx +1 -5
- package/themes/original/src/components/GPSButton/index.tsx +6 -4
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +42 -5
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +2 -0
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +86 -10
- package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
- package/themes/original/src/components/GoogleMap/index.tsx +63 -7
- package/themes/original/src/components/Home/index.tsx +13 -4
- package/themes/original/src/components/LastOrder/index.tsx +2 -1
- package/themes/original/src/components/LastOrders/index.tsx +2 -1
- package/themes/original/src/components/LoginForm/Otp/index.tsx +91 -25
- package/themes/original/src/components/LoginForm/index.tsx +64 -34
- package/themes/original/src/components/LottieAnimation/index.tsx +88 -63
- package/themes/original/src/components/MessageListing/index.tsx +9 -2
- package/themes/original/src/components/Messages/index.tsx +15 -4
- package/themes/original/src/components/MomentOption/index.tsx +193 -92
- package/themes/original/src/components/MomentSelector/index.tsx +1 -1
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +162 -50
- package/themes/original/src/components/MultiCheckout/index.tsx +385 -52
- package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +23 -19
- package/themes/original/src/components/MyOrders/index.tsx +25 -16
- package/themes/original/src/components/NavBar/index.tsx +20 -13
- package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +21 -5
- package/themes/original/src/components/OrderDetails/index.tsx +50 -38
- package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
- package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
- package/themes/original/src/components/OrderProgress/index.tsx +34 -25
- package/themes/original/src/components/OrderSummary/index.tsx +83 -57
- package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -6
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +14 -14
- package/themes/original/src/components/OrdersOption/index.tsx +59 -46
- package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
- package/themes/original/src/components/PageBanner/index.tsx +65 -29
- package/themes/original/src/components/PageBanner/styles.tsx +0 -3
- package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +100 -34
- package/themes/original/src/components/PhoneInputNumber/index.tsx +18 -4
- package/themes/original/src/components/ProductForm/index.tsx +88 -31
- package/themes/original/src/components/ProductForm/styles.tsx +3 -3
- package/themes/original/src/components/ProductItemAccordion/index.tsx +8 -6
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +49 -20
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +10 -9
- package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
- package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
- package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
- package/themes/original/src/components/Promotions/index.tsx +2 -2
- package/themes/original/src/components/Promotions/styles.tsx +3 -1
- package/themes/original/src/components/ReviewProducts/index.tsx +16 -7
- package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
- package/themes/original/src/components/ServiceForm/index.tsx +63 -20
- package/themes/original/src/components/Sessions/styles.tsx +1 -0
- package/themes/original/src/components/SignupForm/index.tsx +43 -27
- package/themes/original/src/components/SingleOrderCard/index.tsx +42 -19
- package/themes/original/src/components/SingleOrderCard/styles.tsx +1 -1
- package/themes/original/src/components/SingleProductCard/index.tsx +37 -26
- package/themes/original/src/components/SingleProductCard/styles.tsx +9 -3
- package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
- package/themes/original/src/components/StripeCardsList/index.tsx +61 -5
- package/themes/original/src/components/StripeElementsForm/index.tsx +48 -34
- package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
- package/themes/original/src/components/UpsellingProducts/index.tsx +5 -10
- package/themes/original/src/components/UserDetails/index.tsx +3 -1
- package/themes/original/src/components/UserFormDetails/index.tsx +78 -9
- package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
- package/themes/original/src/components/UserProfile/index.tsx +8 -26
- package/themes/original/src/components/UserProfileForm/index.tsx +30 -31
- package/themes/original/src/components/UserVerification/index.tsx +55 -50
- package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
- package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
- package/themes/original/src/components/Wallets/index.tsx +52 -62
- package/themes/original/src/components/Wallets/styles.tsx +2 -4
- package/themes/original/src/components/shared/OButton.tsx +3 -3
- package/themes/original/src/components/shared/OInput.tsx +4 -5
- package/themes/original/src/components/shared/OModal.tsx +3 -3
- package/themes/original/src/types/index.tsx +37 -10
- package/themes/original/src/utils/index.tsx +185 -13
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
- package/src/navigators/BottomNavigator.tsx +0 -117
- package/src/navigators/CheckoutNavigator.tsx +0 -66
- package/src/navigators/HomeNavigator.tsx +0 -202
- package/src/navigators/NavigationRef.tsx +0 -7
- package/src/navigators/RootNavigator.tsx +0 -269
- package/src/pages/Account.tsx +0 -34
- package/src/pages/AddressForm.tsx +0 -62
- package/src/pages/AddressList.tsx +0 -24
- package/src/pages/BusinessProductsList.tsx +0 -81
- package/src/pages/BusinessesListing.tsx +0 -43
- package/src/pages/CartList.tsx +0 -49
- package/src/pages/Checkout.tsx +0 -101
- package/src/pages/ForgotPassword.tsx +0 -24
- package/src/pages/Help.tsx +0 -23
- package/src/pages/HelpAccountAndPayment.tsx +0 -23
- package/src/pages/HelpGuide.tsx +0 -23
- package/src/pages/HelpOrder.tsx +0 -23
- package/src/pages/Home.tsx +0 -36
- package/src/pages/IntroductoryTutorial.tsx +0 -170
- package/src/pages/Login.tsx +0 -47
- package/src/pages/MomentOption.tsx +0 -30
- package/src/pages/MultiCheckout.tsx +0 -31
- package/src/pages/MultiOrdersDetails.tsx +0 -27
- package/src/pages/MyOrders.tsx +0 -40
- package/src/pages/NetworkError.tsx +0 -24
- package/src/pages/NotFound.tsx +0 -22
- package/src/pages/OrderDetails.tsx +0 -25
- package/src/pages/ProductDetails.tsx +0 -55
- package/src/pages/Profile.tsx +0 -36
- package/src/pages/ReviewDriver.tsx +0 -30
- package/src/pages/ReviewOrder.tsx +0 -32
- package/src/pages/ReviewProducts.tsx +0 -30
- package/src/pages/Sessions.tsx +0 -22
- package/src/pages/Signup.tsx +0 -53
- package/src/pages/SpinnerLoader.tsx +0 -10
- package/src/pages/Splash.tsx +0 -21
|
@@ -3,7 +3,6 @@ import { useLanguage, useUtils, useToast, ToastType, useConfig, MultiOrdersDetai
|
|
|
3
3
|
import { View, StyleSheet, BackHandler, TouchableOpacity } from 'react-native'
|
|
4
4
|
import { useTheme } from 'styled-components/native'
|
|
5
5
|
import { OText, OButton } from '../shared'
|
|
6
|
-
import { Container } from '../../layouts/Container'
|
|
7
6
|
import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder'
|
|
8
7
|
import { SingleOrderCard } from './SingleOrderCard'
|
|
9
8
|
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
@@ -53,6 +52,7 @@ export const MultiOrdersDetailsUI = (props: any) => {
|
|
|
53
52
|
const [, { showToast }] = useToast();
|
|
54
53
|
const [{ configs }] = useConfig()
|
|
55
54
|
|
|
55
|
+
const isTaxIncludedOnPrice = orders.every((_order: any) => _order.taxes?.length ? _order.taxes?.every((_tax: any) => _tax.type === 1) : true)
|
|
56
56
|
const progressBarStyle = configs.multi_business_checkout_progress_bar_style?.value
|
|
57
57
|
const showBarInOrder = ['group', 'both']
|
|
58
58
|
const showBarInIndividual = ['individual', 'both']
|
|
@@ -166,7 +166,7 @@ export const MultiOrdersDetailsUI = (props: any) => {
|
|
|
166
166
|
<OText key={event.id} size={12} lineHeight={18} color={theme.colors.textNormal}>
|
|
167
167
|
{event?.wallet_event
|
|
168
168
|
? walletName[event?.wallet_event?.wallet?.type]?.name
|
|
169
|
-
: event?.paymethod?.name}
|
|
169
|
+
: t(event?.paymethod?.name.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)}
|
|
170
170
|
</OText>
|
|
171
171
|
))}
|
|
172
172
|
</Section>
|
|
@@ -225,23 +225,27 @@ export const MultiOrdersDetailsUI = (props: any) => {
|
|
|
225
225
|
</Row>
|
|
226
226
|
))}
|
|
227
227
|
<BorderLine />
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
228
|
+
{!isTaxIncludedOnPrice && (
|
|
229
|
+
<>
|
|
230
|
+
<Row>
|
|
231
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
|
|
232
|
+
{t('TOTAL_BEFORE_TAX', 'Total before tax')}:
|
|
233
|
+
</OText>
|
|
234
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
|
|
235
|
+
{parsePrice(ordersSummary?.subtotal)}
|
|
236
|
+
</OText>
|
|
237
|
+
</Row>
|
|
238
|
+
<Row>
|
|
239
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
|
|
240
|
+
{t('ESTIMATED_TAX_TO_BE_COLLECTED', 'Estimated tax to be collected')}:
|
|
241
|
+
</OText>
|
|
242
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
|
|
243
|
+
{parsePrice(ordersSummary?.tax)}
|
|
244
|
+
</OText>
|
|
245
|
+
</Row>
|
|
246
|
+
<BorderLine />
|
|
247
|
+
</>
|
|
248
|
+
)}
|
|
245
249
|
<Row style={{ marginTop: 10 }}>
|
|
246
250
|
<OText size={14} lineHeight={18} weight={'500'} color={theme.colors.textNormal}>
|
|
247
251
|
{t('PAYMENT_TOTAL', 'Payment total')}:
|
|
@@ -25,13 +25,14 @@ export const MyOrders = (props: any) => {
|
|
|
25
25
|
const [ordersLength, setOrdersLength] = useState({
|
|
26
26
|
activeOrdersLength: null,
|
|
27
27
|
previousOrdersLength: 0,
|
|
28
|
+
preordersLength: 0
|
|
28
29
|
});
|
|
29
30
|
const [selectedOption, setSelectedOption] = useState(!hideOrders ? 'orders' : 'business')
|
|
30
31
|
|
|
31
32
|
const notOrderOptions = ['business', 'products']
|
|
32
|
-
const allEmpty = (ordersLength?.activeOrdersLength === 0 && ordersLength?.previousOrdersLength === 0) || ((isEmptyBusinesses || businessOrderIds?.length === 0) && hideOrders)
|
|
33
|
+
const allEmpty = (ordersLength?.activeOrdersLength === 0 && ordersLength?.previousOrdersLength === 0 && ordersLength?.preordersLength === 0) || ((isEmptyBusinesses || businessOrderIds?.length === 0) && hideOrders)
|
|
33
34
|
|
|
34
|
-
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
35
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
35
36
|
const showNavbar = theme?.bar_menu?.components?.orders?.hidden
|
|
36
37
|
const hideOrdersTheme = theme?.bar_menu?.components?.orders?.hidden
|
|
37
38
|
const hideProductsTab = theme?.orders?.components?.products_tab?.hidden
|
|
@@ -90,7 +91,7 @@ export const MyOrders = (props: any) => {
|
|
|
90
91
|
},
|
|
91
92
|
...props.titleStyle
|
|
92
93
|
}}>
|
|
93
|
-
{
|
|
94
|
+
{!props.hideBackBtn && (!isChewLayout || (isChewLayout && hideOrdersTheme)) && (
|
|
94
95
|
<OButton
|
|
95
96
|
imgLeftStyle={{ width: 18 }}
|
|
96
97
|
imgRightSrc={null}
|
|
@@ -103,7 +104,7 @@ export const MyOrders = (props: any) => {
|
|
|
103
104
|
shadowColor: '#FFF',
|
|
104
105
|
paddingLeft: 0,
|
|
105
106
|
paddingRight: 0,
|
|
106
|
-
marginTop:
|
|
107
|
+
marginTop: 30,
|
|
107
108
|
}}
|
|
108
109
|
onClick={goToBack}
|
|
109
110
|
icon={AntDesignIcon}
|
|
@@ -147,18 +148,26 @@ export const MyOrders = (props: any) => {
|
|
|
147
148
|
)}
|
|
148
149
|
{selectedOption === 'orders' && (
|
|
149
150
|
<>
|
|
150
|
-
{
|
|
151
|
-
<
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
151
|
+
<View style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}>
|
|
152
|
+
<OrdersOption
|
|
153
|
+
{...props}
|
|
154
|
+
preOrders
|
|
155
|
+
ordersLength={ordersLength}
|
|
156
|
+
setOrdersLength={setOrdersLength}
|
|
157
|
+
setRefreshOrders={setRefreshOrders}
|
|
158
|
+
refreshOrders={refreshOrders}
|
|
159
|
+
/>
|
|
160
|
+
</View>
|
|
161
|
+
<View style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}>
|
|
162
|
+
<OrdersOption
|
|
163
|
+
{...props}
|
|
164
|
+
activeOrders
|
|
165
|
+
ordersLength={ordersLength}
|
|
166
|
+
setOrdersLength={setOrdersLength}
|
|
167
|
+
setRefreshOrders={setRefreshOrders}
|
|
168
|
+
refreshOrders={refreshOrders}
|
|
169
|
+
/>
|
|
170
|
+
</View>
|
|
162
171
|
<View style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}>
|
|
163
172
|
<OrdersOption
|
|
164
173
|
{...props}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
1
4
|
import * as React from 'react'
|
|
2
5
|
import styled, { useTheme } from 'styled-components/native'
|
|
3
6
|
import { OButton, OIcon, OText } from '../shared'
|
|
@@ -9,7 +12,6 @@ const TitleWrapper = styled.View`
|
|
|
9
12
|
padding-horizontal: 10px;
|
|
10
13
|
`
|
|
11
14
|
const TitleTopWrapper = styled.View`
|
|
12
|
-
flex: 1;
|
|
13
15
|
flex-direction: row;
|
|
14
16
|
align-items: center;
|
|
15
17
|
`
|
|
@@ -17,8 +19,10 @@ const TitleTopWrapper = styled.View`
|
|
|
17
19
|
const btnBackArrow = {
|
|
18
20
|
borderWidth: 0,
|
|
19
21
|
backgroundColor: '#FFF',
|
|
20
|
-
borderColor: '#
|
|
21
|
-
shadowColor: '#FFF'
|
|
22
|
+
borderColor: '#fff',
|
|
23
|
+
shadowColor: '#FFF',
|
|
24
|
+
paddingLeft: 30,
|
|
25
|
+
paddingRight: 30
|
|
22
26
|
}
|
|
23
27
|
|
|
24
28
|
interface Props {
|
|
@@ -42,6 +46,7 @@ interface Props {
|
|
|
42
46
|
paddingTop?: number,
|
|
43
47
|
isVertical?: boolean,
|
|
44
48
|
noMargin?: any
|
|
49
|
+
hideArrowLeft?: boolean
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
const NavBar = (props: Props) => {
|
|
@@ -52,8 +57,6 @@ const NavBar = (props: Props) => {
|
|
|
52
57
|
background-color: ${theme.colors.white};
|
|
53
58
|
padding: 10px 20px 20px 0px;
|
|
54
59
|
flex-direction: row;
|
|
55
|
-
justify-content: center;
|
|
56
|
-
align-items: center;
|
|
57
60
|
position: relative;
|
|
58
61
|
`
|
|
59
62
|
|
|
@@ -62,13 +65,18 @@ const NavBar = (props: Props) => {
|
|
|
62
65
|
}
|
|
63
66
|
return (
|
|
64
67
|
<Wrapper style={{ paddingTop: props.paddingTop, ...{ flexDirection: props.isVertical ? 'column' : 'row', alignItems: props.isVertical ? 'flex-start' : 'center' }, ...props.style }}>
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
{!props.hideArrowLeft && (
|
|
69
|
+
<OButton
|
|
70
|
+
iconProps={{
|
|
71
|
+
name: 'arrowleft',
|
|
72
|
+
size: 26
|
|
73
|
+
}}
|
|
74
|
+
icon={AntDesignIcon}
|
|
75
|
+
imgRightSrc={null}
|
|
76
|
+
style={{ ...btnBackArrow, ...props.btnStyle, ...props.isVertical ? (I18nManager.isRTL ? { paddingRight: 0 } : { paddingLeft: 0 }) : {} }}
|
|
77
|
+
onClick={props?.onActionLeft}
|
|
78
|
+
/>
|
|
79
|
+
)}
|
|
72
80
|
<TitleTopWrapper>
|
|
73
81
|
{props.withIcon
|
|
74
82
|
? (
|
|
@@ -87,7 +95,6 @@ const NavBar = (props: Props) => {
|
|
|
87
95
|
<TitleWrapper style={{ ...{ paddingHorizontal: props.isVertical ? 0 : 10 }, ...props.titleWrapStyle }}>
|
|
88
96
|
<OText
|
|
89
97
|
size={20}
|
|
90
|
-
lineHeight={36}
|
|
91
98
|
weight={Platform.OS === 'ios' ? '600' : 'bold'}
|
|
92
99
|
style={
|
|
93
100
|
{
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { View } from 'react-native'
|
|
3
|
-
import { OButton,
|
|
3
|
+
import { OButton, OText } from '../shared'
|
|
4
4
|
import { NotFoundSourceParams } from '../../types'
|
|
5
5
|
import { useTheme } from 'styled-components/native';
|
|
6
|
+
import Foundation from 'react-native-vector-icons/Foundation'
|
|
6
7
|
import {
|
|
7
8
|
NotFound,
|
|
8
9
|
NotFoundImage
|
|
@@ -10,34 +11,37 @@ import {
|
|
|
10
11
|
|
|
11
12
|
export const NotFoundSource = (props: NotFoundSourceParams) => {
|
|
12
13
|
const {
|
|
13
|
-
|
|
14
|
+
hideImage,
|
|
14
15
|
content,
|
|
15
16
|
btnTitle,
|
|
17
|
+
btnStyle,
|
|
16
18
|
conditioned,
|
|
17
19
|
onClickButton
|
|
18
20
|
} = props
|
|
19
21
|
|
|
20
22
|
const theme = useTheme();
|
|
21
23
|
|
|
22
|
-
const errorImage = image || theme.images.general.notFound
|
|
23
|
-
const isUrl = typeof errorImage === 'string' && errorImage.includes('http')
|
|
24
|
-
|
|
25
24
|
return (
|
|
26
25
|
<NotFound>
|
|
27
|
-
{
|
|
26
|
+
{!hideImage && (
|
|
28
27
|
<NotFoundImage>
|
|
29
|
-
<
|
|
28
|
+
<Foundation
|
|
29
|
+
name='page-search'
|
|
30
|
+
color={theme.colors.primary}
|
|
31
|
+
size={60}
|
|
32
|
+
style={{ marginBottom: 10 }}
|
|
33
|
+
/>
|
|
30
34
|
</NotFoundImage>
|
|
31
35
|
)}
|
|
32
|
-
{content && conditioned &&
|
|
33
|
-
{content && !conditioned && <OText color={theme.colors.disabled} size={
|
|
36
|
+
{content && conditioned && <OText color={theme.colors.disabled} size={16} style={{ textAlign: 'center' }}>{content}</OText>}
|
|
37
|
+
{content && !conditioned && <OText color={theme.colors.disabled} size={16} style={{ textAlign: 'center' }}>{content}</OText>}
|
|
34
38
|
{!onClickButton && props.children && (
|
|
35
39
|
props.children
|
|
36
40
|
)}
|
|
37
41
|
{onClickButton && (
|
|
38
42
|
<View style={{ marginTop: 10, width: '100%' }}>
|
|
39
43
|
<OButton
|
|
40
|
-
style={{ width: '100%', height: 50 }}
|
|
44
|
+
style={{ width: '100%', height: 50, ...btnStyle }}
|
|
41
45
|
bgColor={theme.colors.primary}
|
|
42
46
|
borderColor={theme.colors.primary}
|
|
43
47
|
onClick={() => onClickButton()}
|
|
@@ -0,0 +1,76 @@
|
|
|
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 estimatedUtcTime = null
|
|
16
|
+
let totalEta = 0
|
|
17
|
+
if (order?.delivered_in) totalEta += order?.delivered_in
|
|
18
|
+
if (order?.prepared_in) totalEta += order?.prepared_in
|
|
19
|
+
if (order?.delivery_type === 1 && order?.eta_drive_time) {
|
|
20
|
+
totalEta += order?.eta_drive_time
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const _delivery = order?.delivery_datetime_utc
|
|
24
|
+
? order?.delivery_datetime_utc
|
|
25
|
+
: order?.delivery_datetime
|
|
26
|
+
|
|
27
|
+
if (order?.eta_current_status_time) {
|
|
28
|
+
const currentStatueEta = order?.eta_current_status_time
|
|
29
|
+
totalEta += currentStatueEta
|
|
30
|
+
let previousStatusTimes = 0
|
|
31
|
+
if (order?.eta_previous_status_times) {
|
|
32
|
+
Object.keys(order.eta_previous_status_times).map(key => {
|
|
33
|
+
if (!key.includes('status_penalty')) {
|
|
34
|
+
previousStatusTimes += order.eta_previous_status_times[key]
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
totalEta += previousStatusTimes
|
|
39
|
+
|
|
40
|
+
let nextStatusTimes = 0
|
|
41
|
+
if (order?.eta_next_status_times) {
|
|
42
|
+
Object.keys(order.eta_next_status_times).map(key => {
|
|
43
|
+
if (!key.includes('status_penalty')) {
|
|
44
|
+
nextStatusTimes += order.eta_next_status_times[key]
|
|
45
|
+
}
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
totalEta += nextStatusTimes
|
|
49
|
+
|
|
50
|
+
const diffTimeAsSeconds = moment.utc(order?.reporting_data?.at[`status:${order.status}`]).add(order?.eta_current_status_time, 'minutes').diff(moment().utc(), 'seconds')
|
|
51
|
+
const diffTimeAsMinutes = Math.ceil(diffTimeAsSeconds / 60)
|
|
52
|
+
if (diffTimeAsMinutes <= 0) {
|
|
53
|
+
totalEta += (Math.floor(Math.abs(diffTimeAsMinutes / order?.eta_current_status_time) + 1) * order?.eta_current_status_penalty_time)
|
|
54
|
+
}
|
|
55
|
+
} else {
|
|
56
|
+
totalEta = order?.eta_time + totalEta
|
|
57
|
+
}
|
|
58
|
+
estimatedUtcTime = moment.utc(_delivery).add(totalEta, 'minutes')
|
|
59
|
+
const _estimatedTime = outputFormat ? moment(estimatedUtcTime).local().format(outputFormat) : parseDate(estimatedUtcTime, { utc: false })
|
|
60
|
+
setEstimatedDeliveryTime(_estimatedTime)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
getEstimatedDeliveryTime()
|
|
65
|
+
const interval = setInterval(() => {
|
|
66
|
+
getEstimatedDeliveryTime()
|
|
67
|
+
}, 1000)
|
|
68
|
+
return () => clearInterval(interval)
|
|
69
|
+
}, [order, outputFormat])
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<>
|
|
73
|
+
{estimatedDeliveryTime}
|
|
74
|
+
</>
|
|
75
|
+
)
|
|
76
|
+
}
|
|
@@ -4,6 +4,7 @@ import { ScrollView, StyleSheet, View } from 'react-native'
|
|
|
4
4
|
import { useLanguage, useUtils } from 'ordering-components/native'
|
|
5
5
|
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons'
|
|
6
6
|
import { OText, OButton } from '../shared'
|
|
7
|
+
import { formatSeconds } from '../../utils'
|
|
7
8
|
|
|
8
9
|
export const OrderHistory = (props: any) => {
|
|
9
10
|
const {
|
|
@@ -61,7 +62,7 @@ export const OrderHistory = (props: any) => {
|
|
|
61
62
|
20: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
|
|
62
63
|
21: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
|
|
63
64
|
22: 'ORDER_LOOKING_FOR_DRIVER',
|
|
64
|
-
|
|
65
|
+
23: 'ORDER_DRIVER_ON_WAY'
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
const getLogisticTagStatus = (status: any) => {
|
|
@@ -106,8 +107,12 @@ export const OrderHistory = (props: any) => {
|
|
|
106
107
|
ellipsizeMode='tail'
|
|
107
108
|
>
|
|
108
109
|
{t('ORDER_PLACED', 'Order placed')} {' '}
|
|
109
|
-
{
|
|
110
|
-
|
|
110
|
+
{!props.hideViaText && (
|
|
111
|
+
<>
|
|
112
|
+
{t('VIA', 'Via')}{' '}
|
|
113
|
+
{order.app_id ? t(order.app_id.toUpperCase(), order.app_id) : t('OTHER', 'Other')}
|
|
114
|
+
</>
|
|
115
|
+
)}
|
|
111
116
|
</OText>
|
|
112
117
|
<OText size={12}>{parseDate(order?.created_at, { outputFormat: 'MMM DD, hh:mm A' })}</OText>
|
|
113
118
|
</View>
|
|
@@ -128,12 +133,23 @@ export const OrderHistory = (props: any) => {
|
|
|
128
133
|
<OText
|
|
129
134
|
size={14}
|
|
130
135
|
weight='bold'
|
|
131
|
-
numberOfLines={1}
|
|
136
|
+
numberOfLines={message.change?.attribute.includes(['delivered_in', 'prepared_in']) ? 2 : 1}
|
|
132
137
|
ellipsizeMode='tail'
|
|
133
138
|
>
|
|
134
139
|
{message.change?.attribute === 'logistic_status'
|
|
135
140
|
? getLogisticTagStatus(parseInt(message.change.new, 10))
|
|
136
|
-
:
|
|
141
|
+
: message.change?.attribute === 'delivered_in' ? (
|
|
142
|
+
<>
|
|
143
|
+
{t('TIME_ADDED_BY_DRIVER', 'Time added by driver')}{'\n'}
|
|
144
|
+
{formatSeconds(parseInt(message.change.new, 10))}
|
|
145
|
+
</>
|
|
146
|
+
)
|
|
147
|
+
: message.change?.attribute === 'prepared_in' ? (
|
|
148
|
+
<>
|
|
149
|
+
{t('TIME_ADDED_BY_BUSINESS', 'Time added by business')}{'\n'}
|
|
150
|
+
{formatSeconds(parseInt(message.change.new, 10))}
|
|
151
|
+
</>
|
|
152
|
+
) : t(ORDER_STATUS[parseInt(message.change.new, 10)])
|
|
137
153
|
}
|
|
138
154
|
</OText>
|
|
139
155
|
) : (
|
|
@@ -7,7 +7,9 @@ import {
|
|
|
7
7
|
OrderDetails as OrderDetailsConTableoller,
|
|
8
8
|
useUtils,
|
|
9
9
|
useOrder,
|
|
10
|
-
useConfig
|
|
10
|
+
useConfig,
|
|
11
|
+
useToast,
|
|
12
|
+
ToastType
|
|
11
13
|
} from 'ordering-components/native';
|
|
12
14
|
import { useTheme } from 'styled-components/native';
|
|
13
15
|
import { showLocation } from 'react-native-map-link';
|
|
@@ -40,7 +42,7 @@ import { ProductItemAccordion } from '../ProductItemAccordion';
|
|
|
40
42
|
import { TouchableOpacity } from 'react-native-gesture-handler';
|
|
41
43
|
import { OrderDetailsParams } from '../../types';
|
|
42
44
|
import { GoogleMap } from '../GoogleMap';
|
|
43
|
-
import { verifyDecimals, getOrderStatus } from '../../utils';
|
|
45
|
+
import { verifyDecimals, getOrderStatus, getOrderStatuPickUp } from '../../utils';
|
|
44
46
|
import { OSRow } from '../OrderSummary/styles';
|
|
45
47
|
import AntIcon from 'react-native-vector-icons/AntDesign'
|
|
46
48
|
import { TaxInformation } from '../TaxInformation';
|
|
@@ -49,6 +51,7 @@ import NavBar from '../NavBar'
|
|
|
49
51
|
import { OrderHistory } from './OrderHistory';
|
|
50
52
|
import { PlaceSpot } from '../PlaceSpot'
|
|
51
53
|
import { SendGiftCard } from '../GiftCard/SendGiftCard'
|
|
54
|
+
import { OrderEta } from './OrderEta'
|
|
52
55
|
export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
53
56
|
const {
|
|
54
57
|
navigation,
|
|
@@ -64,7 +67,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
64
67
|
} = props;
|
|
65
68
|
|
|
66
69
|
const theme = useTheme();
|
|
67
|
-
|
|
70
|
+
const [, { showToast }] = useToast()
|
|
68
71
|
const styles = StyleSheet.create({
|
|
69
72
|
rowDirection: {
|
|
70
73
|
flexDirection: 'row',
|
|
@@ -120,7 +123,9 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
120
123
|
const mapValidStatuses = [9, 19, 23]
|
|
121
124
|
const placeSpotTypes = [3, 4, 5]
|
|
122
125
|
const directionTypes = [2, 3, 4, 5]
|
|
123
|
-
const activeStatus = [0, 3, 4, 7, 8, 9, 14, 18, 19, 20, 21, 22, 23]
|
|
126
|
+
const activeStatus = [0, 3, 4, 7, 8, 9, 13, 14, 18, 19, 20, 21, 22, 23]
|
|
127
|
+
const reorderStatus = [1, 2, 5, 6, 10, 11, 12]
|
|
128
|
+
const [isPickup, setIsPickup] = useState(order?.delivery_type === 2)
|
|
124
129
|
const enabledPoweredByOrdering = configs?.powered_by_ordering_module?.value
|
|
125
130
|
const isGiftCardOrder = !order?.business_id
|
|
126
131
|
const hideDeliveryDate = theme?.confirmation?.components?.order?.components?.date?.hidden
|
|
@@ -134,6 +139,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
134
139
|
const hideDriverMessages = theme?.confirmation?.components?.driver?.components?.messages?.hidden
|
|
135
140
|
const hideCustomerPhone = theme?.confirmation?.components?.customer?.components?.phone?.hidden
|
|
136
141
|
const hideCustomerAddress = theme?.confirmation?.components?.customer?.components?.address?.hidden
|
|
142
|
+
const progressBarObjt = isPickup ? getOrderStatuPickUp : getOrderStatus
|
|
137
143
|
const walletName: any = {
|
|
138
144
|
cash: {
|
|
139
145
|
name: t('PAY_WITH_CASH_WALLET', 'Pay with Cash Wallet'),
|
|
@@ -191,7 +197,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
191
197
|
order: {
|
|
192
198
|
id: order?.id,
|
|
193
199
|
business_id: order?.business_id,
|
|
194
|
-
logo: order.business?.logo,
|
|
200
|
+
logo: order.business?.logo || theme.images.dummies.businessLogo,
|
|
195
201
|
driver: order?.driver,
|
|
196
202
|
products: order?.products,
|
|
197
203
|
review: order?.review,
|
|
@@ -335,6 +341,19 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
335
341
|
}
|
|
336
342
|
}, [driverLocation]);
|
|
337
343
|
|
|
344
|
+
useEffect(() => {
|
|
345
|
+
if (props?.order?.error && !props?.order?.loading) {
|
|
346
|
+
showToast(ToastType.Error, props?.order?.error)
|
|
347
|
+
navigation.navigate('BusinessList')
|
|
348
|
+
}
|
|
349
|
+
}, [props?.order?.error, props?.order?.loading])
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
useEffect(() => {
|
|
353
|
+
if (!order?.delivery_type) return
|
|
354
|
+
setIsPickup(order?.delivery_type === 2)
|
|
355
|
+
}, [order?.delivery_type])
|
|
356
|
+
|
|
338
357
|
return (
|
|
339
358
|
<OrderDetailsContainer
|
|
340
359
|
keyboardShouldPersistTaps="handled"
|
|
@@ -410,13 +429,11 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
410
429
|
titleWrapStyle={{ paddingHorizontal: 0 }}
|
|
411
430
|
titleStyle={{ marginRight: 0, marginLeft: 0 }}
|
|
412
431
|
subTitle={!hideDeliveryDate && <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
|
|
413
|
-
{
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
: parseDate(order?.delivery_datetime, { utc: false })
|
|
419
|
-
}
|
|
432
|
+
{activeStatus.includes(order?.status) ? (
|
|
433
|
+
<OrderEta order={order} />
|
|
434
|
+
) : (
|
|
435
|
+
parseDate(order?.reporting_data?.at[`status:${order.status}`])
|
|
436
|
+
)}
|
|
420
437
|
</OText>}
|
|
421
438
|
/>
|
|
422
439
|
{enabledPoweredByOrdering && (
|
|
@@ -472,7 +489,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
472
489
|
<LinearGradient
|
|
473
490
|
start={{ x: 0.0, y: 0.0 }}
|
|
474
491
|
end={{
|
|
475
|
-
x:
|
|
492
|
+
x: progressBarObjt(order?.status)?.percentage || 0,
|
|
476
493
|
y: 0,
|
|
477
494
|
}}
|
|
478
495
|
locations={[0.9999, 0.9999]}
|
|
@@ -485,7 +502,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
485
502
|
lineHeight={24}
|
|
486
503
|
weight={'600'}
|
|
487
504
|
color={theme.colors.textNormal}>
|
|
488
|
-
{
|
|
505
|
+
{progressBarObjt(order?.status)?.value}
|
|
489
506
|
</OText>
|
|
490
507
|
</>
|
|
491
508
|
)}
|
|
@@ -783,25 +800,17 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
783
800
|
parentStyle={{ marginTop: 29, marginEnd: 15 }}
|
|
784
801
|
onClick={() => navigation.navigate('BottomTab', { screen: 'MyOrders' })}
|
|
785
802
|
/>
|
|
786
|
-
{(
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
textStyle={{ fontSize: 14, color: theme.colors.primary }}
|
|
798
|
-
imgRightSrc={null}
|
|
799
|
-
borderColor='transparent'
|
|
800
|
-
bgColor={theme.colors.primary + 10}
|
|
801
|
-
style={{ borderRadius: 7.6, borderWidth: 1, height: 44, shadowOpacity: 0, marginTop: 29 }}
|
|
802
|
-
onClick={() => handleReorder && handleReorder(order.id)}
|
|
803
|
-
/>
|
|
804
|
-
)}
|
|
803
|
+
{(reorderStatus?.includes(parseInt(order?.status)) && order?.cart) && (
|
|
804
|
+
<OButton
|
|
805
|
+
text={order.id === reorderState?.loading ? t('LOADING', 'Loading..') : t('REORDER', 'Reorder')}
|
|
806
|
+
textStyle={{ fontSize: 14, color: theme.colors.primary }}
|
|
807
|
+
imgRightSrc={null}
|
|
808
|
+
borderColor='transparent'
|
|
809
|
+
bgColor={theme.colors.primary + 10}
|
|
810
|
+
style={{ borderRadius: 7.6, borderWidth: 1, height: 44, shadowOpacity: 0, marginTop: 29 }}
|
|
811
|
+
onClick={() => handleReorder && handleReorder(order.id)}
|
|
812
|
+
/>
|
|
813
|
+
)}
|
|
805
814
|
</OrderAction>
|
|
806
815
|
</HeaderInfo>
|
|
807
816
|
<OrderProducts>
|
|
@@ -935,7 +944,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
935
944
|
</Table>
|
|
936
945
|
))
|
|
937
946
|
}
|
|
938
|
-
{order?.summary?.delivery_price
|
|
947
|
+
{typeof order?.summary?.delivery_price === 'number' && (
|
|
939
948
|
<Table>
|
|
940
949
|
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('DELIVERY_FEE', 'Delivery Fee')}</OText>
|
|
941
950
|
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(order?.summary?.delivery_price)}</OText>
|
|
@@ -1010,16 +1019,18 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
1010
1019
|
<OText>
|
|
1011
1020
|
{event?.wallet_event
|
|
1012
1021
|
? walletName[event?.wallet_event?.wallet?.type]?.name
|
|
1013
|
-
: event?.paymethod?.name}
|
|
1022
|
+
: t(event?.paymethod?.name.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)}
|
|
1014
1023
|
</OText>
|
|
1015
|
-
{event?.data?.charge_id && (
|
|
1024
|
+
{/* {event?.data?.charge_id && (
|
|
1016
1025
|
<OText>
|
|
1017
1026
|
{`${t('CODE', 'Code')}: ${event?.data?.charge_id}`}
|
|
1018
1027
|
</OText>
|
|
1019
|
-
)}
|
|
1028
|
+
)} */}
|
|
1020
1029
|
</View>
|
|
1021
1030
|
<OText>
|
|
1022
|
-
|
|
1031
|
+
{configs.currency_position?.value === 'left'
|
|
1032
|
+
? `${configs.format_number_currency?.value} -${parseNumber(event.amount, { isTruncable: true })}`
|
|
1033
|
+
: `-${parsePrice(event.amount, { isTruncable: true })}`}
|
|
1023
1034
|
</OText>
|
|
1024
1035
|
</View>
|
|
1025
1036
|
))}
|
|
@@ -1065,6 +1076,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
1065
1076
|
>
|
|
1066
1077
|
<OrderHistory
|
|
1067
1078
|
order={order}
|
|
1079
|
+
hideViaText={props.hideViaText}
|
|
1068
1080
|
messages={messages}
|
|
1069
1081
|
enableReview={(
|
|
1070
1082
|
parseInt(order?.status) === 1 ||
|
|
@@ -20,7 +20,8 @@ export const OrderItAgain = (props: OrderItAgainParams) => {
|
|
|
20
20
|
currentCart,
|
|
21
21
|
handleUpdateProducts,
|
|
22
22
|
navigation,
|
|
23
|
-
searchValue
|
|
23
|
+
searchValue,
|
|
24
|
+
businessSingleId
|
|
24
25
|
} = props
|
|
25
26
|
|
|
26
27
|
const [, t] = useLanguage()
|
|
@@ -65,6 +66,7 @@ export const OrderItAgain = (props: OrderItAgainParams) => {
|
|
|
65
66
|
handleUpdateProducts={handleUpdateProducts}
|
|
66
67
|
navigation={navigation}
|
|
67
68
|
isPreviously
|
|
69
|
+
businessSingleId={businessSingleId}
|
|
68
70
|
/>
|
|
69
71
|
</ProductWrapper>
|
|
70
72
|
))}
|