ordering-ui-react-native 0.15.12 → 0.15.13-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 +5 -3
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessTypeFilter/index.tsx +12 -2
- package/src/components/BusinessTypeFilter/styles.tsx +1 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +0 -1
- package/src/components/LanguageSelector/index.tsx +1 -0
- package/src/components/OrderDetails/index.tsx +26 -5
- package/src/components/PaymentOptions/index.tsx +9 -16
- package/src/components/PaymentOptionsWebView/index.tsx +123 -124
- package/src/components/ProductForm/index.tsx +1 -1
- package/src/components/ProductForm/styles.tsx +1 -0
- package/src/components/StripeElementsForm/index.tsx +27 -48
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/config.json +0 -2
- package/src/navigators/HomeNavigator.tsx +6 -0
- package/src/pages/BusinessProductsList.tsx +1 -0
- package/src/pages/BusinessesListing.tsx +1 -1
- package/src/pages/Checkout.tsx +1 -1
- package/src/pages/Sessions.tsx +22 -0
- package/src/types/index.tsx +1 -9
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/Chat/index.tsx +3 -2
- 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/NewOrderNotification/index.tsx +59 -98
- package/themes/business/src/components/OrderDetails/Business.tsx +2 -1
- package/themes/business/src/components/OrderDetails/Delivery.tsx +9 -9
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +150 -89
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +91 -17
- package/themes/business/src/components/OrderDetails/styles.tsx +7 -0
- package/themes/business/src/components/OrdersListManager/index.tsx +874 -0
- package/themes/business/src/components/OrdersListManager/styles.tsx +123 -0
- package/themes/business/src/components/OrdersListManager/utils.tsx +216 -0
- package/themes/business/src/components/OrdersOption/index.tsx +70 -116
- package/themes/business/src/components/OrdersOption/styles.tsx +2 -5
- package/themes/business/src/components/PreviousOrders/index.tsx +82 -23
- 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/BusinessController/index.tsx +27 -6
- package/themes/kiosk/src/components/BusinessController/styles.tsx +1 -1
- package/themes/kiosk/src/components/BusinessProductsListing/index.tsx +48 -21
- package/themes/kiosk/src/components/Cart/index.tsx +98 -24
- package/themes/kiosk/src/components/Cart/styles.tsx +6 -0
- package/themes/kiosk/src/components/CartBottomSheet/index.tsx +1 -1
- package/themes/kiosk/src/components/CartBottomSheet/styles.tsx +1 -1
- package/themes/kiosk/src/components/CartContent/index.tsx +13 -3
- package/themes/kiosk/src/components/CartItem/index.tsx +20 -8
- package/themes/kiosk/src/components/CategoriesMenu/index.tsx +6 -5
- package/themes/kiosk/src/components/CustomerName/index.tsx +89 -88
- package/themes/kiosk/src/components/Intro/index.tsx +13 -13
- package/themes/kiosk/src/components/LanguageSelector/index.tsx +12 -8
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderDetails/index.tsx +136 -41
- package/themes/kiosk/src/components/OrderDetails/styles.tsx +5 -0
- package/themes/kiosk/src/components/OrderSummary/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +10 -12
- package/themes/kiosk/src/components/ProductForm/index.tsx +174 -125
- package/themes/kiosk/src/components/ProductForm/styles.tsx +1 -1
- package/themes/kiosk/src/components/ProductOption/index.tsx +1 -0
- package/themes/kiosk/src/components/ProductOption/styles.tsx +1 -0
- package/themes/kiosk/src/components/UpsellingProducts/index.tsx +48 -34
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/components/shared/OCard.tsx +112 -78
- package/themes/kiosk/src/types/index.d.ts +2 -0
- package/themes/original/index.tsx +179 -0
- package/themes/original/src/components/AddressForm/index.tsx +15 -10
- package/themes/original/src/components/AddressList/index.tsx +28 -2
- package/themes/original/src/components/AppleLogin/index.tsx +119 -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 +52 -22
- package/themes/original/src/components/BusinessController/styles.tsx +22 -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/BusinessListingSearch/index.tsx +4 -0
- package/themes/original/src/components/BusinessMenuList/index.tsx +11 -4
- package/themes/original/src/components/BusinessPreorder/index.tsx +141 -121
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +7 -5
- package/themes/original/src/components/BusinessProductsList/index.tsx +129 -22
- package/themes/original/src/components/BusinessProductsList/styles.tsx +29 -2
- package/themes/original/src/components/BusinessProductsListing/index.tsx +92 -37
- 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/BusinessesListing/index.tsx +40 -53
- package/themes/original/src/components/Cart/index.tsx +41 -10
- package/themes/original/src/components/CartContent/index.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +23 -27
- package/themes/original/src/components/CouponControl/index.tsx +1 -0
- package/themes/original/src/components/DriverTips/index.tsx +1 -1
- package/themes/original/src/components/ForgotPasswordForm/index.tsx +8 -12
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +97 -89
- package/themes/original/src/components/Home/index.tsx +1 -1
- package/themes/original/src/components/LoginForm/index.tsx +156 -70
- package/themes/original/src/components/LoginForm/styles.tsx +6 -1
- package/themes/original/src/components/Messages/index.tsx +50 -45
- package/themes/original/src/components/Messages/styles.tsx +1 -3
- 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/OrderDetails/index.tsx +105 -127
- package/themes/original/src/components/OrderDetails/styles.tsx +3 -1
- package/themes/original/src/components/OrderProgress/index.tsx +4 -4
- package/themes/original/src/components/OrderProgress/styles.tsx +1 -0
- package/themes/original/src/components/OrderSummary/index.tsx +35 -2
- package/themes/original/src/components/OrderTypeSelector/index.tsx +1 -1
- package/themes/original/src/components/OrdersOption/index.tsx +15 -46
- package/themes/original/src/components/OrdersOption/styles.tsx +0 -6
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +6 -2
- package/themes/original/src/components/PaymentOptions/index.tsx +9 -19
- package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -8
- package/themes/original/src/components/PlaceSpot/index.tsx +114 -0
- package/themes/original/src/components/PlaceSpot/styles.tsx +11 -0
- package/themes/original/src/components/PreviousOrders/index.tsx +19 -13
- package/themes/original/src/components/ProductForm/index.tsx +47 -36
- package/themes/original/src/components/ProductForm/styles.tsx +2 -2
- package/themes/original/src/components/Promotions/index.tsx +233 -0
- package/themes/original/src/components/Promotions/styles.tsx +58 -0
- package/themes/original/src/components/ReviewOrder/index.tsx +10 -9
- package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
- 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 +173 -154
- package/themes/original/src/components/SingleProductCard/index.tsx +39 -18
- package/themes/original/src/components/SingleProductCard/styles.tsx +28 -1
- package/themes/original/src/components/StripeElementsForm/index.tsx +55 -72
- package/themes/original/src/components/TaxInformation/index.tsx +17 -7
- package/themes/original/src/components/UpsellingProducts/index.tsx +6 -6
- package/themes/original/src/components/UserDetails/index.tsx +4 -95
- package/themes/original/src/components/UserFormDetails/index.tsx +2 -14
- package/themes/original/src/components/UserProfile/index.tsx +29 -17
- package/themes/original/src/components/UserProfileForm/index.tsx +8 -6
- 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 +58 -4
- package/themes/original/src/components/Wallets/styles.tsx +21 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +21 -0
- package/themes/original/src/components/shared/index.tsx +2 -0
- package/themes/original/src/config/constants.tsx +6 -6
- package/themes/original/src/types/index.tsx +70 -23
- package/themes/original/src/utils/index.tsx +12 -2
- package/themes/single-business/src/components/AddressList/index.tsx +1 -1
- package/themes/single-business/src/components/OrderTypeSelector/index.tsx +6 -6
- package/themes/single-business/src/components/UserProfile/index.tsx +1 -1
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/StripeMethodForm/index.tsx +0 -168
|
@@ -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,6 +31,7 @@ const WalletsUI = (props: any) => {
|
|
|
27
31
|
const {
|
|
28
32
|
navigation,
|
|
29
33
|
walletList,
|
|
34
|
+
userLoyaltyLevel,
|
|
30
35
|
transactionsList,
|
|
31
36
|
setWalletSelected,
|
|
32
37
|
isWalletCashEnabled,
|
|
@@ -38,12 +43,27 @@ const WalletsUI = (props: any) => {
|
|
|
38
43
|
const [{ parsePrice }] = useUtils()
|
|
39
44
|
const [{ configs }] = useConfig()
|
|
40
45
|
|
|
46
|
+
const styles = StyleSheet.create({
|
|
47
|
+
logoStyle: {
|
|
48
|
+
width: 120,
|
|
49
|
+
height: 120,
|
|
50
|
+
borderRadius: 8,
|
|
51
|
+
borderWidth: 1,
|
|
52
|
+
borderColor: theme.colors.border,
|
|
53
|
+
flexDirection: 'column',
|
|
54
|
+
justifyContent: 'center',
|
|
55
|
+
alignItems: 'center',
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
41
59
|
const [tabSelected, setTabSelected] = useState(isWalletCashEnabled ? 'cash' : 'credit_point')
|
|
42
60
|
|
|
43
61
|
const isWalletEnabled = configs?.wallet_enabled?.value === '1' && (isWalletCashEnabled || isWalletPointsEnabled)
|
|
44
62
|
|
|
45
63
|
const currentWalletSelected = (walletList.wallets?.length > 0 && walletList.wallets?.find((w: any) => w.type === tabSelected)) ?? null
|
|
46
64
|
|
|
65
|
+
const loyaltyLevel = Object.keys(userLoyaltyLevel.loyaltyLevel ?? {}).length > 0 && userLoyaltyLevel.loyaltyLevel
|
|
66
|
+
|
|
47
67
|
const walletName: any = {
|
|
48
68
|
cash: {
|
|
49
69
|
name: t('CASH_WALLET', 'Cash Wallet'),
|
|
@@ -86,6 +106,7 @@ const WalletsUI = (props: any) => {
|
|
|
86
106
|
/>
|
|
87
107
|
|
|
88
108
|
{!walletList.loading &&
|
|
109
|
+
!userLoyaltyLevel.loading &&
|
|
89
110
|
!walletList.error &&
|
|
90
111
|
walletList.wallets?.length > 0 &&
|
|
91
112
|
(
|
|
@@ -106,6 +127,39 @@ const WalletsUI = (props: any) => {
|
|
|
106
127
|
</OTabs>
|
|
107
128
|
|
|
108
129
|
<SectionContent>
|
|
130
|
+
{!!loyaltyLevel && (
|
|
131
|
+
<LoyaltyContent>
|
|
132
|
+
<LoyaltyWrapp>
|
|
133
|
+
<OText size={20}>
|
|
134
|
+
{`${t('LOYALTY_LEVEL_TITLE', 'Your level is')}:`}
|
|
135
|
+
</OText>
|
|
136
|
+
{loyaltyLevel.image ? (
|
|
137
|
+
<FastImage
|
|
138
|
+
style={styles.logoStyle}
|
|
139
|
+
source={{
|
|
140
|
+
uri: loyaltyLevel.image,
|
|
141
|
+
priority: FastImage.priority.high,
|
|
142
|
+
cache:FastImage.cacheControl.web
|
|
143
|
+
}}
|
|
144
|
+
resizeMode={FastImage.resizeMode.contain}
|
|
145
|
+
/>
|
|
146
|
+
) : (
|
|
147
|
+
<LoyaltyImg
|
|
148
|
+
source={theme.images.dummies.loyaltyLevel}
|
|
149
|
+
resizeMode='contain'
|
|
150
|
+
/>
|
|
151
|
+
)}
|
|
152
|
+
<OText
|
|
153
|
+
size={22}
|
|
154
|
+
weight='bold'
|
|
155
|
+
style={{ textTransform: 'uppercase' }}
|
|
156
|
+
color={theme.colors.primary}
|
|
157
|
+
>
|
|
158
|
+
{loyaltyLevel.name}
|
|
159
|
+
</OText>
|
|
160
|
+
</LoyaltyWrapp>
|
|
161
|
+
</LoyaltyContent>
|
|
162
|
+
)}
|
|
109
163
|
<BalanceElement>
|
|
110
164
|
<OText size={20} style={{fontWeight: '600'}}>
|
|
111
165
|
{currentWalletSelected?.type === 'cash'
|
|
@@ -172,7 +226,7 @@ const WalletsUI = (props: any) => {
|
|
|
172
226
|
</>
|
|
173
227
|
)}
|
|
174
228
|
|
|
175
|
-
{walletList?.loading && (
|
|
229
|
+
{(walletList?.loading || userLoyaltyLevel.loading) && (
|
|
176
230
|
<>
|
|
177
231
|
<View>
|
|
178
232
|
<Placeholder Animation={Fade}>
|
|
@@ -196,7 +250,7 @@ const WalletsUI = (props: any) => {
|
|
|
196
250
|
</>
|
|
197
251
|
)}
|
|
198
252
|
|
|
199
|
-
{!walletList?.loading && (walletList?.error || !walletList?.wallets?.length) && (
|
|
253
|
+
{!walletList?.loading && !userLoyaltyLevel.loading && (walletList?.error || !walletList?.wallets?.length) && (
|
|
200
254
|
<NotFoundSource
|
|
201
255
|
content={walletList?.error
|
|
202
256
|
? 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
|
+
`
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Platform } from 'react-native';
|
|
3
|
+
import OText from './OText';
|
|
4
|
+
|
|
5
|
+
const HeaderTitle = (props: any) => {
|
|
6
|
+
const { text, style } = props
|
|
7
|
+
return (
|
|
8
|
+
<OText
|
|
9
|
+
size={24}
|
|
10
|
+
style={style ?? {
|
|
11
|
+
marginTop: Platform.OS === 'android' ? 50 : 30,
|
|
12
|
+
paddingHorizontal: 40,
|
|
13
|
+
textTransform: 'capitalize'
|
|
14
|
+
}}
|
|
15
|
+
>
|
|
16
|
+
{text}
|
|
17
|
+
</OText>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default HeaderTitle
|
|
@@ -11,6 +11,7 @@ import OKeyButton from './OKeyButton'
|
|
|
11
11
|
import OModal from './OModal'
|
|
12
12
|
import OAlert from './OAlert'
|
|
13
13
|
import OBottomPopup from './OBottomPopup'
|
|
14
|
+
import HeaderTitle from './HeaderTitle'
|
|
14
15
|
|
|
15
16
|
export {
|
|
16
17
|
OText,
|
|
@@ -26,4 +27,5 @@ export {
|
|
|
26
27
|
OAlert,
|
|
27
28
|
OModal,
|
|
28
29
|
OBottomPopup,
|
|
30
|
+
HeaderTitle
|
|
29
31
|
}
|
|
@@ -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,8 @@ export interface LoginParams {
|
|
|
17
17
|
handleSendVerifyCode?: any;
|
|
18
18
|
handleCheckPhoneCode?: any;
|
|
19
19
|
notificationState?: any;
|
|
20
|
+
handleReCaptcha?: any;
|
|
21
|
+
enableReCaptcha?: any;
|
|
20
22
|
}
|
|
21
23
|
export interface ProfileParams {
|
|
22
24
|
navigation?: any;
|
|
@@ -100,6 +102,8 @@ export interface SignupParams {
|
|
|
100
102
|
handleCheckPhoneCode?: any;
|
|
101
103
|
notificationState?: any;
|
|
102
104
|
handleChangePromotions: () => void;
|
|
105
|
+
enableReCaptcha?: boolean;
|
|
106
|
+
handleReCaptcha?: () => void;
|
|
103
107
|
}
|
|
104
108
|
|
|
105
109
|
export interface PhoneInputParams {
|
|
@@ -115,6 +119,8 @@ export interface PhoneInputParams {
|
|
|
115
119
|
noDropIcon?: boolean;
|
|
116
120
|
flagStyle?: any;
|
|
117
121
|
isDisabled?: any;
|
|
122
|
+
isStartValidation?: any;
|
|
123
|
+
changeCountry?: any;
|
|
118
124
|
}
|
|
119
125
|
|
|
120
126
|
export interface LanguageSelectorParams {
|
|
@@ -142,9 +148,9 @@ export interface BusinessesListingParams {
|
|
|
142
148
|
export interface HighestRatedBusinessesParams {
|
|
143
149
|
businessesList: { businesses: Array<any>, loading: boolean, error: null | string };
|
|
144
150
|
onBusinessClick?: void;
|
|
145
|
-
navigation
|
|
151
|
+
navigation?: any;
|
|
146
152
|
isLoading?: boolean;
|
|
147
|
-
getBusinesses: (newFetch
|
|
153
|
+
getBusinesses: (newFetch: boolean) => void
|
|
148
154
|
}
|
|
149
155
|
export interface BusinessTypeFilterParams {
|
|
150
156
|
businessTypes?: Array<any>;
|
|
@@ -165,7 +171,15 @@ export interface BusinessControllerParams {
|
|
|
165
171
|
businessWillCloseSoonMinutes?: number
|
|
166
172
|
isBusinessClose?: number,
|
|
167
173
|
navigation?: any,
|
|
168
|
-
style?: ViewStyle
|
|
174
|
+
style?: ViewStyle,
|
|
175
|
+
businessHeader?: string,
|
|
176
|
+
businessFeatured?: boolean,
|
|
177
|
+
businessLogo?: string,
|
|
178
|
+
businessReviews?: any,
|
|
179
|
+
businessDeliveryPrice?: number,
|
|
180
|
+
businessDeliveryTime?: string,
|
|
181
|
+
businessPickupTime?: string,
|
|
182
|
+
businessDistance?: number
|
|
169
183
|
}
|
|
170
184
|
export interface BusinessProductsListingParams {
|
|
171
185
|
navigation?: any;
|
|
@@ -181,7 +195,7 @@ export interface BusinessProductsListingParams {
|
|
|
181
195
|
header?: any;
|
|
182
196
|
logo?: any;
|
|
183
197
|
productModal?: any;
|
|
184
|
-
|
|
198
|
+
getNextProducts?: () => {};
|
|
185
199
|
handleChangeCategory: (value: any) => {};
|
|
186
200
|
setProductLogin?: () => {};
|
|
187
201
|
updateProductModal?: (value: any) => {};
|
|
@@ -208,11 +222,12 @@ export interface BusinessProductsCategoriesParams {
|
|
|
208
222
|
categoriesLayout?: any;
|
|
209
223
|
selectedCategoryId?: any;
|
|
210
224
|
lazyLoadProductsRecommended?: any;
|
|
211
|
-
|
|
212
|
-
|
|
225
|
+
setSelectedCategoryId?: any
|
|
226
|
+
setCategoryClicked?: any
|
|
213
227
|
}
|
|
214
228
|
export interface BusinessProductsListParams {
|
|
215
229
|
errors?: any;
|
|
230
|
+
isFiltMode?: any;
|
|
216
231
|
businessId?: number;
|
|
217
232
|
category?: any;
|
|
218
233
|
categories: Array<any>;
|
|
@@ -227,7 +242,11 @@ export interface BusinessProductsListParams {
|
|
|
227
242
|
handleCancelSearch?: () => void,
|
|
228
243
|
categoriesLayout?: any,
|
|
229
244
|
setCategoriesLayout?: any,
|
|
230
|
-
currentCart?: any
|
|
245
|
+
currentCart?: any,
|
|
246
|
+
setSubcategoriesSelected?: any,
|
|
247
|
+
subcategoriesSelected?: any,
|
|
248
|
+
onClickCategory?: any,
|
|
249
|
+
lazyLoadProductsRecommended?: boolean
|
|
231
250
|
}
|
|
232
251
|
export interface SingleProductCardParams {
|
|
233
252
|
businessId: any,
|
|
@@ -320,7 +339,10 @@ export interface OrderDetailsParams {
|
|
|
320
339
|
isFromCheckout?: boolean,
|
|
321
340
|
driverLocation?: any,
|
|
322
341
|
isFromRoot?: any,
|
|
323
|
-
goToBusinessList?: boolean
|
|
342
|
+
goToBusinessList?: boolean,
|
|
343
|
+
onNavigationRedirect?: any,
|
|
344
|
+
reorderState?: any,
|
|
345
|
+
handleReorder?: any,
|
|
324
346
|
}
|
|
325
347
|
export interface ProductItemAccordionParams {
|
|
326
348
|
key?: any;
|
|
@@ -354,7 +376,7 @@ export interface ReviewProductParams {
|
|
|
354
376
|
formState?: any,
|
|
355
377
|
handleChangeFormState?: any,
|
|
356
378
|
handleSendProductReview?: any
|
|
357
|
-
|
|
379
|
+
}
|
|
358
380
|
export interface SingleProductReviewParams {
|
|
359
381
|
product: any,
|
|
360
382
|
formState?: any,
|
|
@@ -382,7 +404,7 @@ export interface MessagesParams {
|
|
|
382
404
|
handleSend?: () => {},
|
|
383
405
|
setImage?: (image: string | null) => {},
|
|
384
406
|
setMessage?: (comment: string) => {},
|
|
385
|
-
setMessages?: () => {},
|
|
407
|
+
setMessages?: (image: any | null) => {},
|
|
386
408
|
readMessages?: () => {},
|
|
387
409
|
onClose?: () => void,
|
|
388
410
|
isMeesageListing?: boolean,
|
|
@@ -521,27 +543,52 @@ export interface HelpGuideParams {
|
|
|
521
543
|
export interface HelpAccountAndPaymentParams {
|
|
522
544
|
navigation: any;
|
|
523
545
|
}
|
|
524
|
-
|
|
546
|
+
|
|
525
547
|
export interface MessageListingParams {
|
|
526
548
|
navigation: any;
|
|
527
549
|
franchiseId?: any;
|
|
528
550
|
}
|
|
529
551
|
|
|
530
|
-
export interface BusinessSearchParams {
|
|
552
|
+
export interface BusinessSearchParams {
|
|
531
553
|
navigation: any,
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
554
|
+
businessesSearchList: any,
|
|
555
|
+
onBusinessClick: any,
|
|
556
|
+
handleChangeTermValue: (term: string) => void,
|
|
557
|
+
termValue: string,
|
|
558
|
+
paginationProps: any,
|
|
559
|
+
handleSearchbusinessAndProducts: (newFetch?: boolean) => void,
|
|
560
|
+
handleChangeFilters: (prop: string, value: any) => void,
|
|
561
|
+
filters: any,
|
|
562
|
+
businessTypes: Array<number>,
|
|
563
|
+
setFilters: (filters: any) => void,
|
|
542
564
|
lazySearch?: boolean
|
|
543
565
|
}
|
|
544
|
-
|
|
566
|
+
|
|
545
567
|
export interface NoNetworkParams {
|
|
546
568
|
image?: any,
|
|
547
569
|
}
|
|
570
|
+
|
|
571
|
+
export interface PlaceSpotParams {
|
|
572
|
+
isOpenPlaceSpot?: boolean,
|
|
573
|
+
cart?: any,
|
|
574
|
+
placesState?: any,
|
|
575
|
+
handleChangePlace?: any,
|
|
576
|
+
getPlacesList?: any,
|
|
577
|
+
setOpenPlaceModal?: any
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
export interface PromotionParams {
|
|
581
|
+
navigation: any,
|
|
582
|
+
offersState: any,
|
|
583
|
+
handleSearchValue: any,
|
|
584
|
+
searchValue: string,
|
|
585
|
+
offerSelected: any,
|
|
586
|
+
setOfferSelected: any,
|
|
587
|
+
}
|
|
588
|
+
export interface SessionsParams {
|
|
589
|
+
navigation: any,
|
|
590
|
+
sessionsList: any,
|
|
591
|
+
actionState: any,
|
|
592
|
+
handleDeleteSession: any,
|
|
593
|
+
handleDeleteAllSessions: any
|
|
594
|
+
}
|
|
@@ -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)
|
|
@@ -170,6 +171,15 @@ export const getTypesText = (value: number) => {
|
|
|
170
171
|
return ret?.content;
|
|
171
172
|
}
|
|
172
173
|
|
|
174
|
+
/**
|
|
175
|
+
* List shape for ribbon
|
|
176
|
+
*/
|
|
177
|
+
export const shape = {
|
|
178
|
+
rectangle: 'rectangle',
|
|
179
|
+
rectangleRound: 'rectangle_round',
|
|
180
|
+
capsuleShape: 'capsule_shape'
|
|
181
|
+
}
|
|
182
|
+
|
|
173
183
|
/**
|
|
174
184
|
* Function to transform degree to radian
|
|
175
185
|
* @param {number} value for transform
|
|
@@ -202,4 +212,4 @@ export const formatUrlVideo = (url : string) => {
|
|
|
202
212
|
const match = url.match(regExp)
|
|
203
213
|
const id = (match && match[7].length === 11) ? match[7] : false
|
|
204
214
|
return `https://www.youtube-nocookie.com/embed/${id}`
|
|
205
|
-
}
|
|
215
|
+
}
|
|
@@ -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
|
/>
|
|
@@ -97,27 +97,27 @@ export const OrderTypeSelector = (props: any) => {
|
|
|
97
97
|
{
|
|
98
98
|
value: 1,
|
|
99
99
|
content: t('DELIVERY', 'Delivery'),
|
|
100
|
-
description: t('ORDERTYPE_DESCRIPTION_DELIVERY', '
|
|
100
|
+
description: t('ORDERTYPE_DESCRIPTION_DELIVERY', 'Delivery description')
|
|
101
101
|
},
|
|
102
102
|
{
|
|
103
103
|
value: 2,
|
|
104
104
|
content: t('PICKUP', 'Pickup'),
|
|
105
|
-
description: t('ORDERTYPE_DESCRIPTION_PICKUP', '
|
|
105
|
+
description: t('ORDERTYPE_DESCRIPTION_PICKUP', 'Pickup description')
|
|
106
106
|
},
|
|
107
107
|
{
|
|
108
108
|
value: 3,
|
|
109
109
|
content: t('EAT_IN', 'Eat in'),
|
|
110
|
-
description: t('ORDERTYPE_DESCRIPTION_EATIN', '
|
|
110
|
+
description: t('ORDERTYPE_DESCRIPTION_EATIN', 'Eat in description')
|
|
111
111
|
},
|
|
112
112
|
{
|
|
113
113
|
value: 4,
|
|
114
114
|
content: t('CURBSIDE', 'Curbside'),
|
|
115
|
-
description: t('ORDERTYPE_DESCRIPTION_CURBSIDE', '
|
|
115
|
+
description: t('ORDERTYPE_DESCRIPTION_CURBSIDE', 'Curbside description')
|
|
116
116
|
},
|
|
117
117
|
{
|
|
118
118
|
value: 5,
|
|
119
119
|
content: t('DRIVE_THRU', 'Drive thru'),
|
|
120
|
-
description: t('ORDERTYPE_DESCRIPTION_DRIVETHRU', '
|
|
120
|
+
description: t('ORDERTYPE_DESCRIPTION_DRIVETHRU', 'Drive Thru description')
|
|
121
121
|
}
|
|
122
122
|
]
|
|
123
123
|
}
|
|
@@ -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}>
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react'
|
|
2
|
-
import { useLanguage } from 'ordering-components/native'
|
|
3
|
-
import { useGooglePay, ApplePayButton, useApplePay } from '@stripe/stripe-react-native'
|
|
4
|
-
import { OButton } from '../shared';
|
|
5
|
-
import { Platform, View } from 'react-native';
|
|
6
|
-
import { StripeMethodFormParams } from '../../types';
|
|
7
|
-
import Spinner from 'react-native-loading-spinner-overlay';
|
|
8
|
-
import { android_app_id } from '../../config.json'
|
|
9
|
-
export const StripeMethodForm = (props: StripeMethodFormParams) => {
|
|
10
|
-
const {
|
|
11
|
-
cart,
|
|
12
|
-
handleSource,
|
|
13
|
-
onCancel,
|
|
14
|
-
setErrors,
|
|
15
|
-
paymethod,
|
|
16
|
-
devMode
|
|
17
|
-
} = props
|
|
18
|
-
const { initGooglePay, createGooglePayPaymentMethod, loading } = useGooglePay();
|
|
19
|
-
const { presentApplePay, isApplePaySupported } = useApplePay();
|
|
20
|
-
const [initialized, setInitialized] = useState(false);
|
|
21
|
-
const [loadingGooglePayment, setLoadingGooglePayment] = useState(false)
|
|
22
|
-
const [, t] = useLanguage()
|
|
23
|
-
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
if (paymethod !== 'google_pay' || !initGooglePay) return
|
|
26
|
-
if (Platform.OS === 'ios') {
|
|
27
|
-
setErrors(t('GOOGLE_PAY_NOT_SUPPORTED', 'Google pay not supported'))
|
|
28
|
-
return
|
|
29
|
-
}
|
|
30
|
-
const initialize = async () => {
|
|
31
|
-
try {
|
|
32
|
-
const { error } = await initGooglePay({
|
|
33
|
-
testEnv: devMode,
|
|
34
|
-
merchantName: android_app_id,
|
|
35
|
-
countryCode: 'US',
|
|
36
|
-
billingAddressConfig: {
|
|
37
|
-
format: 'FULL',
|
|
38
|
-
isPhoneNumberRequired: true,
|
|
39
|
-
isRequired: false,
|
|
40
|
-
},
|
|
41
|
-
existingPaymentMethodRequired: false,
|
|
42
|
-
isEmailRequired: true,
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
if (error) {
|
|
46
|
-
setErrors(error.code + ' - ' + error.message);
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
setInitialized(true);
|
|
50
|
-
} catch (err: any) {
|
|
51
|
-
setErrors('Catch ' + err?.message)
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
initialize();
|
|
55
|
-
}, [initGooglePay]);
|
|
56
|
-
|
|
57
|
-
useEffect(() => {
|
|
58
|
-
if (paymethod !== 'apple_pay') return
|
|
59
|
-
if (Platform.OS === 'android') {
|
|
60
|
-
setErrors(t('APPLE_PAY_NOT_SUPPORTED', 'Apple pay not supported'))
|
|
61
|
-
return
|
|
62
|
-
}
|
|
63
|
-
}, [])
|
|
64
|
-
|
|
65
|
-
const createPaymentMethod = async () => {
|
|
66
|
-
setLoadingGooglePayment(true)
|
|
67
|
-
const { error, paymentMethod } = await createGooglePayPaymentMethod({
|
|
68
|
-
amount: cart?.balance ?? cart?.total,
|
|
69
|
-
currencyCode: 'USD',
|
|
70
|
-
});
|
|
71
|
-
if (error) {
|
|
72
|
-
setErrors(error.code + ' - ' + error.message);
|
|
73
|
-
setLoadingGooglePayment(false)
|
|
74
|
-
return;
|
|
75
|
-
} else if (paymentMethod) {
|
|
76
|
-
handleSource({
|
|
77
|
-
...paymentMethod?.Card,
|
|
78
|
-
id: paymentMethod.id,
|
|
79
|
-
type: paymentMethod.type,
|
|
80
|
-
source_id: paymentMethod?.id,
|
|
81
|
-
card: {
|
|
82
|
-
brand: paymentMethod.Card.brand,
|
|
83
|
-
last4: paymentMethod.Card.last4
|
|
84
|
-
}
|
|
85
|
-
})
|
|
86
|
-
onCancel()
|
|
87
|
-
setLoadingGooglePayment(false)
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
const pay = async () => {
|
|
92
|
-
if (!isApplePaySupported) {
|
|
93
|
-
setErrors(t('APPLE_PAY_NOT_SUPPORTED', 'Apple pay not supported'))
|
|
94
|
-
return
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const { error, paymentMethod } = await presentApplePay({
|
|
98
|
-
cartItems: cart?.products?.map((product: any) => ({ label: product?.name, amount: product?.price?.toString?.() })),
|
|
99
|
-
country: 'US',
|
|
100
|
-
currency: 'USD',
|
|
101
|
-
shippingMethods: [
|
|
102
|
-
{
|
|
103
|
-
amount: cart?.balance?.toString() ?? cart?.total?.toString?.(),
|
|
104
|
-
identifier: 'DPS',
|
|
105
|
-
label: 'Courier',
|
|
106
|
-
detail: 'Delivery',
|
|
107
|
-
type: 'final',
|
|
108
|
-
},
|
|
109
|
-
],
|
|
110
|
-
|
|
111
|
-
requiredShippingAddressFields: ['emailAddress', 'phoneNumber'],
|
|
112
|
-
requiredBillingContactFields: ['phoneNumber', 'name'],
|
|
113
|
-
});
|
|
114
|
-
if (error) {
|
|
115
|
-
setErrors(error.code + ' - ' + error.message);
|
|
116
|
-
} else if (paymentMethod) {
|
|
117
|
-
handleSource({
|
|
118
|
-
...paymentMethod?.Card,
|
|
119
|
-
id: paymentMethod.id,
|
|
120
|
-
type: paymentMethod.type,
|
|
121
|
-
source_id: paymentMethod?.id,
|
|
122
|
-
card: {
|
|
123
|
-
brand: paymentMethod.Card.brand,
|
|
124
|
-
last4: paymentMethod.Card.last4
|
|
125
|
-
}
|
|
126
|
-
})
|
|
127
|
-
onCancel()
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
return (
|
|
132
|
-
<>
|
|
133
|
-
{paymethod === 'google_pay' ? (
|
|
134
|
-
<View>
|
|
135
|
-
<OButton
|
|
136
|
-
textStyle={{
|
|
137
|
-
color: '#fff'
|
|
138
|
-
}}
|
|
139
|
-
imgRightSrc={null}
|
|
140
|
-
onClick={createPaymentMethod}
|
|
141
|
-
isDisabled={loading || !initialized}
|
|
142
|
-
text={t('PAY_WITH_GOOGLE_PAY', 'Pay with Google Pay')}
|
|
143
|
-
isLoading={loading || !initialized}
|
|
144
|
-
style={{ marginTop: 20 }}
|
|
145
|
-
/>
|
|
146
|
-
</View>
|
|
147
|
-
) : (
|
|
148
|
-
<View>
|
|
149
|
-
{isApplePaySupported && (
|
|
150
|
-
<ApplePayButton
|
|
151
|
-
onPress={pay}
|
|
152
|
-
type="plain"
|
|
153
|
-
buttonStyle="black"
|
|
154
|
-
borderRadius={4}
|
|
155
|
-
style={{
|
|
156
|
-
width: '100%',
|
|
157
|
-
height: 50,
|
|
158
|
-
}}
|
|
159
|
-
/>
|
|
160
|
-
)}
|
|
161
|
-
</View>
|
|
162
|
-
)}
|
|
163
|
-
<Spinner
|
|
164
|
-
visible={loadingGooglePayment}
|
|
165
|
-
/>
|
|
166
|
-
</>
|
|
167
|
-
)
|
|
168
|
-
}
|