ordering-ui-react-native 0.14.82 → 0.14.83-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 -3
- package/src/DeliveryApp.tsx +34 -2
- package/src/assets/images/no-network.png +0 -0
- package/src/components/BusinessTypeFilter/index.tsx +9 -2
- package/src/components/BusinessTypeFilter/styles.tsx +1 -1
- package/src/components/BusinessesListing/index.tsx +2 -2
- package/src/components/Cart/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +1 -2
- package/src/components/Home/index.tsx +3 -5
- package/src/components/LanguageSelector/index.tsx +65 -97
- package/src/components/LanguageSelector/styles.tsx +4 -17
- package/src/components/Messages/index.tsx +38 -30
- package/src/components/MomentOption/index.tsx +3 -1
- package/src/components/OrderDetails/index.tsx +29 -6
- package/src/components/OrdersOption/index.tsx +4 -2
- package/src/components/PaymentOptions/index.tsx +7 -16
- package/src/components/PaymentOptionsWebView/index.tsx +123 -124
- package/src/components/ProductForm/index.tsx +1 -1
- package/src/components/ProductForm/styles.tsx +1 -0
- package/src/components/StripeElementsForm/index.tsx +27 -48
- package/src/components/UserProfileForm/index.tsx +35 -1
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/config.json +0 -2
- package/src/pages/Checkout.tsx +1 -1
- package/src/providers/AlertProvider.tsx +4 -1
- package/src/theme.json +2 -1
- package/src/types/index.tsx +2 -9
- package/src/utils/index.tsx +196 -1
- package/themes/business/index.tsx +4 -0
- package/themes/business/src/components/Chat/index.tsx +32 -31
- package/themes/business/src/components/NetworkError/index.tsx +61 -0
- package/themes/business/src/components/NetworkError/styles.tsx +11 -0
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -0
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +85 -17
- package/themes/business/src/components/OrdersListManager/index.tsx +871 -0
- package/themes/business/src/components/OrdersListManager/styles.tsx +123 -0
- package/themes/business/src/components/OrdersListManager/utils.tsx +216 -0
- package/themes/business/src/components/OrdersOption/index.tsx +354 -54
- package/themes/business/src/components/OrdersOption/styles.tsx +95 -7
- package/themes/business/src/components/PreviousMessages/index.tsx +12 -0
- package/themes/business/src/components/PreviousOrders/index.tsx +65 -46
- package/themes/business/src/components/PreviousOrders/styles.tsx +5 -10
- package/themes/business/src/components/ReviewCustomer/index.tsx +11 -8
- package/themes/business/src/types/index.tsx +4 -0
- package/themes/business/src/utils/index.tsx +12 -0
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/doordash/src/components/OrderDetails/index.tsx +3 -1
- package/themes/doordash/src/components/OrdersOption/index.tsx +4 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/instacart/src/components/OrderDetails/index.tsx +3 -1
- package/themes/instacart/src/components/OrdersOption/index.tsx +4 -2
- package/themes/kiosk/index.tsx +2 -0
- package/themes/kiosk/src/components/BusinessController/index.tsx +27 -6
- package/themes/kiosk/src/components/BusinessController/styles.tsx +1 -1
- package/themes/kiosk/src/components/BusinessProductsListing/index.tsx +51 -24
- package/themes/kiosk/src/components/Cart/index.tsx +1 -1
- package/themes/kiosk/src/components/CartBottomSheet/index.tsx +1 -1
- package/themes/kiosk/src/components/CartBottomSheet/styles.tsx +1 -1
- package/themes/kiosk/src/components/CartContent/index.tsx +13 -3
- package/themes/kiosk/src/components/CartItem/index.tsx +20 -8
- package/themes/kiosk/src/components/CategoriesMenu/index.tsx +7 -5
- package/themes/kiosk/src/components/CustomerName/index.tsx +89 -88
- package/themes/kiosk/src/components/Intro/index.tsx +13 -13
- package/themes/kiosk/src/components/LanguageSelector/index.tsx +12 -8
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/NetworkError/index.tsx +60 -0
- package/themes/kiosk/src/components/NetworkError/styles.tsx +11 -0
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderDetails/index.tsx +2 -2
- package/themes/kiosk/src/components/OrderSummary/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +10 -12
- package/themes/kiosk/src/components/ProductForm/index.tsx +172 -124
- package/themes/kiosk/src/components/ProductForm/styles.tsx +1 -1
- package/themes/kiosk/src/components/ProductOption/index.tsx +1 -0
- package/themes/kiosk/src/components/ProductOption/styles.tsx +1 -0
- package/themes/kiosk/src/components/UpsellingProducts/index.tsx +48 -34
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/components/shared/OCard.tsx +112 -78
- package/themes/kiosk/src/types/index.d.ts +4 -0
- package/themes/original/index.tsx +28 -6
- package/themes/original/src/components/AnalyticsSegment/index.tsx +127 -0
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +12 -39
- package/themes/original/src/components/BusinessController/index.tsx +2 -2
- package/themes/original/src/components/BusinessMenuList/index.tsx +4 -2
- package/themes/original/src/components/BusinessPreorder/index.tsx +3 -2
- package/themes/original/src/components/BusinessProductsList/index.tsx +50 -6
- package/themes/original/src/components/BusinessProductsListing/index.tsx +13 -10
- package/themes/original/src/components/BusinessReviews/index.tsx +4 -3
- package/themes/original/src/components/BusinessesListing/index.tsx +22 -18
- package/themes/original/src/components/Cart/index.tsx +43 -10
- package/themes/original/src/components/Checkout/index.tsx +55 -20
- package/themes/original/src/components/Checkout/styles.tsx +7 -0
- package/themes/original/src/components/CouponControl/index.tsx +1 -0
- package/themes/original/src/components/DriverTips/index.tsx +1 -1
- package/themes/original/src/components/ForgotPasswordForm/index.tsx +8 -12
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +9 -2
- package/themes/original/src/components/LastOrder/index.tsx +3 -1
- package/themes/original/src/components/LoginForm/index.tsx +83 -68
- package/themes/original/src/components/MessageListing/index.tsx +4 -2
- package/themes/original/src/components/Messages/index.tsx +19 -21
- package/themes/original/src/components/MomentOption/index.tsx +127 -152
- package/themes/original/src/components/MomentOption/styles.tsx +42 -18
- package/themes/original/src/components/NetworkError/index.tsx +61 -0
- package/themes/original/src/components/NetworkError/styles.tsx +11 -0
- package/themes/original/src/components/OrderDetails/index.tsx +106 -113
- package/themes/original/src/components/OrderProgress/index.tsx +6 -5
- package/themes/original/src/components/OrderSummary/index.tsx +34 -1
- package/themes/original/src/components/OrdersOption/index.tsx +20 -42
- package/themes/original/src/components/OrdersOption/styles.tsx +0 -5
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +1 -1
- package/themes/original/src/components/PaymentOptions/index.tsx +20 -23
- package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -8
- package/themes/original/src/components/PlaceSpot/index.tsx +114 -0
- package/themes/original/src/components/PlaceSpot/styles.tsx +11 -0
- package/themes/original/src/components/PreviousOrders/index.tsx +4 -0
- package/themes/original/src/components/ProductForm/index.tsx +33 -18
- package/themes/original/src/components/ProductForm/styles.tsx +0 -1
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +81 -74
- package/themes/original/src/components/ReviewDriver/index.tsx +315 -0
- package/themes/original/src/components/ReviewDriver/styles.tsx +38 -0
- package/themes/original/src/components/ReviewOrder/index.tsx +307 -186
- package/themes/original/src/components/ReviewOrder/styles.tsx +24 -13
- package/themes/original/src/components/ReviewProducts/index.tsx +116 -0
- package/themes/original/src/components/ReviewProducts/styles.tsx +16 -0
- package/themes/original/src/components/SignupForm/index.tsx +173 -154
- package/themes/original/src/components/SingleProductCard/index.tsx +6 -13
- package/themes/original/src/components/SingleProductCard/styles.tsx +1 -1
- package/themes/original/src/components/SingleProductReview/index.tsx +166 -0
- package/themes/original/src/components/SingleProductReview/styles.tsx +27 -0
- package/themes/original/src/components/StripeElementsForm/index.tsx +55 -72
- package/themes/original/src/components/UpsellingProducts/index.tsx +6 -6
- package/themes/original/src/components/UserDetails/index.tsx +4 -95
- package/themes/original/src/components/UserFormDetails/index.tsx +2 -14
- package/themes/original/src/components/UserProfile/index.tsx +13 -6
- package/themes/original/src/components/UserProfileForm/index.tsx +16 -8
- package/themes/original/src/components/VerifyPhone/index.tsx +10 -7
- package/themes/original/src/components/VerifyPhone/styles.tsx +2 -1
- package/themes/original/src/components/WalletTransactionItem/index.tsx +3 -2
- package/themes/original/src/components/Wallets/index.tsx +16 -8
- package/themes/original/src/layouts/FloatingBottomContainer.tsx +26 -0
- package/themes/original/src/types/index.tsx +47 -10
- package/themes/single-business/src/components/LastOrder/index.tsx +3 -1
- package/themes/single-business/src/components/OrderDetails/index.tsx +15 -0
- package/themes/single-business/src/components/OrderTypeSelector/index.tsx +5 -5
- package/themes/single-business/src/components/OrdersOption/index.tsx +4 -2
- package/themes/single-business/src/utils/index.tsx +7 -1
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/uber-eats/src/components/OrderDetails/index.tsx +3 -1
- package/themes/uber-eats/src/components/OrdersOption/index.tsx +4 -2
- package/src/components/StripeMethodForm/index.tsx +0 -163
|
@@ -6,37 +6,61 @@ export const Container = styled.ScrollView`
|
|
|
6
6
|
padding: 0 20px;
|
|
7
7
|
padding-bottom: 20px;
|
|
8
8
|
`
|
|
9
|
-
|
|
9
|
+
export const HeaderTitle = styled.View`
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
margin-bottom: 20px;
|
|
12
|
+
`
|
|
10
13
|
export const WrapSelectOption = styled.TouchableOpacity`
|
|
11
14
|
flex-direction: row;
|
|
12
15
|
align-items: center;
|
|
13
16
|
margin-vertical: 5px;
|
|
14
17
|
`
|
|
15
|
-
export const
|
|
16
|
-
|
|
18
|
+
export const Days = styled.View`
|
|
19
|
+
flex-wrap: wrap;
|
|
20
|
+
flex-direction: row;
|
|
21
|
+
margin-vertical: 10px;
|
|
17
22
|
`
|
|
23
|
+
export const Day = styled.TouchableOpacity`
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
border-right-width: 1px;
|
|
29
|
+
width: 25%;
|
|
30
|
+
margin-vertical: 10px;
|
|
31
|
+
border-color: ${(props: any) => props.theme.colors.textSecondary};
|
|
18
32
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
33
|
+
${(props: any) => props.borderLeftShow && css`
|
|
34
|
+
border-left-width: 1px;
|
|
35
|
+
`}
|
|
22
36
|
`
|
|
23
|
-
|
|
24
|
-
|
|
37
|
+
export const WrapHours = styled.ScrollView`
|
|
38
|
+
border-width: 1px;
|
|
39
|
+
border-color: ${(props: any) => props.theme.colors.border};
|
|
40
|
+
border-radius: 7.6px;
|
|
41
|
+
margin-top: 6px;
|
|
42
|
+
height: 140px;
|
|
43
|
+
max-height: 140px;
|
|
44
|
+
`
|
|
45
|
+
export const Hours = styled.View`
|
|
25
46
|
flex: 1;
|
|
26
47
|
flex-wrap: wrap;
|
|
27
48
|
flex-direction: row;
|
|
28
49
|
justify-content: space-between;
|
|
50
|
+
margin: 0 20px;
|
|
29
51
|
`
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
width: 86px;
|
|
33
|
-
height: 34px;
|
|
34
|
-
background: #E9ECEF;
|
|
35
|
-
border-radius: 7.6px;
|
|
52
|
+
export const Hour = styled.TouchableOpacity`
|
|
53
|
+
flex-direction: row;
|
|
36
54
|
justify-content: center;
|
|
37
55
|
align-items: center;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
56
|
+
padding: 5px;
|
|
57
|
+
border-width: 1px;
|
|
58
|
+
border-radius: 7.6px;
|
|
59
|
+
border-color: ${(props: any) => props.theme.colors.border};
|
|
60
|
+
width: 90px;
|
|
61
|
+
margin-vertical: 7px;
|
|
62
|
+
`
|
|
63
|
+
|
|
64
|
+
export const WrapDelveryTime = styled.View`
|
|
65
|
+
flex: 1;
|
|
42
66
|
`
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { useLanguage } from 'ordering-components/native'
|
|
3
|
+
import { Dimensions } from 'react-native'
|
|
4
|
+
import RNRestart from 'react-native-restart'
|
|
5
|
+
import { OText, OIcon, OButton } from '../shared'
|
|
6
|
+
import { useTheme } from 'styled-components/native'
|
|
7
|
+
import { NoNetworkParams } from '../../types'
|
|
8
|
+
import {
|
|
9
|
+
Container,
|
|
10
|
+
ImageContainer
|
|
11
|
+
} from './styles'
|
|
12
|
+
|
|
13
|
+
export const NetworkError = (props: NoNetworkParams) => {
|
|
14
|
+
const {
|
|
15
|
+
image
|
|
16
|
+
} = props
|
|
17
|
+
const theme = useTheme()
|
|
18
|
+
const [, t] = useLanguage()
|
|
19
|
+
|
|
20
|
+
const noNetworkImage = image || theme.images.general.noNetwork
|
|
21
|
+
const deviceWidth = Dimensions.get('screen').width
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<Container>
|
|
25
|
+
<OText
|
|
26
|
+
color={theme.colors.textNormal}
|
|
27
|
+
size={20}
|
|
28
|
+
weight='700'
|
|
29
|
+
style={{ marginBottom: 14 }}
|
|
30
|
+
>
|
|
31
|
+
{t('MOBILE_NO_INTERNET', 'No internet connection')}
|
|
32
|
+
</OText>
|
|
33
|
+
<OText
|
|
34
|
+
color={theme.colors.textNormal}
|
|
35
|
+
size={14}
|
|
36
|
+
>
|
|
37
|
+
{t('NETWORK_OFFLINE_MESSAGE', 'Your connection appears to be off-line. Try to refresh the page')}
|
|
38
|
+
</OText>
|
|
39
|
+
<ImageContainer>
|
|
40
|
+
<OIcon
|
|
41
|
+
src={noNetworkImage}
|
|
42
|
+
width={(deviceWidth - 80) * 0.9}
|
|
43
|
+
height={(deviceWidth - 80) * 0.8}
|
|
44
|
+
/>
|
|
45
|
+
<OButton
|
|
46
|
+
text={t('REFRESH', 'Refresh')}
|
|
47
|
+
bgColor={theme.colors.primary}
|
|
48
|
+
borderColor={theme.colors.primary}
|
|
49
|
+
style={{
|
|
50
|
+
borderRadius: 8,
|
|
51
|
+
marginTop: 45
|
|
52
|
+
}}
|
|
53
|
+
textStyle={{
|
|
54
|
+
color: theme.colors.white
|
|
55
|
+
}}
|
|
56
|
+
onClick={() => RNRestart.Restart()}
|
|
57
|
+
/>
|
|
58
|
+
</ImageContainer>
|
|
59
|
+
</Container>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import { View, StyleSheet, BackHandler,
|
|
3
|
-
import Spinner from 'react-native-loading-spinner-overlay';
|
|
2
|
+
import { View, StyleSheet, BackHandler, Platform, Linking } from 'react-native';
|
|
4
3
|
import LinearGradient from 'react-native-linear-gradient';
|
|
5
|
-
import { Messages } from '../Messages';
|
|
6
4
|
import {
|
|
7
5
|
useLanguage,
|
|
8
6
|
OrderDetails as OrderDetailsConTableoller,
|
|
9
7
|
useUtils,
|
|
10
|
-
useConfig
|
|
11
|
-
useSession,
|
|
8
|
+
useConfig
|
|
12
9
|
} from 'ordering-components/native';
|
|
13
10
|
import { useTheme } from 'styled-components/native';
|
|
14
11
|
import {
|
|
@@ -16,14 +13,10 @@ import {
|
|
|
16
13
|
Header,
|
|
17
14
|
OrderContent,
|
|
18
15
|
OrderBusiness,
|
|
19
|
-
Logo,
|
|
20
16
|
OrderData,
|
|
21
17
|
OrderInfo,
|
|
22
|
-
OrderStatus,
|
|
23
18
|
StaturBar,
|
|
24
|
-
StatusImage,
|
|
25
19
|
OrderCustomer,
|
|
26
|
-
CustomerPhoto,
|
|
27
20
|
InfoBlock,
|
|
28
21
|
HeaderInfo,
|
|
29
22
|
Customer,
|
|
@@ -31,17 +24,16 @@ import {
|
|
|
31
24
|
Table,
|
|
32
25
|
OrderBill,
|
|
33
26
|
Total,
|
|
34
|
-
NavBack,
|
|
35
27
|
Icons,
|
|
36
28
|
OrderDriver,
|
|
37
29
|
Map,
|
|
38
30
|
Divider,
|
|
31
|
+
OrderAction
|
|
39
32
|
} from './styles';
|
|
40
33
|
import { OButton, OIcon, OModal, OText } from '../shared';
|
|
41
34
|
import { ProductItemAccordion } from '../ProductItemAccordion';
|
|
42
35
|
import { TouchableOpacity } from 'react-native-gesture-handler';
|
|
43
36
|
import { OrderDetailsParams } from '../../types';
|
|
44
|
-
import { USER_TYPE } from '../../config/constants';
|
|
45
37
|
import { GoogleMap } from '../GoogleMap';
|
|
46
38
|
import { verifyDecimals } from '../../utils';
|
|
47
39
|
import { OSRow } from '../OrderSummary/styles';
|
|
@@ -55,9 +47,11 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
55
47
|
messages,
|
|
56
48
|
setMessages,
|
|
57
49
|
readMessages,
|
|
58
|
-
messagesReadList,
|
|
59
50
|
isFromCheckout,
|
|
60
51
|
driverLocation,
|
|
52
|
+
onNavigationRedirect,
|
|
53
|
+
reorderState,
|
|
54
|
+
handleReorder
|
|
61
55
|
} = props;
|
|
62
56
|
|
|
63
57
|
const theme = useTheme();
|
|
@@ -92,16 +86,8 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
92
86
|
|
|
93
87
|
const [, t] = useLanguage();
|
|
94
88
|
const [{ parsePrice, parseNumber, parseDate }] = useUtils();
|
|
95
|
-
const [{ user }] = useSession();
|
|
96
89
|
const [{ configs }] = useConfig();
|
|
97
|
-
|
|
98
|
-
const [openModalForBusiness, setOpenModalForBusiness] = useState(false);
|
|
99
|
-
const [openModalForDriver, setOpenModalForDriver] = useState(false);
|
|
100
90
|
const [isReviewed, setIsReviewed] = useState(false)
|
|
101
|
-
const [unreadAlert, setUnreadAlert] = useState({
|
|
102
|
-
business: false,
|
|
103
|
-
driver: false,
|
|
104
|
-
});
|
|
105
91
|
const [openTaxModal, setOpenTaxModal] = useState<any>({ open: false, tax: null, type: '' })
|
|
106
92
|
|
|
107
93
|
const { order, businessData } = props.order;
|
|
@@ -293,6 +279,20 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
293
279
|
percentage: 95,
|
|
294
280
|
image: theme.images.order.status7,
|
|
295
281
|
},
|
|
282
|
+
{
|
|
283
|
+
key: 22,
|
|
284
|
+
value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
|
|
285
|
+
slug: 'ORDER_LOOKING_FOR_DRIVER',
|
|
286
|
+
percentage: 35,
|
|
287
|
+
image: theme.images.order.status8
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
key: 23,
|
|
291
|
+
value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
|
|
292
|
+
slug: 'ORDER_DRIVER_ON_WAY',
|
|
293
|
+
percentage: 45,
|
|
294
|
+
image: theme.images.order.status8
|
|
295
|
+
}
|
|
296
296
|
];
|
|
297
297
|
|
|
298
298
|
const objectStatus = orderStatus.find((o) => o.key === status);
|
|
@@ -300,38 +300,24 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
300
300
|
return objectStatus && objectStatus;
|
|
301
301
|
};
|
|
302
302
|
|
|
303
|
-
const
|
|
304
|
-
setOpenModalForBusiness(true);
|
|
303
|
+
const handleGoToMessages = (type: string) => {
|
|
305
304
|
readMessages && readMessages();
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
const business = unreadedMessages.some((message: any) =>
|
|
323
|
-
message?.can_see?.includes(2),
|
|
324
|
-
);
|
|
325
|
-
const driver = unreadedMessages.some((message: any) =>
|
|
326
|
-
message?.can_see?.includes(4),
|
|
327
|
-
);
|
|
328
|
-
setUnreadAlert({ business, driver });
|
|
329
|
-
};
|
|
330
|
-
|
|
331
|
-
const handleCloseModal = () => {
|
|
332
|
-
setOpenModalForBusiness(false);
|
|
333
|
-
setOpenModalForDriver(false);
|
|
334
|
-
};
|
|
305
|
+
navigation.navigate(
|
|
306
|
+
'MessageDetails',
|
|
307
|
+
{
|
|
308
|
+
type,
|
|
309
|
+
order,
|
|
310
|
+
messages,
|
|
311
|
+
setMessages,
|
|
312
|
+
orderId: order?.id,
|
|
313
|
+
business: type === 'business',
|
|
314
|
+
driver: type === 'driver',
|
|
315
|
+
onClose: () => navigation?.canGoBack()
|
|
316
|
+
? navigation.goBack()
|
|
317
|
+
: navigation.navigate('BottomTab', { screen: 'MyOrders' }),
|
|
318
|
+
}
|
|
319
|
+
)
|
|
320
|
+
}
|
|
335
321
|
|
|
336
322
|
const handleArrowBack: any = () => {
|
|
337
323
|
if (!isFromCheckout) {
|
|
@@ -373,6 +359,16 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
373
359
|
)
|
|
374
360
|
}
|
|
375
361
|
|
|
362
|
+
|
|
363
|
+
useEffect(() => {
|
|
364
|
+
if (reorderState?.error) {
|
|
365
|
+
navigation.navigate('Business', { store: businessData?.slug })
|
|
366
|
+
}
|
|
367
|
+
if (!reorderState?.error && reorderState?.result?.uuid) {
|
|
368
|
+
onNavigationRedirect && onNavigationRedirect('CheckoutNavigator', { cartUuid: reorderState?.result.uuid })
|
|
369
|
+
}
|
|
370
|
+
}, [reorderState])
|
|
371
|
+
|
|
376
372
|
useEffect(() => {
|
|
377
373
|
BackHandler.addEventListener('hardwareBackPress', handleArrowBack);
|
|
378
374
|
return () => {
|
|
@@ -380,14 +376,6 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
380
376
|
};
|
|
381
377
|
}, []);
|
|
382
378
|
|
|
383
|
-
useEffect(() => {
|
|
384
|
-
if (messagesReadList?.length) {
|
|
385
|
-
openModalForBusiness
|
|
386
|
-
? setUnreadAlert({ ...unreadAlert, business: false })
|
|
387
|
-
: setUnreadAlert({ ...unreadAlert, driver: false });
|
|
388
|
-
}
|
|
389
|
-
}, [messagesReadList]);
|
|
390
|
-
|
|
391
379
|
const locations = [
|
|
392
380
|
{
|
|
393
381
|
...order?.driver?.location,
|
|
@@ -416,10 +404,6 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
416
404
|
}
|
|
417
405
|
}, [driverLocation]);
|
|
418
406
|
|
|
419
|
-
useEffect(() => {
|
|
420
|
-
console.log('order: ', order)
|
|
421
|
-
}, [order]);
|
|
422
|
-
|
|
423
407
|
return (
|
|
424
408
|
<OrderDetailsContainer keyboardShouldPersistTaps="handled">
|
|
425
409
|
{(!order || Object.keys(order).length === 0) && (
|
|
@@ -467,7 +451,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
467
451
|
<PlaceholderLine width={65} height={10} />
|
|
468
452
|
<PlaceholderLine width={80} height={10} />
|
|
469
453
|
<PlaceholderLine width={70} height={10} />
|
|
470
|
-
<View style={{marginTop: 10}}>
|
|
454
|
+
<View style={{ marginTop: 10 }}>
|
|
471
455
|
<PlaceholderLine width={60} height={20} />
|
|
472
456
|
<PlaceholderLine width={40} height={10} />
|
|
473
457
|
</View>
|
|
@@ -580,21 +564,23 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
580
564
|
{order?.business?.name}
|
|
581
565
|
</OText>
|
|
582
566
|
<Icons>
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
567
|
+
{!!order?.business?.cellphone && (
|
|
568
|
+
<TouchableOpacity
|
|
569
|
+
onPress={() => order?.business?.cellphone &&
|
|
570
|
+
Linking.openURL(`tel:${order?.business?.cellphone}`)
|
|
571
|
+
}
|
|
572
|
+
style={{ paddingEnd: 5 }}
|
|
573
|
+
>
|
|
574
|
+
<OIcon
|
|
575
|
+
src={theme.images.general.phone}
|
|
576
|
+
width={16}
|
|
577
|
+
color={theme.colors.disabled}
|
|
578
|
+
/>
|
|
579
|
+
</TouchableOpacity>
|
|
580
|
+
)}
|
|
595
581
|
<TouchableOpacity
|
|
596
582
|
style={{ paddingStart: 5 }}
|
|
597
|
-
onPress={() =>
|
|
583
|
+
onPress={() => handleGoToMessages('business')}>
|
|
598
584
|
<OIcon
|
|
599
585
|
src={theme.images.general.chat}
|
|
600
586
|
width={16}
|
|
@@ -610,13 +596,15 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
610
596
|
mBottom={2}>
|
|
611
597
|
{order?.business?.email}
|
|
612
598
|
</OText>
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
599
|
+
{!!order?.business?.cellphone && (
|
|
600
|
+
<OText
|
|
601
|
+
size={12}
|
|
602
|
+
lineHeight={18}
|
|
603
|
+
color={theme.colors.textNormal}
|
|
604
|
+
mBottom={2}>
|
|
605
|
+
{order?.business?.cellphone}
|
|
606
|
+
</OText>
|
|
607
|
+
)}
|
|
620
608
|
<OText size={12} lineHeight={18} color={theme.colors.textNormal}>
|
|
621
609
|
{order?.business?.address}
|
|
622
610
|
</OText>
|
|
@@ -721,7 +709,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
721
709
|
</OText>
|
|
722
710
|
<Icons>
|
|
723
711
|
<TouchableOpacity
|
|
724
|
-
onPress={() =>
|
|
712
|
+
onPress={() => handleGoToMessages('driver')}>
|
|
725
713
|
<OIcon
|
|
726
714
|
src={theme.images.general.chat}
|
|
727
715
|
width={16}
|
|
@@ -762,16 +750,37 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
762
750
|
'Once business accepts your order, we will send you an email, thank you!',
|
|
763
751
|
)}
|
|
764
752
|
</OText>
|
|
765
|
-
<
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
753
|
+
<OrderAction>
|
|
754
|
+
<OButton
|
|
755
|
+
text={t('YOUR_ORDERS', 'Your Orders')}
|
|
756
|
+
textStyle={{ fontSize: 14, color: theme.colors.primary }}
|
|
757
|
+
imgRightSrc={null}
|
|
758
|
+
borderColor={theme.colors.primary}
|
|
759
|
+
bgColor={theme.colors.clear}
|
|
760
|
+
style={{ borderRadius: 7.6, borderWidth: 1, height: 44, shadowOpacity: 0 }}
|
|
761
|
+
parentStyle={{ marginTop: 29, marginEnd: 15 }}
|
|
762
|
+
onClick={() => navigation.navigate('BottomTab', { screen: 'MyOrders' })}
|
|
763
|
+
/>
|
|
764
|
+
{(
|
|
765
|
+
parseInt(order?.status) === 1 ||
|
|
766
|
+
parseInt(order?.status) === 2 ||
|
|
767
|
+
parseInt(order?.status) === 5 ||
|
|
768
|
+
parseInt(order?.status) === 6 ||
|
|
769
|
+
parseInt(order?.status) === 10 ||
|
|
770
|
+
parseInt(order?.status) === 11 ||
|
|
771
|
+
parseInt(order?.status) === 12
|
|
772
|
+
) && (
|
|
773
|
+
<OButton
|
|
774
|
+
text={order.id === reorderState?.loading ? t('LOADING', 'Loading..') : t('REORDER', 'Reorder')}
|
|
775
|
+
textStyle={{ fontSize: 14, color: theme.colors.primary }}
|
|
776
|
+
imgRightSrc={null}
|
|
777
|
+
borderColor='transparent'
|
|
778
|
+
bgColor={theme.colors.primary + 10}
|
|
779
|
+
style={{ borderRadius: 7.6, borderWidth: 1, height: 44, shadowOpacity: 0, marginTop: 29 }}
|
|
780
|
+
onClick={() => handleReorder && handleReorder(order.id)}
|
|
781
|
+
/>
|
|
782
|
+
)}
|
|
783
|
+
</OrderAction>
|
|
775
784
|
</HeaderInfo>
|
|
776
785
|
<OrderProducts>
|
|
777
786
|
{order?.products?.length &&
|
|
@@ -881,7 +890,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
881
890
|
<OSRow>
|
|
882
891
|
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal} numberOfLines={1}>
|
|
883
892
|
{fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
884
|
-
({parsePrice(fee?.fixed)} + {fee.percentage}%){' '}
|
|
893
|
+
({fee?.fixed > 0 && `${parsePrice(fee?.fixed)} + `}{fee.percentage}%){' '}
|
|
885
894
|
</OText>
|
|
886
895
|
<TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: fee, type: 'fee' })}>
|
|
887
896
|
<AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
|
|
@@ -964,7 +973,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
964
973
|
marginTop: 10
|
|
965
974
|
}}
|
|
966
975
|
>
|
|
967
|
-
{order?.payment_events?.map((event: any) => (
|
|
976
|
+
{order?.payment_events?.map((event: any) => event.amount > 0 && (
|
|
968
977
|
<View
|
|
969
978
|
key={event.id}
|
|
970
979
|
style={{
|
|
@@ -1004,22 +1013,6 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
1004
1013
|
</OrderContent>
|
|
1005
1014
|
</>
|
|
1006
1015
|
)}
|
|
1007
|
-
<OModal
|
|
1008
|
-
open={openModalForBusiness || openModalForDriver}
|
|
1009
|
-
entireModal
|
|
1010
|
-
customClose
|
|
1011
|
-
onClose={() => handleCloseModal()}>
|
|
1012
|
-
<Messages
|
|
1013
|
-
type={openModalForBusiness ? USER_TYPE.BUSINESS : USER_TYPE.DRIVER}
|
|
1014
|
-
orderId={order?.id}
|
|
1015
|
-
messages={messages}
|
|
1016
|
-
order={order}
|
|
1017
|
-
business={openModalForBusiness}
|
|
1018
|
-
driver={openModalForDriver}
|
|
1019
|
-
setMessages={setMessages}
|
|
1020
|
-
onClose={handleCloseModal}
|
|
1021
|
-
/>
|
|
1022
|
-
</OModal>
|
|
1023
1016
|
<OModal
|
|
1024
1017
|
open={openTaxModal.open}
|
|
1025
1018
|
onClose={() => setOpenTaxModal({ open: false, data: null, type: '' })}
|
|
@@ -9,7 +9,7 @@ import IconAntDesign from 'react-native-vector-icons/AntDesign'
|
|
|
9
9
|
import moment from 'moment';
|
|
10
10
|
import { OText } from '../shared'
|
|
11
11
|
import { NotFoundSource } from '../NotFoundSource'
|
|
12
|
-
import { View, StyleSheet, TouchableOpacity } from 'react-native'
|
|
12
|
+
import { View, StyleSheet, TouchableOpacity, Platform } from 'react-native'
|
|
13
13
|
import { Placeholder, Fade, PlaceholderLine } from "rn-placeholder";
|
|
14
14
|
import FastImage from 'react-native-fast-image'
|
|
15
15
|
import {
|
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
ProgressTextWrapper,
|
|
20
20
|
OrderInfoWrapper
|
|
21
21
|
} from './styles'
|
|
22
|
-
|
|
23
22
|
const OrderProgressUI = (props: any) => {
|
|
24
23
|
const {
|
|
25
24
|
orderList,
|
|
@@ -97,7 +96,9 @@ const OrderProgressUI = (props: any) => {
|
|
|
97
96
|
{ key: 18, value: t('ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS', theme?.defaultLanguages?.ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS || 'Driver almost arrived to business'), slug: 'ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS', percentage: 55 },
|
|
98
97
|
{ key: 19, value: t('ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER', theme?.defaultLanguages?.ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER || 'Driver almost arrived to customer'), slug: 'ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER', percentage: 90 },
|
|
99
98
|
{ key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', theme?.defaultLanguages?.ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS || 'Customer almost arrived to business'), slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', percentage: 90 },
|
|
100
|
-
{ key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', theme?.defaultLanguages?.ORDER_CUSTOMER_ARRIVED_BUSINESS || 'Customer arrived to business'), slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS', percentage: 95 }
|
|
99
|
+
{ key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', theme?.defaultLanguages?.ORDER_CUSTOMER_ARRIVED_BUSINESS || 'Customer arrived to business'), slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS', percentage: 95 },
|
|
100
|
+
{ key: 22, value: t('ORDER_LOOKING_FOR_DRIVER', theme?.defaultLanguages?.ORDER_LOOKING_FOR_DRIVER || 'Looking for driver'), slug: 'ORDER_LOOKING_FOR_DRIVER', percentage: 35 },
|
|
101
|
+
{ key: 23, value: t('ORDER_DRIVER_ON_WAY', theme?.defaultLanguages?.ORDER_DRIVER_ON_WAY || 'Driver on way'), slug: 'ORDER_DRIVER_ON_WAY', percentage: 45 }
|
|
101
102
|
]
|
|
102
103
|
|
|
103
104
|
const objectStatus = orderStatus.find((o) => o.key === status)
|
|
@@ -137,7 +138,7 @@ const OrderProgressUI = (props: any) => {
|
|
|
137
138
|
return (
|
|
138
139
|
<>
|
|
139
140
|
{orderList?.loading && (
|
|
140
|
-
<Placeholder Animation={Fade} height={
|
|
141
|
+
<Placeholder Animation={Fade} height={Platform.OS === 'ios' ? 147.5 : 158}>
|
|
141
142
|
<PlaceholderLine height={60} style={{ borderRadius: 8, marginBottom: 10 }} />
|
|
142
143
|
<PlaceholderLine height={20} style={{ marginBottom: 10 }} />
|
|
143
144
|
<PlaceholderLine height={40} style={{ borderRadius: 8, marginBottom: 10 }} />
|
|
@@ -217,7 +218,7 @@ export const OrderProgress = (props: any) => {
|
|
|
217
218
|
const orderProgressProps = {
|
|
218
219
|
...props,
|
|
219
220
|
UIComponent: OrderProgressUI,
|
|
220
|
-
orderStatus: [0, 3, 4, 7, 8, 9, 13, 14, 15, 18, 19, 20, 21],
|
|
221
|
+
orderStatus: [0, 3, 4, 7, 8, 9, 13, 14, 15, 18, 19, 20, 21, 22, 23],
|
|
221
222
|
useDefualtSessionManager: true,
|
|
222
223
|
paginationSettings: {
|
|
223
224
|
initialPage: 1,
|
|
@@ -26,6 +26,7 @@ import AntIcon from 'react-native-vector-icons/AntDesign'
|
|
|
26
26
|
import { TaxInformation } from '../TaxInformation';
|
|
27
27
|
import { TouchableOpacity } from 'react-native';
|
|
28
28
|
import { OAlert } from '../../../../../src/components/shared'
|
|
29
|
+
import { PlaceSpot } from '../PlaceSpot'
|
|
29
30
|
|
|
30
31
|
const OrderSummaryUI = (props: any) => {
|
|
31
32
|
const {
|
|
@@ -49,7 +50,9 @@ const OrderSummaryUI = (props: any) => {
|
|
|
49
50
|
const [validationFields] = useValidationFields();
|
|
50
51
|
const [openTaxModal, setOpenTaxModal] = useState<any>({ open: false, data: null, type: '' })
|
|
51
52
|
const [confirm, setConfirm] = useState<any>({ open: false, content: null, handleOnAccept: null, id: null, title: null })
|
|
53
|
+
const [openPlaceModal, setOpenPlaceModal] = useState(false)
|
|
52
54
|
const isCouponEnabled = validationFields?.fields?.checkout?.coupon?.enabled;
|
|
55
|
+
const placeSpotTypes = [3, 4]
|
|
53
56
|
|
|
54
57
|
const handleDeleteClick = (product: any) => {
|
|
55
58
|
removeProduct(product, cart)
|
|
@@ -276,7 +279,7 @@ const OrderSummaryUI = (props: any) => {
|
|
|
276
279
|
<OText size={12} numberOfLines={1}>
|
|
277
280
|
{walletName[cart?.wallets?.find((wallet: any) => wallet.id === event.wallet_id)?.type]?.name}
|
|
278
281
|
</OText>
|
|
279
|
-
<OText size={12}>-{parsePrice(event.amount)}</OText>
|
|
282
|
+
<OText size={12}>-{parsePrice(event.amount, { isTruncable: true })}</OText>
|
|
280
283
|
</OSTable>
|
|
281
284
|
))}
|
|
282
285
|
{isCouponEnabled && !isCartPending && (
|
|
@@ -301,6 +304,24 @@ const OrderSummaryUI = (props: any) => {
|
|
|
301
304
|
</OSTable>
|
|
302
305
|
</View>
|
|
303
306
|
)}
|
|
307
|
+
{placeSpotTypes.includes(orderState?.options?.type) && (
|
|
308
|
+
<OSTable style={{ marginTop: 15 }}>
|
|
309
|
+
<OText size={14} lineHeight={21} weight={'600'}>
|
|
310
|
+
{t('SPOT', 'Spot')}: {cart?.place?.name || t('NO_SELECTED', 'No selected')}
|
|
311
|
+
</OText>
|
|
312
|
+
<TouchableOpacity onPress={() => setOpenPlaceModal(true)}>
|
|
313
|
+
<OText
|
|
314
|
+
size={14}
|
|
315
|
+
lineHeight={21}
|
|
316
|
+
weight={'600'}
|
|
317
|
+
color={theme.colors.primary}
|
|
318
|
+
style={{ textDecorationLine: 'underline' }}
|
|
319
|
+
>
|
|
320
|
+
{t('EDIT', 'Edit')}
|
|
321
|
+
</OText>
|
|
322
|
+
</TouchableOpacity>
|
|
323
|
+
</OSTable>
|
|
324
|
+
)}
|
|
304
325
|
{cart?.status !== 2 && (
|
|
305
326
|
<OSTable>
|
|
306
327
|
<View style={{ width: '100%', marginTop: 20 }}>
|
|
@@ -349,6 +370,18 @@ const OrderSummaryUI = (props: any) => {
|
|
|
349
370
|
products={cart?.products}
|
|
350
371
|
/>
|
|
351
372
|
</OModal>
|
|
373
|
+
<OModal
|
|
374
|
+
open={openPlaceModal}
|
|
375
|
+
title={t('CHOOSE_YOUR_SPOT', 'Choose your spot')}
|
|
376
|
+
onClose={() => setOpenPlaceModal(false)}
|
|
377
|
+
entireModal
|
|
378
|
+
>
|
|
379
|
+
<PlaceSpot
|
|
380
|
+
cart={cart}
|
|
381
|
+
isOpenPlaceSpot={openPlaceModal}
|
|
382
|
+
setOpenPlaceModal={setOpenPlaceModal}
|
|
383
|
+
/>
|
|
384
|
+
</OModal>
|
|
352
385
|
<OAlert
|
|
353
386
|
open={confirm.open}
|
|
354
387
|
title={confirm.title}
|