ordering-ui-react-native 0.15.41 → 0.15.43-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 +43 -1
- package/src/components/AddressForm/index.tsx +18 -2
- package/src/components/BusinessController/index.tsx +8 -2
- package/src/components/BusinessTypeFilter/index.tsx +4 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +23 -2
- package/src/components/DriverTips/index.tsx +11 -6
- package/src/components/LanguageSelector/index.tsx +7 -2
- package/src/components/LoginForm/index.tsx +3 -1
- package/src/components/OrderDetails/index.tsx +2 -2
- package/src/components/PaymentOptions/index.tsx +1 -1
- package/src/components/PaymentOptionsWebView/index.tsx +123 -124
- package/src/components/SignupForm/index.tsx +3 -1
- package/src/components/SingleProductCard/index.tsx +16 -4
- package/src/components/StripeMethodForm/index.tsx +1 -2
- package/src/components/UpsellingProducts/index.tsx +1 -1
- package/src/components/UserProfileForm/index.tsx +63 -6
- package/src/components/UserProfileForm/styles.tsx +8 -0
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OModal.tsx +1 -1
- package/src/hooks/useCountdownTimer.tsx +26 -0
- package/src/navigators/CheckoutNavigator.tsx +6 -0
- package/src/navigators/HomeNavigator.tsx +12 -0
- package/src/pages/BusinessProductsList.tsx +1 -0
- package/src/pages/BusinessesListing.tsx +1 -1
- package/src/pages/MultiCheckout.tsx +31 -0
- package/src/pages/MultiOrdersDetails.tsx +27 -0
- package/src/pages/Sessions.tsx +22 -0
- package/src/theme.json +0 -1
- package/src/types/index.tsx +5 -2
- package/src/utils/index.tsx +68 -1
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +103 -15
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -0
- package/themes/business/src/components/Chat/index.tsx +38 -86
- package/themes/business/src/components/DriverMap/index.tsx +6 -5
- package/themes/business/src/components/Home/index.tsx +128 -55
- package/themes/business/src/components/Home/styles.tsx +8 -1
- package/themes/business/src/components/LoginForm/index.tsx +89 -2
- package/themes/business/src/components/LoginForm/styles.tsx +6 -0
- package/themes/business/src/components/LogoutButton/index.tsx +1 -1
- package/themes/business/src/components/NewOrderNotification/index.tsx +79 -105
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
- package/themes/business/src/components/OrderDetails/Delivery.tsx +35 -18
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +157 -89
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +6 -0
- package/themes/business/src/components/OrderDetails/styles.tsx +7 -0
- package/themes/business/src/components/OrdersListManager/index.tsx +52 -49
- package/themes/business/src/components/OrdersOption/index.tsx +57 -50
- package/themes/business/src/components/PreviousOrders/index.tsx +50 -14
- package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
- package/themes/business/src/components/shared/OModal.tsx +1 -1
- package/themes/business/src/types/index.tsx +5 -1
- 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/BusinessMenu/index.tsx +39 -28
- package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -3
- package/themes/kiosk/src/components/Cart/index.tsx +99 -26
- package/themes/kiosk/src/components/Cart/styles.tsx +6 -0
- package/themes/kiosk/src/components/CartBottomSheet/index.tsx +9 -2
- package/themes/kiosk/src/components/CartContent/index.tsx +0 -11
- package/themes/kiosk/src/components/CartItem/index.tsx +4 -3
- package/themes/kiosk/src/components/CategoriesMenu/index.tsx +107 -62
- package/themes/kiosk/src/components/Checkout/index.tsx +40 -22
- package/themes/kiosk/src/components/CustomerName/index.tsx +0 -6
- package/themes/kiosk/src/components/DrawerView/index.tsx +1 -0
- package/themes/kiosk/src/components/DrawerView/styles.tsx +2 -2
- package/themes/kiosk/src/components/NavBar/index.tsx +29 -20
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderDetails/index.tsx +165 -65
- package/themes/kiosk/src/components/OrderDetails/styles.tsx +5 -0
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +9 -11
- package/themes/kiosk/src/components/PaymentOptions/index.tsx +56 -54
- package/themes/kiosk/src/components/ProductForm/index.tsx +8 -9
- package/themes/kiosk/src/components/ProductItemAccordion/index.tsx +2 -2
- package/themes/kiosk/src/components/ProductOption/index.tsx +1 -1
- package/themes/kiosk/src/components/ProductOptionSubOption/index.tsx +3 -1
- package/themes/kiosk/src/components/UpsellingProducts/index.tsx +16 -5
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/types/index.d.ts +3 -0
- package/themes/original/index.tsx +180 -3
- package/themes/original/src/components/ActiveOrders/index.tsx +15 -132
- package/themes/original/src/components/ActiveOrders/styles.tsx +0 -54
- package/themes/original/src/components/AddressForm/index.tsx +1 -1
- package/themes/original/src/components/AddressList/index.tsx +30 -18
- package/themes/original/src/components/AppleLogin/index.tsx +117 -78
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +96 -45
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +28 -1
- package/themes/original/src/components/BusinessController/index.tsx +50 -12
- package/themes/original/src/components/BusinessController/styles.tsx +27 -0
- package/themes/original/src/components/BusinessFeaturedController/index.tsx +20 -1
- package/themes/original/src/components/BusinessFeaturedController/styles.tsx +23 -0
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +8 -5
- package/themes/original/src/components/BusinessItemAccordion/styles.tsx +3 -1
- package/themes/original/src/components/BusinessListingSearch/index.tsx +196 -58
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +22 -2
- package/themes/original/src/components/BusinessPreorder/index.tsx +2 -2
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +8 -6
- package/themes/original/src/components/BusinessProductsList/CategoryDescription/index.tsx +44 -0
- package/themes/original/src/components/BusinessProductsList/index.tsx +139 -36
- package/themes/original/src/components/BusinessProductsList/styles.tsx +29 -2
- package/themes/original/src/components/BusinessProductsListing/index.tsx +116 -26
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +22 -0
- package/themes/original/src/components/BusinessReviews/index.tsx +4 -25
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +1 -2
- package/themes/original/src/components/BusinessesListing/index.tsx +127 -66
- package/themes/original/src/components/BusinessesListing/styles.tsx +11 -3
- package/themes/original/src/components/Cart/index.tsx +60 -43
- package/themes/original/src/components/Checkout/index.tsx +50 -33
- package/themes/original/src/components/DriverTips/index.tsx +17 -12
- package/themes/original/src/components/Favorite/index.tsx +91 -0
- package/themes/original/src/components/Favorite/styles.tsx +22 -0
- package/themes/original/src/components/FavoriteList/index.tsx +287 -0
- package/themes/original/src/components/FavoriteList/styles.tsx +5 -0
- package/themes/original/src/components/ForgotPasswordForm/index.tsx +84 -4
- package/themes/original/src/components/GPSButton/index.tsx +15 -8
- package/themes/original/src/components/GoogleMap/index.tsx +1 -0
- package/themes/original/src/components/Help/index.tsx +21 -4
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +18 -1
- package/themes/original/src/components/Home/index.tsx +1 -1
- package/themes/original/src/components/LastOrders/index.tsx +12 -1
- package/themes/original/src/components/LoginForm/Otp/index.tsx +90 -0
- package/themes/original/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/original/src/components/LoginForm/index.tsx +394 -155
- package/themes/original/src/components/LoginForm/styles.tsx +7 -4
- package/themes/original/src/components/LogoutButton/index.tsx +7 -1
- package/themes/original/src/components/MessageListing/index.tsx +10 -1
- package/themes/original/src/components/Messages/index.tsx +1 -1
- package/themes/original/src/components/MomentOption/index.tsx +10 -1
- package/themes/original/src/components/MomentOption/styles.tsx +1 -1
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +243 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/styles.tsx +46 -0
- package/themes/original/src/components/MultiCheckout/index.tsx +298 -0
- package/themes/original/src/components/MultiCheckout/styles.tsx +59 -0
- package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +372 -0
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +258 -0
- package/themes/original/src/components/MultiOrdersDetails/styles.tsx +50 -0
- package/themes/original/src/components/MyOrders/index.tsx +120 -32
- package/themes/original/src/components/MyOrders/styles.tsx +8 -1
- package/themes/original/src/components/OrderDetails/index.tsx +55 -37
- package/themes/original/src/components/OrderDetails/styles.tsx +1 -2
- package/themes/original/src/components/OrderProgress/index.tsx +3 -3
- package/themes/original/src/components/OrderProgress/styles.tsx +1 -0
- package/themes/original/src/components/OrderSummary/index.tsx +3 -3
- package/themes/original/src/components/OrderTypeSelector/index.tsx +4 -2
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +153 -0
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +6 -0
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +53 -0
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +6 -0
- package/themes/original/src/components/OrdersOption/index.tsx +133 -41
- package/themes/original/src/components/OrdersOption/styles.tsx +4 -7
- package/themes/original/src/components/PaymentOptionCash/index.tsx +2 -2
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +22 -24
- package/themes/original/src/components/PaymentOptionWallet/styles.tsx +1 -1
- package/themes/original/src/components/PaymentOptions/index.tsx +19 -15
- package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
- package/themes/original/src/components/PreviousOrders/index.tsx +18 -145
- package/themes/original/src/components/ProductForm/index.tsx +74 -66
- package/themes/original/src/components/ProductForm/styles.tsx +0 -1
- package/themes/original/src/components/ProductItemAccordion/index.tsx +2 -2
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -12
- package/themes/original/src/components/Promotions/index.tsx +250 -0
- package/themes/original/src/components/Promotions/styles.tsx +60 -0
- package/themes/original/src/components/SearchBar/index.tsx +10 -4
- package/themes/original/src/components/Sessions/index.tsx +160 -0
- package/themes/original/src/components/Sessions/styles.tsx +15 -0
- package/themes/original/src/components/SignupForm/index.tsx +79 -6
- package/themes/original/src/components/SingleOrderCard/index.tsx +282 -0
- package/themes/original/src/components/SingleOrderCard/styles.tsx +54 -0
- package/themes/original/src/components/SingleProductCard/index.tsx +95 -32
- package/themes/original/src/components/SingleProductCard/styles.tsx +28 -1
- package/themes/original/src/components/StripeElementsForm/index.tsx +10 -2
- package/themes/original/src/components/StripeElementsForm/naked.tsx +2 -2
- package/themes/original/src/components/TaxInformation/index.tsx +10 -4
- package/themes/original/src/components/UpsellingProducts/index.tsx +86 -74
- package/themes/original/src/components/UserDetails/index.tsx +5 -96
- package/themes/original/src/components/UserFormDetails/index.tsx +34 -24
- package/themes/original/src/components/UserProfile/index.tsx +59 -5
- package/themes/original/src/components/UserProfileForm/index.tsx +20 -18
- package/themes/original/src/components/UserVerification/index.tsx +178 -192
- 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/Wallets/index.tsx +76 -9
- package/themes/original/src/components/Wallets/styles.tsx +21 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +2 -1
- package/themes/original/src/components/shared/OModal.tsx +4 -2
- package/themes/original/src/config/constants.tsx +6 -6
- package/themes/original/src/types/index.tsx +132 -9
- package/themes/original/src/utils/index.tsx +28 -2
- package/themes/single-business/src/components/AddressList/index.tsx +1 -1
- package/themes/single-business/src/components/OrderTypeSelector/index.tsx +1 -1
- package/themes/single-business/src/components/UserProfile/index.tsx +1 -1
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -115,6 +115,8 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
115
115
|
const phoneRef = useRef<any>(null)
|
|
116
116
|
const passwordRef = useRef<any>(null)
|
|
117
117
|
|
|
118
|
+
const googleLoginEnabled = configs?.google_login_enabled?.value === '1' || !configs?.google_login_enabled?.enabled
|
|
119
|
+
|
|
118
120
|
const anySocialButtonActivated = ((configs?.facebook_login?.value === 'true' || configs?.facebook_login?.value === '1') && configs?.facebook_id?.value) ||
|
|
119
121
|
(configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) ||
|
|
120
122
|
(configs?.apple_login_client_id?.value !== '' && configs?.apple_login_client_id?.value !== null)
|
|
@@ -543,7 +545,7 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
543
545
|
handleSuccessFacebookLogin={handleSuccessFacebook}
|
|
544
546
|
/>
|
|
545
547
|
)}
|
|
546
|
-
{(configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) && (
|
|
548
|
+
{(configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) && googleLoginEnabled && (
|
|
547
549
|
<GoogleLogin
|
|
548
550
|
notificationState={notificationState}
|
|
549
551
|
webClientId={configs?.google_login_client_id?.value}
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
import { StyleSheet } from 'react-native'
|
|
11
11
|
import { OText, OIcon } from '../shared'
|
|
12
12
|
import { useTheme } from 'styled-components/native'
|
|
13
|
+
import FastImage from 'react-native-fast-image'
|
|
13
14
|
|
|
14
15
|
export const SingleProductCard = (props: SingleProductCardParams) => {
|
|
15
16
|
const {
|
|
@@ -77,10 +78,21 @@ export const SingleProductCard = (props: SingleProductCardParams) => {
|
|
|
77
78
|
activeOpacity={1}
|
|
78
79
|
onPress={() => onProductClick?.(product)}
|
|
79
80
|
>
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
{product?.images ? (
|
|
82
|
+
<FastImage
|
|
83
|
+
style={styles.productStyle}
|
|
84
|
+
source={{
|
|
85
|
+
uri: optimizeImage(product?.images, 'h_250,c_limit'),
|
|
86
|
+
priority: FastImage.priority.normal,
|
|
87
|
+
}}
|
|
88
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
89
|
+
/>
|
|
90
|
+
) : (
|
|
91
|
+
<OIcon
|
|
92
|
+
src={theme?.images?.dummies?.product}
|
|
93
|
+
style={styles.productStyle}
|
|
94
|
+
/>
|
|
95
|
+
)}
|
|
84
96
|
<CardInfo>
|
|
85
97
|
<OText numberOfLines={1} ellipsizeMode='tail' style={styles.textStyle}>{product?.name}</OText>
|
|
86
98
|
<OText size={12} numberOfLines={2} ellipsizeMode='tail' style={styles.textStyle}>{product?.description}</OText>
|
|
@@ -102,7 +102,7 @@ export const StripeMethodForm = (props: StripeMethodFormParams) => {
|
|
|
102
102
|
shippingMethods: [
|
|
103
103
|
{
|
|
104
104
|
amount: cart?.balance?.toString() ?? cart?.total?.toString?.(),
|
|
105
|
-
identifier: '
|
|
105
|
+
identifier: 'standard',
|
|
106
106
|
label: 'Courier',
|
|
107
107
|
detail: 'Delivery',
|
|
108
108
|
type: 'final',
|
|
@@ -125,7 +125,6 @@ export const StripeMethodForm = (props: StripeMethodFormParams) => {
|
|
|
125
125
|
last4: paymentMethod.Card.last4
|
|
126
126
|
}
|
|
127
127
|
})
|
|
128
|
-
onCancel()
|
|
129
128
|
}
|
|
130
129
|
}
|
|
131
130
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import {
|
|
3
|
+
UserFormDetails as UserProfileController,
|
|
3
4
|
useSession,
|
|
4
5
|
useLanguage,
|
|
5
6
|
} from 'ordering-components/native';
|
|
@@ -13,6 +14,7 @@ import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityI
|
|
|
13
14
|
import Ionicons from 'react-native-vector-icons/Ionicons'
|
|
14
15
|
|
|
15
16
|
import {
|
|
17
|
+
OAlert,
|
|
16
18
|
OIcon,
|
|
17
19
|
OText
|
|
18
20
|
} from '../shared';
|
|
@@ -20,18 +22,24 @@ import {
|
|
|
20
22
|
Container,
|
|
21
23
|
Names,
|
|
22
24
|
UserInfoContainer,
|
|
23
|
-
LanguageContainer
|
|
25
|
+
LanguageContainer,
|
|
26
|
+
RemoveAccountContainer
|
|
24
27
|
} from './styles';
|
|
25
28
|
|
|
26
|
-
export const
|
|
29
|
+
export const UserProfileFormUI = (props: ProfileParams) => {
|
|
27
30
|
const {
|
|
28
|
-
navigation
|
|
31
|
+
navigation,
|
|
32
|
+
handleRemoveAccount,
|
|
33
|
+
removeAccountState
|
|
29
34
|
} = props;
|
|
30
35
|
|
|
31
36
|
const theme = useTheme();
|
|
32
|
-
const [{ user }] = useSession();
|
|
37
|
+
const [{ user }, { logout }] = useSession();
|
|
33
38
|
const [, t] = useLanguage();
|
|
34
39
|
|
|
40
|
+
const isAdmin = user?.level === 0
|
|
41
|
+
const [confirm, setConfirm] = useState<any>({ open: false, content: null, handleOnAccept: null, id: null, title: null })
|
|
42
|
+
|
|
35
43
|
const styles = StyleSheet.create({
|
|
36
44
|
linkStyle: {
|
|
37
45
|
color: theme.colors.primary,
|
|
@@ -44,6 +52,9 @@ export const UserProfileForm = (props: ProfileParams) => {
|
|
|
44
52
|
},
|
|
45
53
|
iconStyle: {
|
|
46
54
|
fontSize: 24
|
|
55
|
+
},
|
|
56
|
+
removeAccount: {
|
|
57
|
+
flexDirection: 'row'
|
|
47
58
|
}
|
|
48
59
|
});
|
|
49
60
|
|
|
@@ -78,13 +89,31 @@ export const UserProfileForm = (props: ProfileParams) => {
|
|
|
78
89
|
},
|
|
79
90
|
chevronUp: {
|
|
80
91
|
display: 'none'
|
|
81
|
-
}
|
|
92
|
+
},
|
|
82
93
|
})
|
|
83
94
|
|
|
84
95
|
const onRedirect = (route: string, params?: any) => {
|
|
85
96
|
navigation.navigate(route, params)
|
|
86
97
|
}
|
|
87
98
|
|
|
99
|
+
const onRemoveAccount = () => {
|
|
100
|
+
setConfirm({
|
|
101
|
+
open: true,
|
|
102
|
+
content: [t('QUESTION_REMOVE_ACCOUNT', 'Are you sure that you want to remove your account?')],
|
|
103
|
+
title: t('ACCOUNT_ALERT', 'Account alert'),
|
|
104
|
+
handleOnAccept: () => {
|
|
105
|
+
setConfirm({ ...confirm, open: false })
|
|
106
|
+
handleRemoveAccount && handleRemoveAccount(user?.id)
|
|
107
|
+
}
|
|
108
|
+
})
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
if (removeAccountState?.result === 'OK') {
|
|
113
|
+
logout()
|
|
114
|
+
}
|
|
115
|
+
}, [removeAccountState])
|
|
116
|
+
|
|
88
117
|
return (
|
|
89
118
|
<Container>
|
|
90
119
|
<View>
|
|
@@ -134,7 +163,35 @@ export const UserProfileForm = (props: ProfileParams) => {
|
|
|
134
163
|
<LanguageSelector pickerStyle={_pickerStyle} />
|
|
135
164
|
</LanguageContainer>
|
|
136
165
|
<LogoutButton />
|
|
166
|
+
<RemoveAccountContainer>
|
|
167
|
+
<TouchableOpacity
|
|
168
|
+
disabled={isAdmin}
|
|
169
|
+
style={styles.removeAccount}
|
|
170
|
+
onPress={() => onRemoveAccount()}
|
|
171
|
+
activeOpacity={0.7}
|
|
172
|
+
>
|
|
173
|
+
<OIcon src={theme.images.general.user} width={20} color={theme.colors.black} style={{ marginEnd: 14 }} />
|
|
174
|
+
<OText size={14} weight={'400'} style={{ opacity: isAdmin ? 0.5 : 1, top: 1 }} color={theme.colors.red}>{t('REMOVE_ACCOUNT', 'Remove account')}</OText>
|
|
175
|
+
</TouchableOpacity>
|
|
176
|
+
</RemoveAccountContainer>
|
|
137
177
|
</View>
|
|
178
|
+
<OAlert
|
|
179
|
+
open={confirm.open}
|
|
180
|
+
title={confirm.title}
|
|
181
|
+
content={confirm.content}
|
|
182
|
+
onAccept={confirm.handleOnAccept}
|
|
183
|
+
onCancel={() => setConfirm({ ...confirm, open: false, title: null })}
|
|
184
|
+
onClose={() => setConfirm({ ...confirm, open: false, title: null })}
|
|
185
|
+
/>
|
|
138
186
|
</Container>
|
|
139
187
|
);
|
|
140
188
|
};
|
|
189
|
+
|
|
190
|
+
export const UserProfileForm = (props: any) => {
|
|
191
|
+
const profileProps = {
|
|
192
|
+
...props,
|
|
193
|
+
UIComponent: UserProfileFormUI,
|
|
194
|
+
useSessionUser: true
|
|
195
|
+
};
|
|
196
|
+
return <UserProfileController {...profileProps} />;
|
|
197
|
+
};
|
|
@@ -35,3 +35,11 @@ export const LanguageContainer = styled.View`
|
|
|
35
35
|
align-items: center;
|
|
36
36
|
margin-bottom: 10px;
|
|
37
37
|
`
|
|
38
|
+
|
|
39
|
+
export const RemoveAccountContainer = styled.View`
|
|
40
|
+
flex-direction: row;
|
|
41
|
+
justify-content: flex-start;
|
|
42
|
+
align-items: center;
|
|
43
|
+
margin-bottom: 10px;
|
|
44
|
+
margin-top: 15px;
|
|
45
|
+
`
|
|
@@ -2,7 +2,7 @@ import styled from 'styled-components/native';
|
|
|
2
2
|
|
|
3
3
|
export const Container = styled.View`
|
|
4
4
|
width: 100%;
|
|
5
|
-
padding: 0
|
|
5
|
+
padding: 0 30px;
|
|
6
6
|
`
|
|
7
7
|
|
|
8
8
|
export const CountDownContainer = styled.View`
|
|
@@ -20,7 +20,6 @@ export const ResendSection = styled.View`
|
|
|
20
20
|
display: flex;
|
|
21
21
|
flex-direction: row;
|
|
22
22
|
justify-content: center;
|
|
23
|
-
flex-wrap: wrap;
|
|
24
23
|
`
|
|
25
24
|
|
|
26
25
|
export const WrappCountdown = styled.View`
|
|
@@ -78,7 +78,7 @@ const OModal = (props: Props): React.ReactElement => {
|
|
|
78
78
|
animationType="slide"
|
|
79
79
|
transparent={isTransparent}
|
|
80
80
|
visible={open}
|
|
81
|
-
onRequestClose={() => { onClose() }}
|
|
81
|
+
onRequestClose={() => { onClose && onClose() }}
|
|
82
82
|
style={{ height: '100%', flex: 1, position: 'absolute', ...style, zIndex: 9999 }}
|
|
83
83
|
>
|
|
84
84
|
{isAvoidKeyBoardView ? (
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Hook for countdown seconds
|
|
5
|
+
* @param {int} initialCount
|
|
6
|
+
* @param {boolean} start
|
|
7
|
+
*/
|
|
8
|
+
export function useCountdownTimer (initialCount : number, start : boolean) {
|
|
9
|
+
const [count, setCount] = useState(initialCount)
|
|
10
|
+
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (start) {
|
|
13
|
+
const secondsLeft = setInterval(() => {
|
|
14
|
+
setCount(c => c - (c === 0 ? 0 : 1))
|
|
15
|
+
}, 1000)
|
|
16
|
+
return () => clearInterval(secondsLeft)
|
|
17
|
+
}
|
|
18
|
+
}, [start])
|
|
19
|
+
|
|
20
|
+
return [
|
|
21
|
+
count,
|
|
22
|
+
setCount,
|
|
23
|
+
/** reset */
|
|
24
|
+
() => { setCount(initialCount) }
|
|
25
|
+
]
|
|
26
|
+
}
|
|
@@ -6,6 +6,7 @@ import AddressForm from '../pages/AddressForm'
|
|
|
6
6
|
import CartList from '../pages/CartList'
|
|
7
7
|
import CheckoutPage from '../pages/Checkout';
|
|
8
8
|
import BusinessProductsList from '../pages/BusinessProductsList';
|
|
9
|
+
import MultiCheckout from '../pages/MultiCheckout';
|
|
9
10
|
|
|
10
11
|
const Stack = createStackNavigator();
|
|
11
12
|
|
|
@@ -53,6 +54,11 @@ const CheckoutNavigator = (props: any) => {
|
|
|
53
54
|
component={AddressForm}
|
|
54
55
|
options={{ headerShown: false }}
|
|
55
56
|
/>
|
|
57
|
+
<Stack.Screen
|
|
58
|
+
name="MultiCheckout"
|
|
59
|
+
children={() => <MultiCheckout {...checkoutProps} />}
|
|
60
|
+
options={{ headerShown: false }}
|
|
61
|
+
/>
|
|
56
62
|
</Stack.Navigator>
|
|
57
63
|
);
|
|
58
64
|
}
|
|
@@ -20,8 +20,10 @@ import Help from '../pages/Help'
|
|
|
20
20
|
import HelpOrder from '../pages/HelpOrder'
|
|
21
21
|
import HelpGuide from '../pages/HelpGuide'
|
|
22
22
|
import HelpAccountAndPayment from '../pages/HelpAccountAndPayment'
|
|
23
|
+
import Sessions from '../pages/Sessions';
|
|
23
24
|
import Splash from '../pages/Splash';
|
|
24
25
|
import ProductDetails from '../pages/ProductDetails';
|
|
26
|
+
import MultiOrdersDetails from '../pages/MultiOrdersDetails';
|
|
25
27
|
const Stack = createStackNavigator();
|
|
26
28
|
|
|
27
29
|
const HomeNavigator = (e : any) => {
|
|
@@ -164,6 +166,16 @@ const HomeNavigator = (e : any) => {
|
|
|
164
166
|
component={HelpAccountAndPayment}
|
|
165
167
|
options={{ headerShown: false }}
|
|
166
168
|
/>
|
|
169
|
+
<Stack.Screen
|
|
170
|
+
name="Sessions"
|
|
171
|
+
component={Sessions}
|
|
172
|
+
options={{ headerShown: false }}
|
|
173
|
+
/>
|
|
174
|
+
<Stack.Screen
|
|
175
|
+
name="MultiOrdersDetails"
|
|
176
|
+
component={MultiOrdersDetails}
|
|
177
|
+
options={{ headerShown: false }}
|
|
178
|
+
/>
|
|
167
179
|
</>
|
|
168
180
|
)}
|
|
169
181
|
</>
|
|
@@ -21,7 +21,7 @@ const BusinessesListing = (props: any) => {
|
|
|
21
21
|
...props,
|
|
22
22
|
isSearchByName: true,
|
|
23
23
|
isSearchByDescription: true,
|
|
24
|
-
propsToFetch: ['id', 'name', 'header', 'logo', 'location', 'schedule', 'open', 'delivery_price', 'distance', 'delivery_time', 'pickup_time', 'reviews', 'featured', 'offers', 'food', 'laundry', 'alcohol', 'groceries', 'slug'],
|
|
24
|
+
propsToFetch: ['id', 'name', 'header', 'logo', 'ribbon', 'location', 'schedule', 'open', 'delivery_price', 'distance', 'delivery_time', 'pickup_time', 'reviews', 'featured', 'offers', 'food', 'laundry', 'alcohol', 'groceries', 'slug'],
|
|
25
25
|
onBusinessClick: (business: any) => {
|
|
26
26
|
props.navigation.navigate('Business', { store: store || business.slug, header: business.header, logo: business.logo })
|
|
27
27
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Platform, KeyboardAvoidingView, StyleSheet } from 'react-native'
|
|
3
|
+
import { MultiCheckout as MultiCheckoutController } from '../../themes/original/src/components/MultiCheckout'
|
|
4
|
+
|
|
5
|
+
const MultiCheckout = (props: any) => {
|
|
6
|
+
const multiCheckoutProps = {
|
|
7
|
+
...props,
|
|
8
|
+
onPlaceOrderClick: (orderUuids: any) => {
|
|
9
|
+
props.navigation.navigate('MultiOrdersDetails', { orderUuids: orderUuids, isFromMultiCheckout: true })
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<KeyboardAvoidingView
|
|
15
|
+
enabled
|
|
16
|
+
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
|
|
17
|
+
style={styles.container}
|
|
18
|
+
>
|
|
19
|
+
<MultiCheckoutController {...multiCheckoutProps} />
|
|
20
|
+
</KeyboardAvoidingView>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const styles = StyleSheet.create({
|
|
25
|
+
container: {
|
|
26
|
+
flexGrow: 1,
|
|
27
|
+
paddingBottom: 70,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export default MultiCheckout
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Platform } from 'react-native'
|
|
3
|
+
import { MultiOrdersDetails as MultiOrdersDetailsController } from '../../themes/original/src/components/MultiOrdersDetails'
|
|
4
|
+
import styled from 'styled-components/native';
|
|
5
|
+
|
|
6
|
+
const SafeAreaContainer = styled.SafeAreaView`
|
|
7
|
+
flex: 1;
|
|
8
|
+
background-color: ${(props: any) => props.theme.colors.backgroundPage};
|
|
9
|
+
padding-top: ${Platform.OS === 'ios' ? '0px' : '24px'};
|
|
10
|
+
`;
|
|
11
|
+
|
|
12
|
+
const MultiOrdersDetails = ({ navigation, route }: any) => {
|
|
13
|
+
const multiOrdersDetailsProps = {
|
|
14
|
+
navigation,
|
|
15
|
+
orderUuids: route.params?.orderUuids || [],
|
|
16
|
+
isFromMultiCheckout: route.params?.isFromMultiCheckout,
|
|
17
|
+
onRedirectPage: () => navigation.navigate('BusinessList')
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<SafeAreaContainer>
|
|
22
|
+
<MultiOrdersDetailsController {...multiOrdersDetailsProps} />
|
|
23
|
+
</SafeAreaContainer>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default MultiOrdersDetails
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Container } from '../../themes/original/src/layouts/Container'
|
|
3
|
+
import { Sessions as SessionsController } from '../../themes/original/src/components/Sessions'
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
navigation: any;
|
|
7
|
+
route: any;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const Sessions = (props: Props) => {
|
|
11
|
+
const sessionsProps = {
|
|
12
|
+
...props
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<Container>
|
|
17
|
+
<SessionsController {...sessionsProps} />
|
|
18
|
+
</Container>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default Sessions
|
package/src/theme.json
CHANGED
package/src/types/index.tsx
CHANGED
|
@@ -31,6 +31,8 @@ export interface ProfileParams {
|
|
|
31
31
|
validationFields?: any;
|
|
32
32
|
showField?: any;
|
|
33
33
|
isRequiredField?: any;
|
|
34
|
+
handleRemoveAccount?: any,
|
|
35
|
+
removeAccountState?: any
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
export interface AddressListParams {
|
|
@@ -143,8 +145,9 @@ export interface BusinessControllerParams {
|
|
|
143
145
|
orderType?: any;
|
|
144
146
|
handleClick?: any;
|
|
145
147
|
isBusinessOpen?: boolean;
|
|
146
|
-
businessWillCloseSoonMinutes?: number
|
|
147
|
-
isBusinessClose?: number
|
|
148
|
+
businessWillCloseSoonMinutes?: number;
|
|
149
|
+
isBusinessClose?: number;
|
|
150
|
+
getBusinessOffer: any;
|
|
148
151
|
}
|
|
149
152
|
export interface BusinessProductsListingParams {
|
|
150
153
|
navigation?: any;
|
package/src/utils/index.tsx
CHANGED
|
@@ -200,7 +200,7 @@ export const transformCountryCode = (countryCode : number) => {
|
|
|
200
200
|
*/
|
|
201
201
|
export const reviewCommentList = (type: string) => {
|
|
202
202
|
const [, t] = useLanguage()
|
|
203
|
-
|
|
203
|
+
// TODO: improve this function
|
|
204
204
|
const reviews: any = {
|
|
205
205
|
order: {
|
|
206
206
|
1: {
|
|
@@ -386,3 +386,70 @@ export const transformCountryCode = (countryCode : number) => {
|
|
|
386
386
|
|
|
387
387
|
return reviews[type]
|
|
388
388
|
}
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* function to manage order comment list
|
|
392
|
+
* @param {string} param0 type of orders to return
|
|
393
|
+
* @returns object with orders dictionary
|
|
394
|
+
*/
|
|
395
|
+
export const orderCommentList = (value: string) => {
|
|
396
|
+
const [, t] = useLanguage()
|
|
397
|
+
const dictionary: any = {
|
|
398
|
+
reject: 6,
|
|
399
|
+
forcePickUp: 9,
|
|
400
|
+
pickupFailed: 10,
|
|
401
|
+
forceDelivery: 11,
|
|
402
|
+
deliveryFailed: 12,
|
|
403
|
+
notReady: 14
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
const status = dictionary[value]
|
|
407
|
+
|
|
408
|
+
const messages: any = {
|
|
409
|
+
6: [// on reject order
|
|
410
|
+
'very_far_away',
|
|
411
|
+
'driver_vehicle_incident',
|
|
412
|
+
'destination_unreacheable',
|
|
413
|
+
'unavailable_driver',
|
|
414
|
+
'other'
|
|
415
|
+
],
|
|
416
|
+
9: [// on force pickup status
|
|
417
|
+
'forgot_complete_location',
|
|
418
|
+
'not_internet_conection',
|
|
419
|
+
'other'
|
|
420
|
+
],
|
|
421
|
+
10: [// on pickup failed by driver
|
|
422
|
+
'very_far_away',
|
|
423
|
+
'driver_vehicle_incident',
|
|
424
|
+
'destination_unreacheable',
|
|
425
|
+
'store_closed',
|
|
426
|
+
'unavailable_driver',
|
|
427
|
+
'other'
|
|
428
|
+
],
|
|
429
|
+
11: [// on force delivery status
|
|
430
|
+
'forgot_complete_location',
|
|
431
|
+
'not_internet_conection',
|
|
432
|
+
'other'
|
|
433
|
+
],
|
|
434
|
+
12: [// on delivery failed by driver
|
|
435
|
+
'very_far_away',
|
|
436
|
+
'driver_vehicle_incident',
|
|
437
|
+
'destination_unreacheable',
|
|
438
|
+
'recipient_unavailable',
|
|
439
|
+
'incorrect_missing_items',
|
|
440
|
+
'refused_damage',
|
|
441
|
+
'other'
|
|
442
|
+
],
|
|
443
|
+
14: [// on order not ready
|
|
444
|
+
'store_recieve_order_late',
|
|
445
|
+
'store_busy',
|
|
446
|
+
'other'
|
|
447
|
+
]
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
if (!messages[status]) return null
|
|
451
|
+
|
|
452
|
+
const list = messages[status].map((val: any, i: number) => ({ key: i, value: val, content: t(`REJECT_REASON_${val.toUpperCase()}`, val.replace(/_/g, ' ')) }))
|
|
453
|
+
|
|
454
|
+
return { list }
|
|
455
|
+
}
|