ordering-ui-react-native 0.15.46 → 0.15.47-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 +16 -8
- package/src/components/BusinessTypeFilter/index.tsx +3 -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 +120 -30
- package/src/components/LoginForm/styles.tsx +6 -0
- package/src/components/OrderDetails/index.tsx +9 -23
- package/src/components/PaymentOptions/index.tsx +1 -1
- package/src/components/PaymentOptionsWebView/index.tsx +123 -124
- package/src/components/SignupForm/index.tsx +145 -61
- 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/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 +18 -11
- 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 +42 -90
- 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 +159 -91
- 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 +1 -1
- package/themes/business/src/components/OrdersOption/index.tsx +5 -2
- package/themes/business/src/components/PreviousOrders/index.tsx +7 -5
- 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 +169 -4
- 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 +1 -1
- package/themes/original/src/components/BusinessController/index.tsx +48 -11
- 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 +1 -1
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +2 -2
- package/themes/original/src/components/BusinessProductsList/CategoryDescription/index.tsx +44 -0
- package/themes/original/src/components/BusinessProductsList/index.tsx +119 -35
- package/themes/original/src/components/BusinessProductsList/styles.tsx +12 -4
- package/themes/original/src/components/BusinessProductsListing/index.tsx +109 -21
- 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 -41
- package/themes/original/src/components/Checkout/index.tsx +48 -32
- 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 +64 -42
- package/themes/original/src/components/OrderDetails/styles.tsx +1 -2
- package/themes/original/src/components/OrderProgress/index.tsx +1 -1
- 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 +17 -23
- package/themes/original/src/components/PaymentOptionWallet/styles.tsx +1 -1
- package/themes/original/src/components/PaymentOptions/index.tsx +16 -14
- package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
- package/themes/original/src/components/PreviousOrders/index.tsx +18 -147
- 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 +59 -17
- package/themes/original/src/components/StripeElementsForm/index.tsx +16 -8
- package/themes/original/src/components/StripeElementsForm/naked.tsx +2 -2
- 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 +19 -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
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
|
-
import { Pressable, View } from 'react-native';
|
|
2
|
+
import { Pressable, StyleSheet, View } from 'react-native';
|
|
3
3
|
import { useTheme } from 'styled-components/native'
|
|
4
4
|
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
|
|
5
|
+
import FastImage from 'react-native-fast-image'
|
|
5
6
|
import {
|
|
6
7
|
WalletList,
|
|
7
8
|
useLanguage,
|
|
@@ -15,7 +16,10 @@ import {
|
|
|
15
16
|
TransactionsWrapper,
|
|
16
17
|
OTabs,
|
|
17
18
|
OTab,
|
|
18
|
-
SectionContent
|
|
19
|
+
SectionContent,
|
|
20
|
+
LoyaltyContent,
|
|
21
|
+
LoyaltyWrapp,
|
|
22
|
+
LoyaltyImg
|
|
19
23
|
} from './styles'
|
|
20
24
|
|
|
21
25
|
import NavBar from '../NavBar'
|
|
@@ -27,10 +31,14 @@ const WalletsUI = (props: any) => {
|
|
|
27
31
|
const {
|
|
28
32
|
navigation,
|
|
29
33
|
walletList,
|
|
34
|
+
userLoyaltyLevel,
|
|
30
35
|
transactionsList,
|
|
31
36
|
setWalletSelected,
|
|
32
37
|
isWalletCashEnabled,
|
|
33
|
-
isWalletPointsEnabled
|
|
38
|
+
isWalletPointsEnabled,
|
|
39
|
+
getWallets,
|
|
40
|
+
refreshWallets,
|
|
41
|
+
setRefreshWallets
|
|
34
42
|
} = props
|
|
35
43
|
|
|
36
44
|
const [, t] = useLanguage()
|
|
@@ -38,12 +46,27 @@ const WalletsUI = (props: any) => {
|
|
|
38
46
|
const [{ parsePrice }] = useUtils()
|
|
39
47
|
const [{ configs }] = useConfig()
|
|
40
48
|
|
|
49
|
+
const styles = StyleSheet.create({
|
|
50
|
+
logoStyle: {
|
|
51
|
+
width: 120,
|
|
52
|
+
height: 120,
|
|
53
|
+
borderRadius: 8,
|
|
54
|
+
borderWidth: 1,
|
|
55
|
+
borderColor: theme.colors.border,
|
|
56
|
+
flexDirection: 'column',
|
|
57
|
+
justifyContent: 'center',
|
|
58
|
+
alignItems: 'center',
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
41
62
|
const [tabSelected, setTabSelected] = useState(isWalletCashEnabled ? 'cash' : 'credit_point')
|
|
42
63
|
|
|
43
|
-
const isWalletEnabled = configs?.wallet_enabled?.value === '1' && (isWalletCashEnabled || isWalletPointsEnabled)
|
|
64
|
+
const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' && (isWalletCashEnabled || isWalletPointsEnabled)
|
|
44
65
|
|
|
45
66
|
const currentWalletSelected = (walletList.wallets?.length > 0 && walletList.wallets?.find((w: any) => w.type === tabSelected)) ?? null
|
|
46
67
|
|
|
68
|
+
const loyaltyLevel = Object.keys(userLoyaltyLevel.loyaltyLevel ?? {}).length > 0 && userLoyaltyLevel.loyaltyLevel
|
|
69
|
+
|
|
47
70
|
const walletName: any = {
|
|
48
71
|
cash: {
|
|
49
72
|
name: t('CASH_WALLET', 'Cash Wallet'),
|
|
@@ -74,6 +97,13 @@ const WalletsUI = (props: any) => {
|
|
|
74
97
|
}
|
|
75
98
|
}, [configs])
|
|
76
99
|
|
|
100
|
+
useEffect(() => {
|
|
101
|
+
if(refreshWallets){
|
|
102
|
+
getWallets()
|
|
103
|
+
setRefreshWallets && setRefreshWallets(false)
|
|
104
|
+
}
|
|
105
|
+
}, [refreshWallets])
|
|
106
|
+
|
|
77
107
|
return (
|
|
78
108
|
<Container>
|
|
79
109
|
<NavBar
|
|
@@ -86,18 +116,22 @@ const WalletsUI = (props: any) => {
|
|
|
86
116
|
/>
|
|
87
117
|
|
|
88
118
|
{!walletList.loading &&
|
|
119
|
+
!userLoyaltyLevel.loading &&
|
|
89
120
|
!walletList.error &&
|
|
90
121
|
walletList.wallets?.length > 0 &&
|
|
91
122
|
(
|
|
92
123
|
<>
|
|
93
|
-
<OTabs
|
|
124
|
+
<OTabs
|
|
125
|
+
horizontal
|
|
126
|
+
showsHorizontalScrollIndicator={false}
|
|
127
|
+
>
|
|
94
128
|
{walletList.wallets?.map((wallet: any) => walletName[wallet.type]?.isActive && (
|
|
95
129
|
<Pressable
|
|
96
130
|
key={wallet.id}
|
|
97
131
|
onPress={() => handleChangeTab(wallet)}
|
|
98
132
|
>
|
|
99
|
-
<OTab>
|
|
100
|
-
<OText size={18}
|
|
133
|
+
<OTab isSelected={tabSelected === wallet.type}>
|
|
134
|
+
<OText size={18}>
|
|
101
135
|
{walletName[wallet.type]?.name}
|
|
102
136
|
</OText>
|
|
103
137
|
</OTab>
|
|
@@ -106,6 +140,39 @@ const WalletsUI = (props: any) => {
|
|
|
106
140
|
</OTabs>
|
|
107
141
|
|
|
108
142
|
<SectionContent>
|
|
143
|
+
{!!loyaltyLevel && tabSelected === 'credit_point' && (
|
|
144
|
+
<LoyaltyContent>
|
|
145
|
+
<LoyaltyWrapp>
|
|
146
|
+
<OText size={20}>
|
|
147
|
+
{`${t('LOYALTY_LEVEL_TITLE', 'Your level is')}:`}
|
|
148
|
+
</OText>
|
|
149
|
+
{loyaltyLevel.image ? (
|
|
150
|
+
<FastImage
|
|
151
|
+
style={styles.logoStyle}
|
|
152
|
+
source={{
|
|
153
|
+
uri: loyaltyLevel.image,
|
|
154
|
+
priority: FastImage.priority.high,
|
|
155
|
+
cache:FastImage.cacheControl.web
|
|
156
|
+
}}
|
|
157
|
+
resizeMode={FastImage.resizeMode.contain}
|
|
158
|
+
/>
|
|
159
|
+
) : (
|
|
160
|
+
<LoyaltyImg
|
|
161
|
+
source={theme.images.dummies.loyaltyLevel}
|
|
162
|
+
resizeMode='contain'
|
|
163
|
+
/>
|
|
164
|
+
)}
|
|
165
|
+
<OText
|
|
166
|
+
size={22}
|
|
167
|
+
weight='bold'
|
|
168
|
+
style={{ textTransform: 'uppercase' }}
|
|
169
|
+
color={theme.colors.primary}
|
|
170
|
+
>
|
|
171
|
+
{loyaltyLevel.name}
|
|
172
|
+
</OText>
|
|
173
|
+
</LoyaltyWrapp>
|
|
174
|
+
</LoyaltyContent>
|
|
175
|
+
)}
|
|
109
176
|
<BalanceElement>
|
|
110
177
|
<OText size={20} style={{fontWeight: '600'}}>
|
|
111
178
|
{currentWalletSelected?.type === 'cash'
|
|
@@ -172,7 +239,7 @@ const WalletsUI = (props: any) => {
|
|
|
172
239
|
</>
|
|
173
240
|
)}
|
|
174
241
|
|
|
175
|
-
{walletList?.loading && (
|
|
242
|
+
{(walletList?.loading || userLoyaltyLevel.loading) && (
|
|
176
243
|
<>
|
|
177
244
|
<View>
|
|
178
245
|
<Placeholder Animation={Fade}>
|
|
@@ -196,7 +263,7 @@ const WalletsUI = (props: any) => {
|
|
|
196
263
|
</>
|
|
197
264
|
)}
|
|
198
265
|
|
|
199
|
-
{!walletList?.loading && (walletList?.error || !walletList?.wallets?.length) && (
|
|
266
|
+
{!walletList?.loading && !userLoyaltyLevel.loading && (walletList?.error || !walletList?.wallets?.length) && (
|
|
200
267
|
<NotFoundSource
|
|
201
268
|
content={walletList?.error
|
|
202
269
|
? t('ERROR_NOT_FOUND_WALLETS', 'Sorry, an error has occurred')
|
|
@@ -41,3 +41,24 @@ export const OTabs = styled.View`
|
|
|
41
41
|
export const OTab = styled.View`
|
|
42
42
|
padding-horizontal: 10px;
|
|
43
43
|
`;
|
|
44
|
+
|
|
45
|
+
export const LoyaltyContent = styled.View`
|
|
46
|
+
width: 100%;
|
|
47
|
+
margin-bottom: 20px;
|
|
48
|
+
`
|
|
49
|
+
|
|
50
|
+
export const LoyaltyWrapp = styled.View`
|
|
51
|
+
flex-direction: column;
|
|
52
|
+
justify-content: center;
|
|
53
|
+
align-items: center;
|
|
54
|
+
`
|
|
55
|
+
|
|
56
|
+
export const LoyaltyImg = styled.ImageBackground`
|
|
57
|
+
position: relative;
|
|
58
|
+
height: 150px;
|
|
59
|
+
width: 100%;
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
justify-content: center;
|
|
63
|
+
align-items: center;
|
|
64
|
+
`
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { Platform } from 'react-native';
|
|
2
3
|
import OText from './OText';
|
|
3
4
|
|
|
4
5
|
const HeaderTitle = (props: any) => {
|
|
@@ -7,7 +8,7 @@ const HeaderTitle = (props: any) => {
|
|
|
7
8
|
<OText
|
|
8
9
|
size={24}
|
|
9
10
|
style={style ?? {
|
|
10
|
-
marginTop: 30,
|
|
11
|
+
marginTop: Platform.OS === 'android' ? 50 : 30,
|
|
11
12
|
paddingHorizontal: 40,
|
|
12
13
|
textTransform: 'capitalize'
|
|
13
14
|
}}
|
|
@@ -21,6 +21,7 @@ interface Props {
|
|
|
21
21
|
isNotDecoration?: boolean;
|
|
22
22
|
styleCloseButton?: any,
|
|
23
23
|
isAvoidKeyBoardView?: boolean;
|
|
24
|
+
styleContainerCloseButton?: any;
|
|
24
25
|
}
|
|
25
26
|
const KeyboardView = styled.KeyboardAvoidingView`
|
|
26
27
|
flex-grow: 1;
|
|
@@ -45,6 +46,7 @@ const OModal = (props: Props): React.ReactElement => {
|
|
|
45
46
|
isNotDecoration,
|
|
46
47
|
style,
|
|
47
48
|
styleCloseButton,
|
|
49
|
+
styleContainerCloseButton,
|
|
48
50
|
isAvoidKeyBoardView
|
|
49
51
|
} = props
|
|
50
52
|
|
|
@@ -55,7 +57,7 @@ const OModal = (props: Props): React.ReactElement => {
|
|
|
55
57
|
{!entireModal ? (
|
|
56
58
|
<View style={styles.centeredView}>
|
|
57
59
|
<View style={titleSectionStyle ? titleSectionStyle : styles.titleSection}>
|
|
58
|
-
<TouchableOpacity style={styles.wrapperIcon} onPress={onClose}>
|
|
60
|
+
<TouchableOpacity style={{...styles.wrapperIcon, ...styleContainerCloseButton}} onPress={onClose}>
|
|
59
61
|
<OIcon
|
|
60
62
|
src={theme.images.general.close}
|
|
61
63
|
width={16}
|
|
@@ -91,7 +93,7 @@ const OModal = (props: Props): React.ReactElement => {
|
|
|
91
93
|
animationType="slide"
|
|
92
94
|
transparent={isTransparent}
|
|
93
95
|
visible={open}
|
|
94
|
-
onRequestClose={() => onClose()}
|
|
96
|
+
onRequestClose={() => onClose && onClose()}
|
|
95
97
|
style={{ height: '100%', flex: 1, position: 'absolute', ...style, zIndex: 9999 }}
|
|
96
98
|
>
|
|
97
99
|
{isAvoidKeyBoardView ? (
|
|
@@ -8,26 +8,26 @@ export const ORDER_TYPES = [
|
|
|
8
8
|
{
|
|
9
9
|
value: 1,
|
|
10
10
|
content: 'DELIVERY',
|
|
11
|
-
description: '
|
|
11
|
+
description: 'ORDERTYPE_DESCRIPTION_DELIVERY'
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
value: 2,
|
|
15
15
|
content: 'PICKUP',
|
|
16
|
-
description: '
|
|
16
|
+
description: 'ORDERTYPE_DESCRIPTION_PICKUP',
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
value: 3,
|
|
20
20
|
content: 'EAT_IN',
|
|
21
|
-
description: '
|
|
21
|
+
description: 'ORDERTYPE_DESCRIPTION_EATIN',
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
value: 4,
|
|
25
25
|
content: 'CURBSIDE',
|
|
26
|
-
description: '
|
|
26
|
+
description: 'ORDERTYPE_DESCRIPTION_CURBSIDE',
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
value: 5,
|
|
30
30
|
content: 'DRIVE_THRU',
|
|
31
|
-
description: '
|
|
31
|
+
description: 'ORDERTYPE_DESCRIPTION_DRIVETHRU',
|
|
32
32
|
}
|
|
33
|
-
]
|
|
33
|
+
]
|
|
@@ -17,6 +17,14 @@ export interface LoginParams {
|
|
|
17
17
|
handleSendVerifyCode?: any;
|
|
18
18
|
handleCheckPhoneCode?: any;
|
|
19
19
|
notificationState?: any;
|
|
20
|
+
handleReCaptcha?: any;
|
|
21
|
+
enableReCaptcha?: any;
|
|
22
|
+
otpType?: string,
|
|
23
|
+
setOtpType: (type: string) => void,
|
|
24
|
+
generateOtpCode: (values?: any) => void,
|
|
25
|
+
useLoginOtpEmail?: boolean,
|
|
26
|
+
useLoginOtpCellphone?: boolean,
|
|
27
|
+
useLoginOtp?: boolean
|
|
20
28
|
}
|
|
21
29
|
export interface ProfileParams {
|
|
22
30
|
navigation?: any;
|
|
@@ -37,6 +45,8 @@ export interface ProfileParams {
|
|
|
37
45
|
verifyPhoneState?: any;
|
|
38
46
|
setCheckPhoneCodeState?: any;
|
|
39
47
|
isVerifiedPhone?: any;
|
|
48
|
+
handleRemoveAccount?: any;
|
|
49
|
+
removeAccountState?: any;
|
|
40
50
|
}
|
|
41
51
|
|
|
42
52
|
export interface AddressListParams {
|
|
@@ -55,6 +65,7 @@ export interface AddressListParams {
|
|
|
55
65
|
isFromProductsList?: boolean;
|
|
56
66
|
afterSignup?: boolean;
|
|
57
67
|
isFromCheckout?: boolean
|
|
68
|
+
loadAddresses: () => void
|
|
58
69
|
}
|
|
59
70
|
|
|
60
71
|
export interface AddressFormParams {
|
|
@@ -100,6 +111,8 @@ export interface SignupParams {
|
|
|
100
111
|
handleCheckPhoneCode?: any;
|
|
101
112
|
notificationState?: any;
|
|
102
113
|
handleChangePromotions: () => void;
|
|
114
|
+
enableReCaptcha?: boolean;
|
|
115
|
+
handleReCaptcha?: () => void;
|
|
103
116
|
}
|
|
104
117
|
|
|
105
118
|
export interface PhoneInputParams {
|
|
@@ -116,6 +129,7 @@ export interface PhoneInputParams {
|
|
|
116
129
|
flagStyle?: any;
|
|
117
130
|
isDisabled?: any;
|
|
118
131
|
isStartValidation?: any;
|
|
132
|
+
changeCountry?: any;
|
|
119
133
|
}
|
|
120
134
|
|
|
121
135
|
export interface LanguageSelectorParams {
|
|
@@ -139,13 +153,18 @@ export interface BusinessesListingParams {
|
|
|
139
153
|
defaultBusinessType?: any;
|
|
140
154
|
franchiseId?: any;
|
|
141
155
|
businessId?: any;
|
|
156
|
+
isGuestUser?: any;
|
|
157
|
+
handleUpdateBusinessList?: any;
|
|
142
158
|
}
|
|
143
159
|
export interface HighestRatedBusinessesParams {
|
|
144
160
|
businessesList: { businesses: Array<any>, loading: boolean, error: null | string };
|
|
145
161
|
onBusinessClick?: void;
|
|
146
162
|
navigation?: any;
|
|
147
163
|
isLoading?: boolean;
|
|
148
|
-
getBusinesses: (newFetch: boolean) => void
|
|
164
|
+
getBusinesses: (newFetch: boolean) => void,
|
|
165
|
+
favoriteIds?: any,
|
|
166
|
+
setFavoriteIds?: any,
|
|
167
|
+
handleUpdateBusinessList?: any
|
|
149
168
|
}
|
|
150
169
|
export interface BusinessTypeFilterParams {
|
|
151
170
|
businessTypes?: Array<any>;
|
|
@@ -157,7 +176,7 @@ export interface BusinessTypeFilterParams {
|
|
|
157
176
|
setBusinessTypes?: any
|
|
158
177
|
}
|
|
159
178
|
export interface BusinessControllerParams {
|
|
160
|
-
key?: number;
|
|
179
|
+
key?: string | number;
|
|
161
180
|
business?: any;
|
|
162
181
|
handleCustomClick?: any;
|
|
163
182
|
orderType?: any;
|
|
@@ -174,7 +193,11 @@ export interface BusinessControllerParams {
|
|
|
174
193
|
businessDeliveryPrice?: number,
|
|
175
194
|
businessDeliveryTime?: string,
|
|
176
195
|
businessPickupTime?: string,
|
|
177
|
-
businessDistance?: number
|
|
196
|
+
businessDistance?: number,
|
|
197
|
+
favoriteIds?: number[],
|
|
198
|
+
handleFavoriteBusiness?: any,
|
|
199
|
+
setFavoriteIds?: any;
|
|
200
|
+
handleUpdateBusinessList?: any;
|
|
178
201
|
}
|
|
179
202
|
export interface BusinessProductsListingParams {
|
|
180
203
|
navigation?: any;
|
|
@@ -190,10 +213,14 @@ export interface BusinessProductsListingParams {
|
|
|
190
213
|
header?: any;
|
|
191
214
|
logo?: any;
|
|
192
215
|
productModal?: any;
|
|
216
|
+
alertState?: { open: boolean, content: any[] };
|
|
217
|
+
setAlertState?: any;
|
|
218
|
+
multiRemoveProducts?: (in1: any, in2: any) => {};
|
|
193
219
|
getNextProducts?: () => {};
|
|
194
220
|
handleChangeCategory: (value: any) => {};
|
|
195
221
|
setProductLogin?: () => {};
|
|
196
222
|
updateProductModal?: (value: any) => {};
|
|
223
|
+
handleUpdateProducts?: any;
|
|
197
224
|
}
|
|
198
225
|
export interface BusinessBasicInformationParams {
|
|
199
226
|
navigation?: any;
|
|
@@ -236,7 +263,13 @@ export interface BusinessProductsListParams {
|
|
|
236
263
|
handleCancelSearch?: () => void,
|
|
237
264
|
categoriesLayout?: any,
|
|
238
265
|
setCategoriesLayout?: any,
|
|
239
|
-
currentCart?: any
|
|
266
|
+
currentCart?: any,
|
|
267
|
+
setSubcategoriesSelected?: any,
|
|
268
|
+
subcategoriesSelected?: any,
|
|
269
|
+
onClickCategory?: any,
|
|
270
|
+
lazyLoadProductsRecommended?: boolean,
|
|
271
|
+
isFiltMode?: boolean,
|
|
272
|
+
handleUpdateProducts?: any
|
|
240
273
|
}
|
|
241
274
|
export interface SingleProductCardParams {
|
|
242
275
|
businessId: any,
|
|
@@ -244,7 +277,10 @@ export interface SingleProductCardParams {
|
|
|
244
277
|
isSoldOut: boolean;
|
|
245
278
|
onProductClick: any;
|
|
246
279
|
productAddedToCartLength: number;
|
|
247
|
-
style?: ViewStyle
|
|
280
|
+
style?: ViewStyle,
|
|
281
|
+
categoryState?: any,
|
|
282
|
+
handleFavoriteProduct?: any,
|
|
283
|
+
handleUpdateProducts?: any
|
|
248
284
|
}
|
|
249
285
|
export interface BusinessInformationParams {
|
|
250
286
|
navigation?: any,
|
|
@@ -278,6 +314,7 @@ export interface OrdersOptionParams {
|
|
|
278
314
|
orderList?: any,
|
|
279
315
|
franchiseId?: any,
|
|
280
316
|
activeOrders?: boolean,
|
|
317
|
+
pastOrders?: boolean,
|
|
281
318
|
pagination?: any,
|
|
282
319
|
titleContent?: string,
|
|
283
320
|
customArray?: Array<any>,
|
|
@@ -288,11 +325,23 @@ export interface OrdersOptionParams {
|
|
|
288
325
|
loadOrders?: any,
|
|
289
326
|
setOrderList?: any,
|
|
290
327
|
preOrders?: boolean,
|
|
328
|
+
reorderState?: any,
|
|
329
|
+
handleReorder?: (orderId: number) => {},
|
|
291
330
|
setOrdersLength?: ({ activeOrdersLength, previousOrdersLength }: { activeOrdersLength: number, previousOrdersLength: number }) => void,
|
|
292
331
|
ordersLength: { activeOrdersLength: number, previousOrdersLength: number },
|
|
293
332
|
setSelectedOrderId?: any,
|
|
294
333
|
setOpenMessges?: any,
|
|
295
|
-
loadMoreStatus?: boolean
|
|
334
|
+
loadMoreStatus?: boolean,
|
|
335
|
+
refreshOrders?: boolean,
|
|
336
|
+
setRefreshOrders?: (value: boolean) => void,
|
|
337
|
+
handleUpdateOrderList?: (orderId: number, changes: any) => {},
|
|
338
|
+
isBusiness?: boolean,
|
|
339
|
+
isProducts?: boolean,
|
|
340
|
+
businessOrderIds?: any,
|
|
341
|
+
products?: any,
|
|
342
|
+
businessesSearchList?: any,
|
|
343
|
+
hideOrders?: boolean,
|
|
344
|
+
BusinessControllerSkeletons?: any,
|
|
296
345
|
}
|
|
297
346
|
export interface ActiveOrdersParams {
|
|
298
347
|
orders?: any,
|
|
@@ -305,7 +354,8 @@ export interface ActiveOrdersParams {
|
|
|
305
354
|
loadMoreOrders?: () => {},
|
|
306
355
|
onNavigationRedirect?: (route: string, params?: any) => {},
|
|
307
356
|
isMessageView?: boolean,
|
|
308
|
-
handleClickOrder?: any
|
|
357
|
+
handleClickOrder?: any,
|
|
358
|
+
handleUpdateOrderList?: (orderId: number, changes: any) => {}
|
|
309
359
|
}
|
|
310
360
|
export interface PreviousOrdersParams {
|
|
311
361
|
orders?: any,
|
|
@@ -314,8 +364,9 @@ export interface PreviousOrdersParams {
|
|
|
314
364
|
orderID?: number
|
|
315
365
|
reorderLoading?: boolean,
|
|
316
366
|
loadMoreOrders?: () => {},
|
|
317
|
-
handleReorder
|
|
367
|
+
handleReorder?: (orderId: number) => {},
|
|
318
368
|
onNavigationRedirect?: (route: string, params?: any) => {}
|
|
369
|
+
handleUpdateOrderList?: (orderId: number, changes: any) => {}
|
|
319
370
|
}
|
|
320
371
|
export interface OrderDetailsParams {
|
|
321
372
|
navigation?: any,
|
|
@@ -478,6 +529,7 @@ export interface OrderTypeSelectParams {
|
|
|
478
529
|
defaultValue?: number;
|
|
479
530
|
configTypes?: Array<any>;
|
|
480
531
|
orderTypes: Array<any>;
|
|
532
|
+
setOrderTypeValue?: (value: number) => any
|
|
481
533
|
}
|
|
482
534
|
export interface UpsellingProductsParams {
|
|
483
535
|
isCustomMode?: boolean;
|
|
@@ -551,7 +603,11 @@ export interface BusinessSearchParams {
|
|
|
551
603
|
filters: any,
|
|
552
604
|
businessTypes: Array<number>,
|
|
553
605
|
setFilters: (filters: any) => void,
|
|
554
|
-
lazySearch?: boolean
|
|
606
|
+
lazySearch?: boolean,
|
|
607
|
+
brandList?: any;
|
|
608
|
+
onNavigationRedirect?: any,
|
|
609
|
+
handleUpdateProducts: any,
|
|
610
|
+
handleUpdateBusinessList?: any;
|
|
555
611
|
}
|
|
556
612
|
|
|
557
613
|
export interface NoNetworkParams {
|
|
@@ -566,3 +622,70 @@ export interface PlaceSpotParams {
|
|
|
566
622
|
getPlacesList?: any,
|
|
567
623
|
setOpenPlaceModal?: any
|
|
568
624
|
}
|
|
625
|
+
|
|
626
|
+
export interface PromotionParams {
|
|
627
|
+
navigation: any,
|
|
628
|
+
offersState: any,
|
|
629
|
+
handleSearchValue: any,
|
|
630
|
+
searchValue: string,
|
|
631
|
+
offerSelected: any,
|
|
632
|
+
setOfferSelected: any,
|
|
633
|
+
loadOffers: any
|
|
634
|
+
}
|
|
635
|
+
export interface SessionsParams {
|
|
636
|
+
navigation: any,
|
|
637
|
+
sessionsList: any,
|
|
638
|
+
actionState: any,
|
|
639
|
+
handleDeleteSession: any,
|
|
640
|
+
handleDeleteAllSessions: any
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
export interface otpParams {
|
|
644
|
+
willVerifyOtpState: boolean,
|
|
645
|
+
setWillVerifyOtpState: (val: boolean) => void,
|
|
646
|
+
onSubmit: () => void,
|
|
647
|
+
handleLoginOtp: (code: string) => void,
|
|
648
|
+
setAlertState: any
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
export interface FavoriteParams {
|
|
652
|
+
favoriteList: any,
|
|
653
|
+
handleUpdateFavoriteList: (id: number, changes: any) => {},
|
|
654
|
+
pagination: any,
|
|
655
|
+
getFavoriteList: (value: number) => {},
|
|
656
|
+
navigation?: any,
|
|
657
|
+
onNavigationRedirect?: (route: string, params?: any) => {},
|
|
658
|
+
reorderState?: any,
|
|
659
|
+
handleReorder?: (orderId: number) => {},
|
|
660
|
+
isOrder?: boolean,
|
|
661
|
+
isProduct?: boolean,
|
|
662
|
+
isBusiness?: boolean
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
export interface SingleOrderCardParams {
|
|
666
|
+
order: any,
|
|
667
|
+
reorderLoading: any,
|
|
668
|
+
handleReorder?: (value: any) => {},
|
|
669
|
+
getOrderStatus: any,
|
|
670
|
+
handleFavoriteOrder?: (value: boolean) => {},
|
|
671
|
+
onNavigationRedirect?: (route: string, params?: any) => {},
|
|
672
|
+
pastOrders: any,
|
|
673
|
+
isMessageView?: any,
|
|
674
|
+
handleClickOrder: (value: any) => {}
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
export interface PreviousBusinessOrderedParams {
|
|
678
|
+
navigation?: any,
|
|
679
|
+
businessesList?: any,
|
|
680
|
+
setBusinessLoading?: any,
|
|
681
|
+
businessId?: number,
|
|
682
|
+
onNavigationRedirect?: any,
|
|
683
|
+
isBusinessesSearchList?: any,
|
|
684
|
+
businessLoading?: boolean
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
export interface PreviousProductsOrderedParams {
|
|
688
|
+
products?: any,
|
|
689
|
+
onProductClick?: any,
|
|
690
|
+
isBusinessesSearchList?: boolean
|
|
691
|
+
}
|
|
@@ -33,7 +33,8 @@ export const getTraduction = (key: string) => {
|
|
|
33
33
|
ERROR_PLACE_PAY_WITH_CARD1: 'An error occurred while trying to pay by card',
|
|
34
34
|
ERROR_PLACE_PAY_WITH_PAYPAL_CAPTURE: 'An error occurred while trying to pay by PayPal',
|
|
35
35
|
ERROR_ADD_PRODUCT_VERY_FAR_FOR_DELIVERY: 'Error adding product, very far for delivery',
|
|
36
|
-
ERROR_PRODUCT_NOT_FOUND: 'Error with the product'
|
|
36
|
+
ERROR_PRODUCT_NOT_FOUND: 'Error with the product',
|
|
37
|
+
ERROR_INVALID_OFFER: 'The offer doesn\'t exist'
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
return keyList[key] ? t(key, keyList[key]) : t(key)
|
|
@@ -211,4 +212,20 @@ export const formatUrlVideo = (url : string) => {
|
|
|
211
212
|
const match = url.match(regExp)
|
|
212
213
|
const id = (match && match[7].length === 11) ? match[7] : false
|
|
213
214
|
return `https://www.youtube-nocookie.com/embed/${id}`
|
|
214
|
-
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export const formatSeconds = (seconds : number) => {
|
|
218
|
+
// Hours, minutes and seconds
|
|
219
|
+
var hrs = ~~(seconds / 3600)
|
|
220
|
+
var mins = ~~((seconds % 3600) / 60)
|
|
221
|
+
var secs = ~~seconds % 60
|
|
222
|
+
|
|
223
|
+
// Output like '1:01' or '4:03:59' or '123:03:59'
|
|
224
|
+
var ret = ''
|
|
225
|
+
if (hrs > 0) {
|
|
226
|
+
ret += '' + hrs + ':' + (mins < 10 ? '0' : '')
|
|
227
|
+
}
|
|
228
|
+
ret += '' + mins + ':' + (secs < 10 ? '0' : '')
|
|
229
|
+
ret += '' + secs
|
|
230
|
+
return ret
|
|
231
|
+
}
|
|
@@ -140,7 +140,7 @@ const AddressListUI = (props: AddressListParams) => {
|
|
|
140
140
|
<AddressListContainer>
|
|
141
141
|
{isProfile && (
|
|
142
142
|
<NavBar
|
|
143
|
-
title={t('
|
|
143
|
+
title={t('SAVED_PLACES', 'My saved places')}
|
|
144
144
|
titleAlign={'center'}
|
|
145
145
|
onActionLeft={() => goToBack()}
|
|
146
146
|
showCall={false}
|
|
@@ -58,7 +58,7 @@ const OrderTypeSelectorUI = (props: OrderTypeSelectParams) => {
|
|
|
58
58
|
btnStyle={{ paddingLeft: 0 }}
|
|
59
59
|
paddingTop={0}
|
|
60
60
|
style={{ paddingBottom: 0 }}
|
|
61
|
-
title={t('
|
|
61
|
+
title={t('HOW_WILL_YOU_DELIVERY_TYPE', 'How will your order type?')}
|
|
62
62
|
titleAlign={'center'}
|
|
63
63
|
titleStyle={{ fontSize: 14 }}
|
|
64
64
|
/>
|
|
@@ -154,7 +154,7 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
154
154
|
<Actions>
|
|
155
155
|
<ListItem onPress={() => onRedirect('AddressList', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
156
156
|
<OIcon src={theme.images.general.pin} width={16} color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
|
|
157
|
-
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('
|
|
157
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('SAVED_PLACES', 'My saved places')}</OText>
|
|
158
158
|
</ListItem>
|
|
159
159
|
<ListItem onPress={() => navigation.navigate('Help', {})} activeOpacity={0.7}>
|
|
160
160
|
<OIcon src={theme.images.general.help} width={16} color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
|
|
@@ -144,7 +144,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
144
144
|
{isFarAway && (
|
|
145
145
|
<FarAwayMessage style={styles.farAwayMsg}>
|
|
146
146
|
<Ionicons name='md-warning-outline' style={styles.iconStyle} />
|
|
147
|
-
<OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', '
|
|
147
|
+
<OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
|
|
148
148
|
</FarAwayMessage>
|
|
149
149
|
)}
|
|
150
150
|
<View style={styles.wrapperOrderOptions}>
|