ordering-ui-react-native 0.14.25 → 0.14.27-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 +2 -2
- package/src/components/Messages/index.tsx +6 -1
- package/src/components/ProductForm/index.tsx +40 -34
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/doordash/src/components/ProductForm/index.tsx +14 -16
- package/themes/instacart/src/components/BusinessProductsList/styles.tsx +1 -1
- package/themes/instacart/src/components/ProductForm/index.tsx +13 -15
- package/themes/instacart/src/components/SingleProductCard/index.tsx +19 -24
- package/themes/instacart/src/components/SingleProductCard/styles.tsx +6 -4
- package/themes/kiosk/src/components/ProductForm/index.tsx +13 -15
- package/themes/original/index.tsx +0 -4
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +1 -2
- package/themes/original/src/components/BusinessesListing/index.tsx +19 -25
- package/themes/original/src/components/Cart/index.tsx +9 -27
- package/themes/original/src/components/CartContent/index.tsx +0 -1
- package/themes/original/src/components/Checkout/index.tsx +4 -15
- package/themes/original/src/components/Checkout/styles.tsx +1 -5
- package/themes/original/src/components/FacebookLogin/index.tsx +20 -5
- package/themes/original/src/components/Help/index.tsx +2 -2
- package/themes/original/src/components/Home/index.tsx +5 -3
- package/themes/original/src/components/Messages/index.tsx +39 -59
- package/themes/original/src/components/OrderDetails/index.tsx +5 -55
- package/themes/original/src/components/OrderProgress/index.tsx +2 -2
- package/themes/original/src/components/OrderSummary/index.tsx +3 -21
- package/themes/original/src/components/ProductForm/index.tsx +43 -28
- package/themes/original/src/components/UserProfile/index.tsx +0 -5
- package/themes/original/src/types/index.tsx +2 -4
- package/themes/single-business/src/components/ProductForm/index.tsx +28 -29
- package/themes/uber-eats/src/components/ProductForm/index.tsx +13 -15
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +0 -163
- package/themes/original/src/components/PaymentOptionWallet/styles.tsx +0 -38
- package/themes/original/src/components/WalletTransactionItem/index.tsx +0 -68
- package/themes/original/src/components/WalletTransactionItem/styles.tsx +0 -37
- package/themes/original/src/components/Wallets/index.tsx +0 -204
- package/themes/original/src/components/Wallets/styles.tsx +0 -43
|
@@ -23,7 +23,6 @@ import { PaymentOptions } from '../PaymentOptions';
|
|
|
23
23
|
import { DriverTips } from '../DriverTips';
|
|
24
24
|
import { NotFoundSource } from '../NotFoundSource';
|
|
25
25
|
import { UserDetails } from '../UserDetails';
|
|
26
|
-
import { PaymentOptionWallet } from '../PaymentOptionWallet';
|
|
27
26
|
|
|
28
27
|
import {
|
|
29
28
|
ChContainer,
|
|
@@ -38,8 +37,7 @@ import {
|
|
|
38
37
|
ChUserDetails,
|
|
39
38
|
ChCart,
|
|
40
39
|
DeliveryOptionsContainer,
|
|
41
|
-
DeliveryOptionItem
|
|
42
|
-
WalletPaymentOptionContainer
|
|
40
|
+
DeliveryOptionItem
|
|
43
41
|
} from './styles';
|
|
44
42
|
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
|
|
45
43
|
|
|
@@ -506,15 +504,6 @@ const CheckoutUI = (props: any) => {
|
|
|
506
504
|
</ChSection>
|
|
507
505
|
)}
|
|
508
506
|
|
|
509
|
-
{!cartState.loading && cart && (
|
|
510
|
-
<WalletPaymentOptionContainer>
|
|
511
|
-
<PaymentOptionWallet
|
|
512
|
-
cart={cart}
|
|
513
|
-
/>
|
|
514
|
-
</WalletPaymentOptionContainer>
|
|
515
|
-
)}
|
|
516
|
-
|
|
517
|
-
|
|
518
507
|
{!cartState.loading && cart && (
|
|
519
508
|
<ChSection>
|
|
520
509
|
<ChCart>
|
|
@@ -554,8 +543,8 @@ const CheckoutUI = (props: any) => {
|
|
|
554
543
|
)}
|
|
555
544
|
|
|
556
545
|
{!cartState.loading && cart && (
|
|
557
|
-
|
|
558
|
-
<ChErrors
|
|
546
|
+
<ChSection style={{ paddingTop: 0, paddingBottom: 20, paddingHorizontal: 20 }}>
|
|
547
|
+
<ChErrors>
|
|
559
548
|
{!cart?.valid_address && cart?.status !== 2 && (
|
|
560
549
|
<OText
|
|
561
550
|
color={theme.colors.error}
|
|
@@ -583,7 +572,7 @@ const CheckoutUI = (props: any) => {
|
|
|
583
572
|
</OText>
|
|
584
573
|
)}
|
|
585
574
|
</ChErrors>
|
|
586
|
-
</
|
|
575
|
+
</ChSection>
|
|
587
576
|
)}
|
|
588
577
|
<OModal
|
|
589
578
|
open={openChangeStore && props.isFranchiseApp}
|
|
@@ -74,10 +74,6 @@ export const ChDriverTips = styled(ChPaymethods)``
|
|
|
74
74
|
|
|
75
75
|
export const ChCart = styled(ChPaymethods)``
|
|
76
76
|
|
|
77
|
-
export const WalletPaymentOptionContainer = styled(ChPaymethods)`
|
|
78
|
-
padding-bottom: 0;
|
|
79
|
-
`
|
|
80
|
-
|
|
81
77
|
export const ChPlaceOrderBtn = styled.View`
|
|
82
78
|
width: 100%;
|
|
83
79
|
display: flex;
|
|
@@ -103,4 +99,4 @@ export const DeliveryOptionItem = styled.View`
|
|
|
103
99
|
align-items: center;
|
|
104
100
|
flex-direction: row;
|
|
105
101
|
background-color: ${(props : any) => props?.backgroundColor ?? '#fff'};
|
|
106
|
-
`;
|
|
102
|
+
`;
|
|
@@ -11,7 +11,8 @@ export const FacebookLogin = (props: any) => {
|
|
|
11
11
|
const {
|
|
12
12
|
handleErrors,
|
|
13
13
|
handleLoading,
|
|
14
|
-
handleSuccessFacebookLogin
|
|
14
|
+
handleSuccessFacebookLogin,
|
|
15
|
+
notificationState
|
|
15
16
|
} = props
|
|
16
17
|
|
|
17
18
|
const [, t] = useLanguage()
|
|
@@ -30,7 +31,14 @@ export const FacebookLogin = (props: any) => {
|
|
|
30
31
|
|
|
31
32
|
const handleLoginClick = async (accessToken: string) => {
|
|
32
33
|
try {
|
|
33
|
-
const
|
|
34
|
+
const body: any = {
|
|
35
|
+
access_token: accessToken
|
|
36
|
+
}
|
|
37
|
+
if (notificationState?.notification_token) {
|
|
38
|
+
body.notification_token = notificationState.notification_token
|
|
39
|
+
body.notification_app = notificationState.notification_app
|
|
40
|
+
}
|
|
41
|
+
const response = await ordering.users().authFacebook(body)
|
|
34
42
|
if (!response.content.error) {
|
|
35
43
|
if (handleSuccessFacebookLogin) {
|
|
36
44
|
handleSuccessFacebookLogin(response.content.result)
|
|
@@ -38,9 +46,10 @@ export const FacebookLogin = (props: any) => {
|
|
|
38
46
|
}
|
|
39
47
|
} else {
|
|
40
48
|
handleLoading && handleLoading(false)
|
|
49
|
+
handleErrors && handleErrors(response.content.result)
|
|
41
50
|
logoutWithFacebook()
|
|
42
51
|
}
|
|
43
|
-
} catch (err) {
|
|
52
|
+
} catch (err: any) {
|
|
44
53
|
handleLoading && handleLoading(false)
|
|
45
54
|
handleErrors && handleErrors(err.message)
|
|
46
55
|
}
|
|
@@ -48,7 +57,7 @@ export const FacebookLogin = (props: any) => {
|
|
|
48
57
|
|
|
49
58
|
const loginWithFacebook = () => {
|
|
50
59
|
handleLoading && handleLoading(true)
|
|
51
|
-
LoginManager && LoginManager.logInWithPermissions(['public_profile']).then(
|
|
60
|
+
LoginManager && LoginManager.logInWithPermissions(['public_profile', 'email']).then(
|
|
52
61
|
(login: any) => {
|
|
53
62
|
if (login.isCancelled) {
|
|
54
63
|
const err = t('LOGIN_WITH_FACEBOOK_CANCELLED', 'Login cancelled')
|
|
@@ -58,6 +67,9 @@ export const FacebookLogin = (props: any) => {
|
|
|
58
67
|
AccessToken.getCurrentAccessToken().then((data: any) => {
|
|
59
68
|
const accessToken = data.accessToken.toString();
|
|
60
69
|
handleLoginClick(accessToken)
|
|
70
|
+
}).catch((err : any) => {
|
|
71
|
+
handleErrors && handleErrors(err.message)
|
|
72
|
+
handleLoading && handleLoading(false)
|
|
61
73
|
});
|
|
62
74
|
}
|
|
63
75
|
},
|
|
@@ -68,7 +80,10 @@ export const FacebookLogin = (props: any) => {
|
|
|
68
80
|
handleLoading && handleLoading(false)
|
|
69
81
|
handleErrors && handleErrors(err)
|
|
70
82
|
},
|
|
71
|
-
)
|
|
83
|
+
).catch((err : any) => {
|
|
84
|
+
handleErrors && handleErrors(err.message)
|
|
85
|
+
handleLoading && handleLoading(false)
|
|
86
|
+
});
|
|
72
87
|
};
|
|
73
88
|
|
|
74
89
|
const onPressButton = auth
|
|
@@ -48,8 +48,8 @@ export const Help = (props: HelpParams) => {
|
|
|
48
48
|
|
|
49
49
|
<LastOrdersContainer>
|
|
50
50
|
<OText size={18} weight={600}>{t('LAST_ORDERS', 'Last Orders')}</OText>
|
|
51
|
-
<LastOrders
|
|
51
|
+
<LastOrders onRedirect={onRedirect} />
|
|
52
52
|
</LastOrdersContainer>
|
|
53
53
|
</>
|
|
54
54
|
)
|
|
55
|
-
}
|
|
55
|
+
}
|
|
@@ -5,11 +5,11 @@ import { StyleSheet, View } from 'react-native';
|
|
|
5
5
|
import { OButton, OIcon, OText } from '../shared';
|
|
6
6
|
import { LanguageSelector } from '../LanguageSelector';
|
|
7
7
|
import { TouchableOpacity } from 'react-native-gesture-handler';
|
|
8
|
-
import { useWindowDimensions } from 'react-native';
|
|
8
|
+
import { useWindowDimensions, Platform } from 'react-native';
|
|
9
9
|
|
|
10
10
|
export const Home = (props: any) => {
|
|
11
11
|
const { onNavigationRedirect } = props;
|
|
12
|
-
const { width } = useWindowDimensions();
|
|
12
|
+
const { width, height } = useWindowDimensions();
|
|
13
13
|
const [, t] = useLanguage();
|
|
14
14
|
const [orderState] = useOrder();
|
|
15
15
|
|
|
@@ -18,7 +18,9 @@ export const Home = (props: any) => {
|
|
|
18
18
|
return (
|
|
19
19
|
<View style={styles.container}>
|
|
20
20
|
<View>
|
|
21
|
-
<
|
|
21
|
+
<View style={{paddingTop: (height <= 756 && Platform.OS !== 'ios') ? (height * 0.05) : 0 }}>
|
|
22
|
+
<LanguageSelector />
|
|
23
|
+
</View>
|
|
22
24
|
<OIcon
|
|
23
25
|
src={theme.images.logos.logotypeInvert}
|
|
24
26
|
style={{
|
|
@@ -12,6 +12,34 @@ import { MessagesParams } from '../../types'
|
|
|
12
12
|
import { useWindowDimensions } from 'react-native'
|
|
13
13
|
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
14
14
|
|
|
15
|
+
const ORDER_STATUS: any = {
|
|
16
|
+
0: 'ORDER_STATUS_PENDING',
|
|
17
|
+
1: 'ORDERS_COMPLETED',
|
|
18
|
+
2: 'ORDER_REJECTED',
|
|
19
|
+
3: 'ORDER_STATUS_IN_BUSINESS',
|
|
20
|
+
4: 'ORDER_READY',
|
|
21
|
+
5: 'ORDER_REJECTED_RESTAURANT',
|
|
22
|
+
6: 'ORDER_STATUS_CANCELLEDBYDRIVER',
|
|
23
|
+
7: 'ORDER_STATUS_ACCEPTEDBYRESTAURANT',
|
|
24
|
+
8: 'ORDER_CONFIRMED_ACCEPTED_BY_DRIVER',
|
|
25
|
+
9: 'ORDER_PICKUP_COMPLETED_BY_DRIVER',
|
|
26
|
+
10: 'ORDER_PICKUP_FAILED_BY_DRIVER',
|
|
27
|
+
11: 'ORDER_DELIVERY_COMPLETED_BY_DRIVER',
|
|
28
|
+
12: 'ORDER_DELIVERY_FAILED_BY_DRIVER',
|
|
29
|
+
13: 'PREORDER',
|
|
30
|
+
14: 'ORDER_NOT_READY',
|
|
31
|
+
15: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
|
|
32
|
+
16: 'ORDER_STATUS_CANCELLED_BY_CUSTOMER',
|
|
33
|
+
17: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
|
|
34
|
+
18: 'ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS',
|
|
35
|
+
19: 'ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER',
|
|
36
|
+
20: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
|
|
37
|
+
21: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const filterSpecialStatus = ['prepared_in', 'delivered_in']
|
|
41
|
+
|
|
42
|
+
|
|
15
43
|
const MessagesUI = (props: MessagesParams) => {
|
|
16
44
|
const {
|
|
17
45
|
type,
|
|
@@ -94,58 +122,6 @@ const MessagesUI = (props: MessagesParams) => {
|
|
|
94
122
|
});
|
|
95
123
|
};
|
|
96
124
|
|
|
97
|
-
const getStatus = (status: number) => {
|
|
98
|
-
|
|
99
|
-
switch (status) {
|
|
100
|
-
case 0:
|
|
101
|
-
return 'ORDER_STATUS_PENDING'
|
|
102
|
-
case 1:
|
|
103
|
-
return 'ORDERS_COMPLETED'
|
|
104
|
-
case 2:
|
|
105
|
-
return 'ORDER_REJECTED'
|
|
106
|
-
case 3:
|
|
107
|
-
return 'ORDER_STATUS_IN_BUSINESS'
|
|
108
|
-
case 4:
|
|
109
|
-
return 'ORDER_READY'
|
|
110
|
-
case 5:
|
|
111
|
-
return 'ORDER_REJECTED_RESTAURANT'
|
|
112
|
-
case 6:
|
|
113
|
-
return 'ORDER_STATUS_CANCELLEDBYDRIVER'
|
|
114
|
-
case 7:
|
|
115
|
-
return 'ORDER_STATUS_ACCEPTEDBYRESTAURANT'
|
|
116
|
-
case 8:
|
|
117
|
-
return 'ORDER_CONFIRMED_ACCEPTED_BY_DRIVER'
|
|
118
|
-
case 9:
|
|
119
|
-
return 'ORDER_PICKUP_COMPLETED_BY_DRIVER'
|
|
120
|
-
case 10:
|
|
121
|
-
return 'ORDER_PICKUP_FAILED_BY_DRIVER'
|
|
122
|
-
case 11:
|
|
123
|
-
return 'ORDER_DELIVERY_COMPLETED_BY_DRIVER'
|
|
124
|
-
case 12:
|
|
125
|
-
return 'ORDER_DELIVERY_FAILED_BY_DRIVER'
|
|
126
|
-
case 13:
|
|
127
|
-
return 'PREORDER'
|
|
128
|
-
case 14:
|
|
129
|
-
return 'ORDER_NOT_READY'
|
|
130
|
-
case 15:
|
|
131
|
-
return 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER'
|
|
132
|
-
case 16:
|
|
133
|
-
return 'ORDER_STATUS_CANCELLED_BY_CUSTOMER'
|
|
134
|
-
case 17:
|
|
135
|
-
return 'ORDER_NOT_PICKEDUP_BY_CUSTOMER'
|
|
136
|
-
case 18:
|
|
137
|
-
return 'ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS'
|
|
138
|
-
case 19:
|
|
139
|
-
return 'ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER'
|
|
140
|
-
case 20:
|
|
141
|
-
return 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS'
|
|
142
|
-
case 21:
|
|
143
|
-
return 'ORDER_CUSTOMER_ARRIVED_BUSINESS'
|
|
144
|
-
default:
|
|
145
|
-
return status
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
125
|
const onSubmit = (values: any) => {
|
|
150
126
|
handleSend && handleSend()
|
|
151
127
|
setImage && setImage(null)
|
|
@@ -154,14 +130,18 @@ const MessagesUI = (props: MessagesParams) => {
|
|
|
154
130
|
|
|
155
131
|
const messageConsole = (message: any) => {
|
|
156
132
|
return message.change?.attribute !== 'driver_id'
|
|
133
|
+
?
|
|
134
|
+
`${t('ORDER', 'Order')} ${t(message.change.attribute.toUpperCase(), message.change.attribute.replace('_', ' '))} ${t('CHANGED_FROM', 'Changed from')} ${
|
|
135
|
+
filterSpecialStatus.includes(message.change.attribute) ?
|
|
136
|
+
`${message.change.old === null ? '0' : message.change.old} ${t('TO', 'to')} ${message.change.new} ${t('MINUTES', 'Minutes')}` :
|
|
137
|
+
`${message.change.old !== null && t(ORDER_STATUS[parseInt(message.change.old, 10)])} ${t('TO', 'to')} ${t(ORDER_STATUS[parseInt(message.change.new, 10)])}`
|
|
138
|
+
}`
|
|
139
|
+
: message.change.new
|
|
157
140
|
?
|
|
158
|
-
`${
|
|
159
|
-
:
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
:
|
|
163
|
-
`${t('DRIVER_UNASSIGNED', 'Driver unassigned')}`
|
|
164
|
-
}
|
|
141
|
+
`${message.driver?.name} ${message.driver?.lastname !== null ? message.driver.lastname : ''} ${t('WAS_ASSIGNED_AS_DRIVER', 'Was assigned as driver')} ${message.comment ? message.comment.length : ''}`
|
|
142
|
+
:
|
|
143
|
+
`${t('DRIVER_UNASSIGNED', 'Driver unassigned')}`
|
|
144
|
+
}
|
|
165
145
|
|
|
166
146
|
useEffect(() => {
|
|
167
147
|
let newMessages: Array<any> = []
|
|
@@ -104,15 +104,6 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
104
104
|
|
|
105
105
|
const { order, businessData } = props.order;
|
|
106
106
|
|
|
107
|
-
const walletName: any = {
|
|
108
|
-
cash: {
|
|
109
|
-
name: t('PAY_WITH_CASH_WALLET', 'Pay with Cash Wallet'),
|
|
110
|
-
},
|
|
111
|
-
credit_point: {
|
|
112
|
-
name: t('PAY_WITH_CREDITS_POINTS_WALLET', 'Pay with Credit Points Wallet'),
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
107
|
const getOrderStatus = (s: string) => {
|
|
117
108
|
const status = parseInt(s);
|
|
118
109
|
const orderStatus = [
|
|
@@ -611,7 +602,9 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
611
602
|
<OText size={16} style={{ textAlign: 'left' }} color={theme.colors.textNormal}>
|
|
612
603
|
{t('DELIVERY_PREFERENCE', 'Delivery Preference')}
|
|
613
604
|
</OText>
|
|
614
|
-
<OText size={12} style={{ textAlign: 'left' }} color={theme.colors.textNormal}>
|
|
605
|
+
<OText size={12} style={{ textAlign: 'left' }} color={theme.colors.textNormal}>
|
|
606
|
+
{order?.delivery_option?.name ? t(order?.delivery_option?.name.toUpperCase().replace(/\s/g, '_')) : t('EITHER_WAY', 'Either way')}
|
|
607
|
+
</OText>
|
|
615
608
|
</View>
|
|
616
609
|
)}
|
|
617
610
|
{order?.comment && (
|
|
@@ -835,51 +828,6 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
835
828
|
</OText>
|
|
836
829
|
</Table>
|
|
837
830
|
</Total>
|
|
838
|
-
{order?.payment_events?.length > 0 && (
|
|
839
|
-
<View style={{marginTop: 10}}>
|
|
840
|
-
<OText size={20} weight='bold' color={theme.colors.textNormal}>{t('PAYMENTS', 'Payments')}</OText>
|
|
841
|
-
<View
|
|
842
|
-
style={{
|
|
843
|
-
width: '100%',
|
|
844
|
-
marginTop: 10
|
|
845
|
-
}}
|
|
846
|
-
>
|
|
847
|
-
{order?.payment_events?.map((event: any) => (
|
|
848
|
-
<View
|
|
849
|
-
key={event.id}
|
|
850
|
-
style={{
|
|
851
|
-
display: 'flex',
|
|
852
|
-
flexDirection: 'row',
|
|
853
|
-
justifyContent: 'space-between',
|
|
854
|
-
alignItems: 'center',
|
|
855
|
-
marginBottom: 10
|
|
856
|
-
}}
|
|
857
|
-
>
|
|
858
|
-
<View
|
|
859
|
-
style={{
|
|
860
|
-
display: 'flex',
|
|
861
|
-
flexDirection: 'column',
|
|
862
|
-
}}
|
|
863
|
-
>
|
|
864
|
-
<OText>
|
|
865
|
-
{event?.wallet_event
|
|
866
|
-
? walletName[event?.wallet_event?.wallet?.type]?.name
|
|
867
|
-
: event?.paymethod?.name}
|
|
868
|
-
</OText>
|
|
869
|
-
{event?.data?.charge_id && (
|
|
870
|
-
<OText>
|
|
871
|
-
{`${t('CODE', 'Code')}: ${event?.data?.charge_id}`}
|
|
872
|
-
</OText>
|
|
873
|
-
)}
|
|
874
|
-
</View>
|
|
875
|
-
<OText>
|
|
876
|
-
-{parsePrice(event.amount)}
|
|
877
|
-
</OText>
|
|
878
|
-
</View>
|
|
879
|
-
))}
|
|
880
|
-
</View>
|
|
881
|
-
</View>
|
|
882
|
-
)}
|
|
883
831
|
</OrderBill>
|
|
884
832
|
</OrderContent>
|
|
885
833
|
</>
|
|
@@ -894,6 +842,8 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
894
842
|
orderId={order?.id}
|
|
895
843
|
messages={messages}
|
|
896
844
|
order={order}
|
|
845
|
+
business={openModalForBusiness}
|
|
846
|
+
driver={openModalForDriver}
|
|
897
847
|
setMessages={setMessages}
|
|
898
848
|
onClose={handleCloseModal}
|
|
899
849
|
/>
|
|
@@ -193,13 +193,13 @@ const OrderProgressUI = (props: any) => {
|
|
|
193
193
|
</View>
|
|
194
194
|
</View>
|
|
195
195
|
)}
|
|
196
|
-
{
|
|
196
|
+
{!orderList?.loading && orderList?.orders?.length === 0 && (
|
|
197
197
|
<NotFoundSource
|
|
198
198
|
image={imageFails}
|
|
199
199
|
content={t('NO_RESULTS_FOUND', 'Sorry, no results found')}
|
|
200
200
|
conditioned
|
|
201
201
|
/>
|
|
202
|
-
)}
|
|
202
|
+
)}
|
|
203
203
|
</>
|
|
204
204
|
)
|
|
205
205
|
}
|
|
@@ -28,6 +28,7 @@ import { TouchableOpacity } from 'react-native';
|
|
|
28
28
|
|
|
29
29
|
const OrderSummaryUI = (props: any) => {
|
|
30
30
|
const {
|
|
31
|
+
cart,
|
|
31
32
|
changeQuantity,
|
|
32
33
|
getProductMax,
|
|
33
34
|
offsetDisabled,
|
|
@@ -75,16 +76,6 @@ const OrderSummaryUI = (props: any) => {
|
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
const cart = orderState?.carts?.[`businessId:${props.cart.business_id}`]
|
|
79
|
-
|
|
80
|
-
const walletName: any = {
|
|
81
|
-
cash: {
|
|
82
|
-
name: t('PAY_WITH_CASH_WALLET', 'Pay with Cash Wallet'),
|
|
83
|
-
},
|
|
84
|
-
credit_point: {
|
|
85
|
-
name: t('PAY_WITH_CREDITS_POINTS_WALLET', 'Pay with Credit Points Wallet'),
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
79
|
|
|
89
80
|
return (
|
|
90
81
|
<OSContainer>
|
|
@@ -177,14 +168,6 @@ const OrderSummaryUI = (props: any) => {
|
|
|
177
168
|
<OText size={12}>{parsePrice(cart?.driver_tip)}</OText>
|
|
178
169
|
</OSTable>
|
|
179
170
|
)}
|
|
180
|
-
{cart?.payment_events?.length > 0 && cart?.payment_events?.map((event: any) => (
|
|
181
|
-
<OSTable key={event.id}>
|
|
182
|
-
<OText size={12} numberOfLines={1}>
|
|
183
|
-
{walletName[cart?.wallets?.find((wallet: any) => wallet.id === event.wallet_id)?.type]?.name}
|
|
184
|
-
</OText>
|
|
185
|
-
<OText size={12}>-{parsePrice(event.amount)}</OText>
|
|
186
|
-
</OSTable>
|
|
187
|
-
))}
|
|
188
171
|
{isCouponEnabled && !isCartPending && (
|
|
189
172
|
<View>
|
|
190
173
|
<View style={{ paddingVertical: 5 }}>
|
|
@@ -202,7 +185,7 @@ const OrderSummaryUI = (props: any) => {
|
|
|
202
185
|
{t('TOTAL', 'Total')}
|
|
203
186
|
</OText>
|
|
204
187
|
<OText size={14} style={{ fontWeight: 'bold' }} >
|
|
205
|
-
{parsePrice(cart?.
|
|
188
|
+
{parsePrice(cart?.total)}
|
|
206
189
|
</OText>
|
|
207
190
|
</OSTable>
|
|
208
191
|
</View>
|
|
@@ -222,8 +205,7 @@ const OrderSummaryUI = (props: any) => {
|
|
|
222
205
|
height: 100,
|
|
223
206
|
borderColor: theme.colors.border,
|
|
224
207
|
paddingRight: 50,
|
|
225
|
-
marginTop: 10
|
|
226
|
-
borderRadius: 8
|
|
208
|
+
marginTop: 10
|
|
227
209
|
}}
|
|
228
210
|
multiline
|
|
229
211
|
/>
|
|
@@ -380,13 +380,30 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
380
380
|
</Placeholder>
|
|
381
381
|
) : (
|
|
382
382
|
<>
|
|
383
|
-
<
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
383
|
+
<View style={{ flexDirection: 'row' }}>
|
|
384
|
+
<OText
|
|
385
|
+
size={20}
|
|
386
|
+
lineHeight={30}
|
|
387
|
+
weight={'600'}
|
|
388
|
+
style={{ flex: 1, marginBottom: 10 }}>
|
|
389
|
+
{product?.name || productCart.name}
|
|
390
|
+
</OText>
|
|
391
|
+
{product?.calories && (
|
|
392
|
+
<OText size={16} style={{ color: '#808080' }}>{product?.calories} cal
|
|
393
|
+
</OText>
|
|
394
|
+
)}
|
|
395
|
+
</View>
|
|
396
|
+
<View style={{ flexDirection: 'row', marginBottom: 10 }}>
|
|
397
|
+
<OText size={16} style={{ flex: I18nManager.isRTL ? 1 : 0 }} color={theme.colors.primary}>{productCart.price ? parsePrice(productCart.price) : ''}</OText>
|
|
398
|
+
{product?.offer_price && (
|
|
399
|
+
<OText style={{ fontSize: 14,
|
|
400
|
+
color: '#808080',
|
|
401
|
+
textDecorationLine: 'line-through',
|
|
402
|
+
marginLeft: 7,
|
|
403
|
+
marginRight: 7
|
|
404
|
+
}}>{parsePrice(product?.offer_price)}</OText>
|
|
405
|
+
)}
|
|
406
|
+
</View>
|
|
390
407
|
{((product?.sku && product?.sku !== '-1' && product?.sku !== '1') || (product?.estimated_person)) && (
|
|
391
408
|
<OText size={14} style={{ flex: I18nManager.isRTL ? 1 : 0 }} color={'#909BA9'} mBottom={7}>
|
|
392
409
|
{
|
|
@@ -663,27 +680,25 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
663
680
|
)}
|
|
664
681
|
</>
|
|
665
682
|
)}
|
|
666
|
-
|
|
667
|
-
<
|
|
668
|
-
<
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
</ProductComment>
|
|
686
|
-
)}
|
|
683
|
+
<ProductComment>
|
|
684
|
+
<SectionTitle>
|
|
685
|
+
<OText size={16} weight={'600'} lineHeight={24}>
|
|
686
|
+
{t('SPECIAL_COMMENT', 'Special comment')}
|
|
687
|
+
</OText>
|
|
688
|
+
</SectionTitle>
|
|
689
|
+
<OInput
|
|
690
|
+
multiline
|
|
691
|
+
placeholder={t('SPECIAL_COMMENT', 'Special comment')}
|
|
692
|
+
value={productCart.comment}
|
|
693
|
+
onChange={(val: string) =>
|
|
694
|
+
handleChangeCommentState({ target: { value: val } })
|
|
695
|
+
}
|
|
696
|
+
isDisabled={
|
|
697
|
+
!(productCart && !isSoldOut && maxProductQuantity)
|
|
698
|
+
}
|
|
699
|
+
style={styles.comment}
|
|
700
|
+
/>
|
|
701
|
+
</ProductComment>
|
|
687
702
|
</ProductEditions>
|
|
688
703
|
)}
|
|
689
704
|
</WrapContent>
|
|
@@ -14,7 +14,6 @@ import { ProfileParams } from '../../types';
|
|
|
14
14
|
import { LogoutButton } from '../LogoutButton'
|
|
15
15
|
import { LanguageSelector } from '../LanguageSelector'
|
|
16
16
|
import MessageCircle from 'react-native-vector-icons/AntDesign'
|
|
17
|
-
import Ionicons from 'react-native-vector-icons/Ionicons'
|
|
18
17
|
|
|
19
18
|
import {
|
|
20
19
|
OIcon,
|
|
@@ -161,10 +160,6 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
161
160
|
<MessageCircle name='message1' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
162
161
|
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('MESSAGES', 'Messages')}</OText>
|
|
163
162
|
</ListItem>
|
|
164
|
-
<ListItem onPress={() => onRedirect('Wallets', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
165
|
-
<Ionicons name='wallet-outline' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
166
|
-
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('WALLETS', 'Wallets')}</OText>
|
|
167
|
-
</ListItem>
|
|
168
163
|
<ListItem onPress={() => navigation.navigate('Help', {})} activeOpacity={0.7}>
|
|
169
164
|
<OIcon src={theme.images.general.ic_help} width={16} color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
|
|
170
165
|
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('HELP', 'Help')}</OText>
|
|
@@ -129,7 +129,6 @@ export interface BusinessesListingParams {
|
|
|
129
129
|
businessTypes?: any;
|
|
130
130
|
defaultBusinessType?: any;
|
|
131
131
|
franchiseId?: any;
|
|
132
|
-
businessId?: any;
|
|
133
132
|
}
|
|
134
133
|
export interface HighestRatedBusinessesParams {
|
|
135
134
|
businessesList: { businesses: Array<any>, loading: boolean, error: null | string };
|
|
@@ -345,8 +344,8 @@ export interface MessagesParams {
|
|
|
345
344
|
onClose?: () => void,
|
|
346
345
|
isMeesageListing?: boolean,
|
|
347
346
|
setCanRead?: any,
|
|
348
|
-
business
|
|
349
|
-
driver
|
|
347
|
+
business: boolean,
|
|
348
|
+
driver: boolean,
|
|
350
349
|
onMessages?: any
|
|
351
350
|
}
|
|
352
351
|
export interface ViewInterface {
|
|
@@ -456,7 +455,6 @@ export interface GoogleMapsParams {
|
|
|
456
455
|
|
|
457
456
|
export interface HelpParams {
|
|
458
457
|
navigation: any;
|
|
459
|
-
businessId?: any;
|
|
460
458
|
}
|
|
461
459
|
|
|
462
460
|
export interface LastOrdersParams {
|
|
@@ -527,35 +527,34 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
527
527
|
);
|
|
528
528
|
}))}
|
|
529
529
|
</View>
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
)}
|
|
530
|
+
|
|
531
|
+
<ProductComment>
|
|
532
|
+
<SectionTitle>
|
|
533
|
+
<OText size={16} weight={'600'} lineHeight={24}>
|
|
534
|
+
{t('SPECIAL_COMMENT', 'Special comment')}
|
|
535
|
+
</OText>
|
|
536
|
+
</SectionTitle>
|
|
537
|
+
<OInput
|
|
538
|
+
multiline={true}
|
|
539
|
+
numberOfLines={10}
|
|
540
|
+
placeholder={t('SPECIAL_COMMENT', 'Special comment')}
|
|
541
|
+
value={productCart.comment}
|
|
542
|
+
onChange={(val: string) =>
|
|
543
|
+
handleChangeCommentState({ target: { value: val } })
|
|
544
|
+
}
|
|
545
|
+
isDisabled={
|
|
546
|
+
!(productCart && !isSoldOut && maxProductQuantity)
|
|
547
|
+
}
|
|
548
|
+
style={{
|
|
549
|
+
height: 100,
|
|
550
|
+
justifyContent: "flex-end",
|
|
551
|
+
alignItems: 'flex-start',
|
|
552
|
+
borderWidth: 1,
|
|
553
|
+
borderRadius: 8,
|
|
554
|
+
borderColor: theme.colors.border,
|
|
555
|
+
}}
|
|
556
|
+
/>
|
|
557
|
+
</ProductComment>
|
|
559
558
|
</ProductEditions>
|
|
560
559
|
)}
|
|
561
560
|
</WrapContent>
|