ordering-ui-react-native 0.14.89 → 0.14.90-release
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -3
- package/src/DeliveryApp.tsx +34 -2
- package/src/assets/images/no-network.png +0 -0
- package/src/components/BusinessTypeFilter/index.tsx +9 -2
- package/src/components/BusinessTypeFilter/styles.tsx +1 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Cart/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +0 -1
- package/src/components/Home/index.tsx +3 -5
- package/src/components/LanguageSelector/index.tsx +65 -97
- package/src/components/LanguageSelector/styles.tsx +4 -17
- package/src/components/Messages/index.tsx +38 -30
- package/src/components/MomentOption/index.tsx +3 -1
- package/src/components/OrderDetails/index.tsx +26 -5
- package/src/components/PaymentOptions/index.tsx +7 -16
- package/src/components/PaymentOptionsWebView/index.tsx +123 -124
- package/src/components/ProductForm/index.tsx +1 -1
- package/src/components/ProductForm/styles.tsx +1 -0
- package/src/components/StripeElementsForm/index.tsx +27 -48
- package/src/components/UserProfileForm/index.tsx +35 -1
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/config.json +0 -2
- package/src/pages/Checkout.tsx +1 -1
- package/src/providers/AlertProvider.tsx +4 -1
- package/src/theme.json +2 -1
- package/src/types/index.tsx +2 -9
- package/src/utils/index.tsx +2 -1
- package/themes/business/index.tsx +4 -0
- package/themes/business/src/components/Chat/index.tsx +32 -31
- package/themes/business/src/components/NetworkError/index.tsx +61 -0
- package/themes/business/src/components/NetworkError/styles.tsx +11 -0
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -0
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +85 -17
- package/themes/business/src/components/OrdersListManager/index.tsx +871 -0
- package/themes/business/src/components/OrdersListManager/styles.tsx +123 -0
- package/themes/business/src/components/OrdersListManager/utils.tsx +216 -0
- package/themes/business/src/components/OrdersOption/index.tsx +18 -68
- package/themes/business/src/components/OrdersOption/styles.tsx +2 -5
- package/themes/business/src/components/PreviousOrders/index.tsx +34 -11
- package/themes/business/src/components/ReviewCustomer/index.tsx +5 -1
- package/themes/business/src/types/index.tsx +4 -0
- 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/index.tsx +2 -0
- package/themes/kiosk/src/components/BusinessController/index.tsx +27 -6
- package/themes/kiosk/src/components/BusinessController/styles.tsx +1 -1
- package/themes/kiosk/src/components/BusinessProductsListing/index.tsx +51 -24
- package/themes/kiosk/src/components/Cart/index.tsx +1 -1
- package/themes/kiosk/src/components/CartBottomSheet/index.tsx +1 -1
- package/themes/kiosk/src/components/CartBottomSheet/styles.tsx +1 -1
- package/themes/kiosk/src/components/CartContent/index.tsx +13 -3
- package/themes/kiosk/src/components/CartItem/index.tsx +20 -8
- package/themes/kiosk/src/components/CategoriesMenu/index.tsx +7 -5
- package/themes/kiosk/src/components/CustomerName/index.tsx +89 -88
- package/themes/kiosk/src/components/Intro/index.tsx +13 -13
- package/themes/kiosk/src/components/LanguageSelector/index.tsx +12 -8
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/NetworkError/index.tsx +60 -0
- package/themes/kiosk/src/components/NetworkError/styles.tsx +11 -0
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderDetails/index.tsx +2 -2
- package/themes/kiosk/src/components/OrderSummary/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +10 -12
- package/themes/kiosk/src/components/ProductForm/index.tsx +172 -124
- package/themes/kiosk/src/components/ProductForm/styles.tsx +1 -1
- package/themes/kiosk/src/components/ProductOption/index.tsx +1 -0
- package/themes/kiosk/src/components/ProductOption/styles.tsx +1 -0
- package/themes/kiosk/src/components/UpsellingProducts/index.tsx +48 -34
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/components/shared/OCard.tsx +112 -78
- package/themes/kiosk/src/types/index.d.ts +4 -0
- package/themes/original/index.tsx +36 -6
- package/themes/original/src/components/AddressForm/index.tsx +15 -10
- package/themes/original/src/components/AddressList/index.tsx +27 -1
- package/themes/original/src/components/AnalyticsSegment/index.tsx +127 -0
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +11 -7
- package/themes/original/src/components/BusinessController/index.tsx +5 -4
- package/themes/original/src/components/BusinessMenuList/index.tsx +4 -2
- package/themes/original/src/components/BusinessPreorder/index.tsx +142 -121
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
- package/themes/original/src/components/BusinessProductsList/index.tsx +50 -6
- package/themes/original/src/components/BusinessProductsListing/index.tsx +13 -10
- package/themes/original/src/components/BusinessReviews/index.tsx +4 -3
- package/themes/original/src/components/BusinessesListing/index.tsx +23 -22
- package/themes/original/src/components/Cart/index.tsx +43 -10
- package/themes/original/src/components/CartContent/index.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +54 -30
- package/themes/original/src/components/Checkout/styles.tsx +7 -0
- package/themes/original/src/components/CouponControl/index.tsx +1 -0
- package/themes/original/src/components/DriverTips/index.tsx +1 -1
- package/themes/original/src/components/ForgotPasswordForm/index.tsx +8 -12
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +9 -2
- package/themes/original/src/components/LoginForm/index.tsx +83 -68
- package/themes/original/src/components/Messages/index.tsx +24 -21
- package/themes/original/src/components/Messages/styles.tsx +1 -3
- package/themes/original/src/components/MomentOption/index.tsx +127 -152
- package/themes/original/src/components/MomentOption/styles.tsx +42 -18
- package/themes/original/src/components/NetworkError/index.tsx +61 -0
- package/themes/original/src/components/NetworkError/styles.tsx +11 -0
- package/themes/original/src/components/OrderDetails/index.tsx +103 -124
- package/themes/original/src/components/OrderDetails/styles.tsx +3 -1
- package/themes/original/src/components/OrderProgress/index.tsx +2 -3
- package/themes/original/src/components/OrderSummary/index.tsx +35 -2
- package/themes/original/src/components/OrdersOption/index.tsx +16 -40
- package/themes/original/src/components/OrdersOption/styles.tsx +0 -5
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +1 -1
- package/themes/original/src/components/PaymentOptions/index.tsx +21 -24
- package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -8
- package/themes/original/src/components/PlaceSpot/index.tsx +114 -0
- package/themes/original/src/components/PlaceSpot/styles.tsx +11 -0
- package/themes/original/src/components/PreviousOrders/index.tsx +4 -0
- package/themes/original/src/components/ProductForm/index.tsx +154 -105
- package/themes/original/src/components/ProductForm/styles.tsx +5 -3
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +6 -1
- package/themes/original/src/components/ReviewDriver/index.tsx +2 -1
- package/themes/original/src/components/ReviewOrder/index.tsx +2 -17
- package/themes/original/src/components/SignupForm/index.tsx +173 -154
- package/themes/original/src/components/SingleProductCard/index.tsx +6 -13
- package/themes/original/src/components/SingleProductCard/styles.tsx +1 -1
- package/themes/original/src/components/SingleProductReview/index.tsx +4 -0
- package/themes/original/src/components/StripeElementsForm/index.tsx +55 -72
- package/themes/original/src/components/UpsellingProducts/index.tsx +6 -6
- package/themes/original/src/components/UserDetails/index.tsx +4 -95
- package/themes/original/src/components/UserFormDetails/index.tsx +2 -14
- package/themes/original/src/components/UserProfile/index.tsx +16 -9
- package/themes/original/src/components/UserProfileForm/index.tsx +16 -8
- package/themes/original/src/components/VerifyPhone/index.tsx +10 -7
- package/themes/original/src/components/VerifyPhone/styles.tsx +2 -1
- package/themes/original/src/components/shared/HeaderTitle.tsx +20 -0
- package/themes/original/src/components/shared/index.tsx +2 -0
- package/themes/original/src/types/index.tsx +18 -8
- package/themes/single-business/src/components/OrderTypeSelector/index.tsx +5 -5
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/StripeMethodForm/index.tsx +0 -163
package/themes/kiosk/index.tsx
CHANGED
|
@@ -14,6 +14,7 @@ import { LanguageSelector } from './src/components/LanguageSelector'
|
|
|
14
14
|
import { LoginForm } from './src/components/LoginForm'
|
|
15
15
|
import { LogoutPopup } from './src/components/LogoutPopup'
|
|
16
16
|
import Navbar from './src/components/NavBar'
|
|
17
|
+
import { NetworkError } from './src/components/NetworkError'
|
|
17
18
|
import { NotFoundSource } from './src/components/NotFoundSource'
|
|
18
19
|
import OptionCard from './src/components/OptionCard'
|
|
19
20
|
import { OrderDetails } from './src/components/OrderDetails'
|
|
@@ -82,6 +83,7 @@ export {
|
|
|
82
83
|
LoginForm,
|
|
83
84
|
LogoutPopup,
|
|
84
85
|
Navbar,
|
|
86
|
+
NetworkError,
|
|
85
87
|
NotFoundSource,
|
|
86
88
|
OptionCard,
|
|
87
89
|
OrderDetails,
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
BusinessController as BusinessSingleCard,
|
|
7
7
|
useUtils,
|
|
8
8
|
} from 'ordering-components/native';
|
|
9
|
+
import FastImage from 'react-native-fast-image'
|
|
9
10
|
|
|
10
11
|
import { Card, BusinessLogo } from './styles';
|
|
11
12
|
|
|
@@ -26,6 +27,16 @@ export const BusinessControllerUI = (props: any) => {
|
|
|
26
27
|
alignItems: 'center',
|
|
27
28
|
textAlign: 'center',
|
|
28
29
|
marginTop: 10
|
|
30
|
+
},
|
|
31
|
+
logoStyle: {
|
|
32
|
+
width: 120,
|
|
33
|
+
height: 120,
|
|
34
|
+
borderRadius: 8,
|
|
35
|
+
borderWidth: 1,
|
|
36
|
+
borderColor: theme.colors.border,
|
|
37
|
+
flexDirection: 'column',
|
|
38
|
+
justifyContent: 'center',
|
|
39
|
+
alignItems: 'center',
|
|
29
40
|
}
|
|
30
41
|
});
|
|
31
42
|
|
|
@@ -39,12 +50,22 @@ export const BusinessControllerUI = (props: any) => {
|
|
|
39
50
|
activeOpacity={1}
|
|
40
51
|
onPress={() => handleBusinessClick(business)}
|
|
41
52
|
>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
53
|
+
{business?.logo ? (
|
|
54
|
+
<FastImage
|
|
55
|
+
style={styles.logoStyle}
|
|
56
|
+
source={{
|
|
57
|
+
uri: business?.logo,
|
|
58
|
+
priority: FastImage.priority.high,
|
|
59
|
+
cache:FastImage.cacheControl.web
|
|
60
|
+
}}
|
|
61
|
+
resizeMode={FastImage.resizeMode.contain}
|
|
62
|
+
/>
|
|
63
|
+
) : (
|
|
64
|
+
<BusinessLogo
|
|
65
|
+
source={theme.images.dummies.businessLogo}
|
|
66
|
+
resizeMode='contain'
|
|
67
|
+
/>
|
|
68
|
+
)}
|
|
48
69
|
<OText
|
|
49
70
|
size={WIDTH_SCREEN * 0.012}
|
|
50
71
|
numberOfLines={2}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { View, StyleSheet, ScrollView, TouchableOpacity } from 'react-native'
|
|
2
|
+
import { View, StyleSheet, ScrollView, TouchableOpacity, ImageBackground } from 'react-native'
|
|
3
3
|
import { BusinessAndProductList, useLanguage } from 'ordering-components/native'
|
|
4
4
|
import { BusinessProductsListingParams, Business } from '../../types'
|
|
5
5
|
import { OCard, OText, OIcon } from '../shared'
|
|
@@ -7,6 +7,7 @@ import GridContainer from '../../layouts/GridContainer'
|
|
|
7
7
|
import Spinner from 'react-native-loading-spinner-overlay';
|
|
8
8
|
import { LANDSCAPE, useDeviceOrientation } from '../../../../../src/hooks/DeviceOrientation';
|
|
9
9
|
import styled, { useTheme } from 'styled-components/native';
|
|
10
|
+
import FastImage from 'react-native-fast-image'
|
|
10
11
|
|
|
11
12
|
const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
12
13
|
const {navigation, businessState, resetInactivityTimeout, clearInactivityTimeout, bottomSheetVisibility } = props;
|
|
@@ -38,7 +39,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
38
39
|
},
|
|
39
40
|
});
|
|
40
41
|
|
|
41
|
-
const _categories: any = business?.
|
|
42
|
+
const _categories: any = business?.categories;
|
|
42
43
|
let _promos: any = [];
|
|
43
44
|
_categories?.forEach((categ: any) => {
|
|
44
45
|
const _featuredProds = categ?.products?.filter(
|
|
@@ -59,17 +60,17 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
59
60
|
);
|
|
60
61
|
|
|
61
62
|
const RenderCategories = ({ item, cardStyle, widthScreen }: any) => {
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
63
|
+
const stylesCat = StyleSheet.create({
|
|
64
|
+
categoryStyle: {
|
|
65
|
+
height: 150,
|
|
66
|
+
borderRadius: 10,
|
|
67
|
+
padding: 10,
|
|
68
|
+
flexDirection: 'column',
|
|
69
|
+
justifyContent: 'center',
|
|
70
|
+
alignItems: 'center',
|
|
71
|
+
}
|
|
72
|
+
})
|
|
73
|
+
|
|
73
74
|
const WrapText = styled.View`
|
|
74
75
|
height: 90px;
|
|
75
76
|
display: flex;
|
|
@@ -78,6 +79,25 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
78
79
|
border-radius: 10px;
|
|
79
80
|
`
|
|
80
81
|
|
|
82
|
+
const Category = (props: any) => {
|
|
83
|
+
const imageProps = {
|
|
84
|
+
style: props.style,
|
|
85
|
+
source: props.source,
|
|
86
|
+
resizeMode: props.resizeMode,
|
|
87
|
+
}
|
|
88
|
+
return (
|
|
89
|
+
props.uri ? (
|
|
90
|
+
<FastImage {...imageProps}>
|
|
91
|
+
{props.children}
|
|
92
|
+
</FastImage>
|
|
93
|
+
) : (
|
|
94
|
+
<ImageBackground {...imageProps}>
|
|
95
|
+
{props.children}
|
|
96
|
+
</ImageBackground>
|
|
97
|
+
)
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
|
|
81
101
|
return (
|
|
82
102
|
<TouchableOpacity
|
|
83
103
|
key={item.id}
|
|
@@ -92,11 +112,17 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
92
112
|
}}
|
|
93
113
|
>
|
|
94
114
|
<Category
|
|
95
|
-
style={cardStyle}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
115
|
+
style={{ ...cardStyle, ...stylesCat.categoryStyle, width: widthScreen * 0.45 }}
|
|
116
|
+
uri={!!item.images}
|
|
117
|
+
source={!!item.images
|
|
118
|
+
? {
|
|
119
|
+
uri: item.images,
|
|
120
|
+
priority: FastImage.priority.high,
|
|
121
|
+
cache:FastImage.cacheControl.web
|
|
122
|
+
}
|
|
123
|
+
: theme.images.categories.all
|
|
124
|
+
}
|
|
125
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
100
126
|
>
|
|
101
127
|
{item?.inventoried && (
|
|
102
128
|
<View style={styles.soldOut}>
|
|
@@ -111,7 +137,6 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
111
137
|
mLeft={0}
|
|
112
138
|
size={32}
|
|
113
139
|
numberOfLines={1}
|
|
114
|
-
// mBottom={8}
|
|
115
140
|
style={{...props?.titleStyle}}
|
|
116
141
|
weight="bold"
|
|
117
142
|
>
|
|
@@ -121,7 +146,6 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
121
146
|
<OText
|
|
122
147
|
color={theme.colors.white}
|
|
123
148
|
numberOfLines={1}
|
|
124
|
-
// mBottom={4}
|
|
125
149
|
size={18}
|
|
126
150
|
style={{...props?.descriptionStyle}}
|
|
127
151
|
weight="400"
|
|
@@ -161,7 +185,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
161
185
|
const _renderCategories = (): React.ReactElement => (
|
|
162
186
|
<>
|
|
163
187
|
{_renderTitle(t('CATEGORIES', 'Categories'))}
|
|
164
|
-
<GridContainer
|
|
188
|
+
<GridContainer
|
|
165
189
|
style={{
|
|
166
190
|
paddingLeft: orientationState?.orientation === LANDSCAPE
|
|
167
191
|
? bottomSheetVisibility ? orientationState?.dimensions?.width * 0.004 :orientationState?.dimensions?.width * 0.008
|
|
@@ -171,9 +195,12 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
171
195
|
{_categories && _categories.map((category: any) => (
|
|
172
196
|
<OCard
|
|
173
197
|
key={category.id}
|
|
198
|
+
isCentered
|
|
199
|
+
isUri={!!category.image}
|
|
174
200
|
title={category?.name || ''}
|
|
175
|
-
image={{uri: category
|
|
201
|
+
image={category.image ? {uri: category.image} : theme.images.categories.all}
|
|
176
202
|
style={{
|
|
203
|
+
borderRadius: 10,
|
|
177
204
|
width:
|
|
178
205
|
orientationState?.orientation === LANDSCAPE
|
|
179
206
|
? bottomSheetVisibility ? orientationState?.dimensions?.width * 0.145 :orientationState?.dimensions?.width * 0.16
|
|
@@ -183,8 +210,8 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
183
210
|
resetInactivityTimeout()
|
|
184
211
|
navigation.navigate('Category', {
|
|
185
212
|
category,
|
|
186
|
-
categories: business
|
|
187
|
-
businessId: business?.
|
|
213
|
+
categories: business?.categories,
|
|
214
|
+
businessId: business?.id,
|
|
188
215
|
businessSlug: business?.slug,
|
|
189
216
|
clearInactivityTimeout,
|
|
190
217
|
resetInactivityTimeout,
|
|
@@ -379,7 +379,7 @@ const CartUI = (props: any) => {
|
|
|
379
379
|
<ProductForm
|
|
380
380
|
productCart={curProduct}
|
|
381
381
|
businessSlug={cart?.business?.slug}
|
|
382
|
-
businessId={
|
|
382
|
+
businessId={cart?.business_id}
|
|
383
383
|
categoryId={curProduct?.category_id}
|
|
384
384
|
productId={curProduct?.id}
|
|
385
385
|
onSave={handlerProductAction}
|
|
@@ -179,7 +179,7 @@ const CartBottomSheetUI = (props: CartBottomSheetUIProps): React.ReactElement |
|
|
|
179
179
|
<ProductForm
|
|
180
180
|
productCart={curProduct}
|
|
181
181
|
businessSlug={cart?.business?.slug}
|
|
182
|
-
businessId={
|
|
182
|
+
businessId={cart?.business_id}
|
|
183
183
|
categoryId={curProduct?.category_id}
|
|
184
184
|
productId={curProduct?.id}
|
|
185
185
|
onSave={handlerProductAction}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { useLanguage } from 'ordering-components/native';
|
|
3
|
-
|
|
3
|
+
import { useCartBottomSheet } from '../../providers/CartBottomSheetProvider';
|
|
4
4
|
import { CCNotCarts } from './styles';
|
|
5
5
|
|
|
6
6
|
import { Cart } from '../Cart';
|
|
@@ -22,6 +22,7 @@ export const CartContent = (props: any) => {
|
|
|
22
22
|
|
|
23
23
|
const [, t] = useLanguage()
|
|
24
24
|
const [isCartsLoading, setIsCartsLoading] = useState(false)
|
|
25
|
+
const [, { hideCartBottomSheet }] = useCartBottomSheet();
|
|
25
26
|
|
|
26
27
|
const cartProps = {
|
|
27
28
|
navigation,
|
|
@@ -33,6 +34,15 @@ export const CartContent = (props: any) => {
|
|
|
33
34
|
resetInactivityTimeout,
|
|
34
35
|
}
|
|
35
36
|
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (!cart && showNotFound) {
|
|
39
|
+
navigation?.canGoBack()
|
|
40
|
+
? navigation.goBack()
|
|
41
|
+
: props.onNavigationRedirect && props.onNavigationRedirect('Business')
|
|
42
|
+
hideCartBottomSheet()
|
|
43
|
+
}
|
|
44
|
+
}, [cart])
|
|
45
|
+
|
|
36
46
|
const content = (
|
|
37
47
|
<>
|
|
38
48
|
{(isOrderStateCarts && cart) && (
|
|
@@ -46,13 +56,13 @@ export const CartContent = (props: any) => {
|
|
|
46
56
|
}
|
|
47
57
|
</>
|
|
48
58
|
)}
|
|
49
|
-
{(!cart && showNotFound) && (
|
|
59
|
+
{/* {(!cart && showNotFound) && (
|
|
50
60
|
<CCNotCarts>
|
|
51
61
|
<OText size={24} style={{ textAlign: 'center' }}>
|
|
52
62
|
{t('CARTS_NOT_FOUND', 'You don\'t have carts available')}
|
|
53
63
|
</OText>
|
|
54
64
|
</CCNotCarts>
|
|
55
|
-
)}
|
|
65
|
+
)} */}
|
|
56
66
|
<Spinner visible={isCartsLoading} />
|
|
57
67
|
</>
|
|
58
68
|
)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { View, Animated, TouchableOpacity } from 'react-native';
|
|
2
|
+
import { View, Animated, TouchableOpacity, ImageBackground } from 'react-native';
|
|
3
3
|
import { useLanguage, useUtils } from 'ordering-components/native';
|
|
4
|
+
import FastImage from 'react-native-fast-image'
|
|
4
5
|
|
|
5
6
|
import {
|
|
6
7
|
StyledCartItem,
|
|
@@ -70,13 +71,24 @@ const CartItem = (props: CartItemProps) => {
|
|
|
70
71
|
>
|
|
71
72
|
<StyledCartItem>
|
|
72
73
|
<View style={{ flexDirection: 'row' }}>
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
74
|
+
{product?.images ? (
|
|
75
|
+
<FastImage
|
|
76
|
+
style={{ height: 60, width: 80, borderRadius: 6 }}
|
|
77
|
+
source={{
|
|
78
|
+
uri: product?.images,
|
|
79
|
+
priority: FastImage.priority.normal,
|
|
80
|
+
// cache:FastImage.cacheControl.web
|
|
81
|
+
}}
|
|
82
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
83
|
+
/>
|
|
84
|
+
) : (
|
|
85
|
+
<ImageBackground
|
|
86
|
+
style={{ height: 60, width: 80, borderRadius: 6 }}
|
|
87
|
+
source={theme.images.dummies.product}
|
|
88
|
+
imageStyle={{ borderRadius: 6 }}
|
|
89
|
+
resizeMode='cover'
|
|
90
|
+
/>
|
|
91
|
+
)}
|
|
80
92
|
|
|
81
93
|
<View style={{ flexDirection: 'column', justifyContent: 'space-evenly', marginHorizontal: 15, marginTop: 10 }}>
|
|
82
94
|
<View>
|
|
@@ -156,13 +156,17 @@ const CategoriesMenu = (props: any): React.ReactElement => {
|
|
|
156
156
|
<OCard
|
|
157
157
|
key={product.id}
|
|
158
158
|
title={product?.name}
|
|
159
|
-
|
|
159
|
+
isUri={!!product.images}
|
|
160
|
+
image={product.images ? {uri: product.images} : theme.images.dummies.product}
|
|
161
|
+
price={parsePrice(product?.price)}
|
|
162
|
+
description={product?.description}
|
|
163
|
+
prevPrice={product?.offer_price > 0 && parsePrice(product?.offer_price)}
|
|
160
164
|
style={{
|
|
165
|
+
borderRadius: 10,
|
|
161
166
|
width: orientationState?.orientation === LANDSCAPE
|
|
162
167
|
? bottomSheetVisibility ? orientationState?.dimensions?.width * 0.145 :orientationState?.dimensions?.width * 0.16
|
|
163
168
|
: orientationState?.dimensions?.width * 0.20
|
|
164
169
|
}}
|
|
165
|
-
titleStyle={{marginTop: Platform.OS === 'ios' ? orientationState?.orientation === LANDSCAPE ? orientationState?.dimensions.height * 0.05 : orientationState?.dimensions.width * 0.05 : 0}}
|
|
166
170
|
onPress={() => {
|
|
167
171
|
resetInactivityTimeout()
|
|
168
172
|
if (isDrawer) {
|
|
@@ -176,9 +180,6 @@ const CategoriesMenu = (props: any): React.ReactElement => {
|
|
|
176
180
|
});
|
|
177
181
|
}
|
|
178
182
|
}}
|
|
179
|
-
{...(!!product?.description && { description: product?.description } )}
|
|
180
|
-
{...(!!product?.price && { price: parsePrice(product?.price) } )}
|
|
181
|
-
{...(product?.in_offer && { prevPrice: `$${product?.offer_price}` } )}
|
|
182
183
|
/>
|
|
183
184
|
))}
|
|
184
185
|
</GridContainer>
|
|
@@ -212,6 +213,7 @@ const CategoriesMenu = (props: any): React.ReactElement => {
|
|
|
212
213
|
businessId={parseInt(businessId, 10)}
|
|
213
214
|
businessSlug={businessSlug}
|
|
214
215
|
onSave={() => {
|
|
216
|
+
showCartBottomSheet()
|
|
215
217
|
setDrawerValues({ isOpen: !drawerState.isOpen, data: null })
|
|
216
218
|
}}
|
|
217
219
|
navigation={navigation}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
2
|
import { useLanguage, ToastType, useToast } from 'ordering-components/native';
|
|
3
|
-
import { _setStoreData } from '../../../../../src/providers/StoreUtil';
|
|
3
|
+
import { _setStoreData, _removeStoreData } from '../../../../../src/providers/StoreUtil';
|
|
4
4
|
|
|
5
5
|
import { OButton, OInput, OText } from '../shared';
|
|
6
6
|
import { useForm, Controller } from 'react-hook-form';
|
|
@@ -24,10 +24,15 @@ const CustomerName = (props: Props): React.ReactElement => {
|
|
|
24
24
|
const [orientationState] = useDeviceOrientation();
|
|
25
25
|
|
|
26
26
|
const onSubmit = (values: any) => {
|
|
27
|
-
_setStoreData('customer_name', {
|
|
27
|
+
_setStoreData('customer_name', {customerName: values.name});
|
|
28
28
|
onProceedToPay()
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
+
const onSkip = () => {
|
|
32
|
+
_removeStoreData('customer_name')
|
|
33
|
+
onProceedToPay()
|
|
34
|
+
}
|
|
35
|
+
|
|
31
36
|
const styles = StyleSheet.create({
|
|
32
37
|
inputStyle: {
|
|
33
38
|
borderRadius: 4,
|
|
@@ -52,30 +57,26 @@ const CustomerName = (props: Props): React.ReactElement => {
|
|
|
52
57
|
|
|
53
58
|
const goToBack = () => navigation?.goBack();
|
|
54
59
|
|
|
55
|
-
const submitButton
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}}
|
|
70
|
-
/>
|
|
71
|
-
</View>
|
|
72
|
-
);
|
|
60
|
+
const submitButton = (<OButton
|
|
61
|
+
text={t('PROCEED_TO_PAY', 'Proceed to Pay')}
|
|
62
|
+
onClick={handleSubmit(onSubmit)}
|
|
63
|
+
textStyle={{color: theme.colors.primaryContrast, fontSize: 20}}
|
|
64
|
+
parentStyle={{
|
|
65
|
+
height: orientationState?.orientation === PORTRAIT
|
|
66
|
+
? 50 : 100
|
|
67
|
+
}}
|
|
68
|
+
style={{
|
|
69
|
+
width: orientationState?.orientation === PORTRAIT
|
|
70
|
+
? orientationState?.dimensions.width - 40
|
|
71
|
+
: orientationState?.dimensions.width * 0.5,
|
|
72
|
+
}}
|
|
73
|
+
/>);
|
|
73
74
|
|
|
74
|
-
const skipButton
|
|
75
|
-
<View style={{
|
|
75
|
+
const skipButton = (
|
|
76
|
+
<View style={{flex:1, left: orientationState?.dimensions.width * 0.2,}}>
|
|
76
77
|
<OButton
|
|
77
78
|
text={t('SKIP', 'Skip')}
|
|
78
|
-
onClick={
|
|
79
|
+
onClick={onSkip}
|
|
79
80
|
textStyle={{ color: theme.colors.primary, fontSize: 20 }}
|
|
80
81
|
parentStyle={{
|
|
81
82
|
height: orientationState?.orientation === PORTRAIT
|
|
@@ -84,7 +85,7 @@ const CustomerName = (props: Props): React.ReactElement => {
|
|
|
84
85
|
style={{
|
|
85
86
|
backgroundColor: theme.colors.white,
|
|
86
87
|
width: orientationState?.orientation === PORTRAIT
|
|
87
|
-
? orientationState?.dimensions.width
|
|
88
|
+
? orientationState?.dimensions.width - 40
|
|
88
89
|
: orientationState?.dimensions.width * 0.1,
|
|
89
90
|
}}
|
|
90
91
|
/>
|
|
@@ -93,78 +94,78 @@ const CustomerName = (props: Props): React.ReactElement => {
|
|
|
93
94
|
|
|
94
95
|
return (
|
|
95
96
|
<>
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
97
|
+
<Container>
|
|
98
|
+
<NavBar
|
|
99
|
+
title={t('YOUR_NAME', 'Your name')}
|
|
100
|
+
onActionLeft={goToBack}
|
|
101
|
+
btnStyle={{paddingLeft: 0}}
|
|
102
|
+
/>
|
|
103
|
+
<View style={{
|
|
104
|
+
marginVertical: orientationState?.dimensions?.height * 0.08,
|
|
105
|
+
paddingLeft: orientationState?.dimensions?.width * 0.25
|
|
106
|
+
}}>
|
|
107
|
+
<OText
|
|
108
|
+
size={orientationState?.dimensions?.width * 0.05}
|
|
109
|
+
style={{bottom: 20}}
|
|
110
|
+
>
|
|
111
|
+
{t('WHATS_YOUR_NAME', "What's your name?")}
|
|
112
|
+
{/* <OText
|
|
112
113
|
size={orientationState?.dimensions?.width * 0.05}
|
|
113
114
|
weight={'700'}
|
|
114
115
|
>
|
|
115
116
|
{`${t('ORDER_BE_FOR', 'order be for?')}`}
|
|
116
117
|
</OText> */}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
118
|
+
</OText>
|
|
119
|
+
<Controller
|
|
120
|
+
control={control}
|
|
121
|
+
render={({ onChange, value }: any) => (
|
|
122
|
+
<OInput
|
|
123
|
+
placeholder={t('WRITE_YOUR_NAME', 'Write your name')}
|
|
124
|
+
style={{
|
|
125
|
+
...styles.inputStyle,
|
|
126
|
+
width: orientationState?.orientation === PORTRAIT
|
|
127
|
+
? orientationState?.dimensions.width - 40
|
|
128
|
+
: orientationState?.dimensions.width * 0.5,
|
|
129
|
+
}}
|
|
130
|
+
value={value}
|
|
131
|
+
autoCapitalize="words"
|
|
132
|
+
autoCorrect={false}
|
|
133
|
+
onChange={(val: any) => onChange(val)}
|
|
134
|
+
onSubmitEditing={handleSubmit(onSubmit)}
|
|
135
|
+
/>
|
|
136
|
+
)}
|
|
137
|
+
name="name"
|
|
138
|
+
rules={{
|
|
139
|
+
required: t(
|
|
140
|
+
'VALIDATION_ERROR_REQUIRED',
|
|
141
|
+
'The field Customer Name is required',
|
|
142
|
+
).replace('_attribute_', t('REQUEST_COLLECTION_CUSTOMER_NAME', 'Customer Name')),
|
|
143
|
+
pattern: {
|
|
144
|
+
value: /^[a-zA-Z áéíóúüñçÁÉÍÓÚÜÑÇ]+$/i,
|
|
145
|
+
message: t(
|
|
146
|
+
'INVALID_ERROR',
|
|
147
|
+
'Invalid name',
|
|
148
|
+
).replace('_attribute_', t('NAME', 'Name')),
|
|
149
|
+
}
|
|
128
150
|
}}
|
|
129
|
-
|
|
130
|
-
autoCapitalize="words"
|
|
131
|
-
autoCorrect={false}
|
|
132
|
-
onChange={(val: any) => onChange(val)}
|
|
133
|
-
onSubmitEditing={handleSubmit(onSubmit)}
|
|
151
|
+
defaultValue=""
|
|
134
152
|
/>
|
|
135
|
-
)}
|
|
136
|
-
name="name"
|
|
137
|
-
rules={{
|
|
138
|
-
required: t(
|
|
139
|
-
'VALIDATION_ERROR_REQUIRED',
|
|
140
|
-
'The field Customer Name is required',
|
|
141
|
-
).replace('_attribute_', t('REQUEST_COLLECTION_CUSTOMER_NAME', 'Customer Name')),
|
|
142
|
-
pattern: {
|
|
143
|
-
value: /^[a-zA-Z áéíóúüñçÁÉÍÓÚÜÑÇ]+$/i,
|
|
144
|
-
message: t(
|
|
145
|
-
'INVALID_ERROR',
|
|
146
|
-
'Invalid name',
|
|
147
|
-
).replace('_attribute_', t('NAME', 'Name')),
|
|
148
|
-
}
|
|
149
|
-
}}
|
|
150
|
-
defaultValue=""
|
|
151
|
-
/>
|
|
152
153
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
154
|
+
{orientationState?.orientation === LANDSCAPE && submitButton}
|
|
155
|
+
{orientationState?.orientation === LANDSCAPE && skipButton}
|
|
156
|
+
{(orientationState?.orientation === PORTRAIT) && (
|
|
157
|
+
<OSActions>
|
|
158
|
+
{submitButton}
|
|
159
|
+
</OSActions>
|
|
160
|
+
)}
|
|
161
|
+
{(orientationState?.orientation === PORTRAIT) && (
|
|
162
|
+
<OSActions>
|
|
163
|
+
{skipButton}
|
|
164
|
+
</OSActions>
|
|
165
|
+
)}
|
|
166
|
+
</View>
|
|
167
|
+
</Container>
|
|
168
|
+
</>
|
|
168
169
|
);
|
|
169
170
|
};
|
|
170
171
|
|
|
@@ -32,17 +32,17 @@ const Intro = (props: any): React.ReactElement => {
|
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
|
-
<ScrollView
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
>
|
|
35
|
+
// <ScrollView
|
|
36
|
+
// scrollEnabled={false}
|
|
37
|
+
// refreshControl={
|
|
38
|
+
// <RefreshControl
|
|
39
|
+
// refreshing={showLogoutPopup ? false : refreshing}
|
|
40
|
+
// onRefresh={() => setShowLogoutPopup(true)}
|
|
41
|
+
// />
|
|
42
|
+
// }
|
|
43
|
+
// >
|
|
44
44
|
<Pressable onPress={goBusiness}>
|
|
45
|
-
<
|
|
45
|
+
<View style={{ height: orientationState?.dimensions?.height }}>
|
|
46
46
|
{orientationState.orientation === PORTRAIT ? (
|
|
47
47
|
<View
|
|
48
48
|
style={{
|
|
@@ -132,15 +132,15 @@ const Intro = (props: any): React.ReactElement => {
|
|
|
132
132
|
open={showLogoutPopup}
|
|
133
133
|
onClose={() => setShowLogoutPopup(false)}
|
|
134
134
|
/>
|
|
135
|
-
</
|
|
135
|
+
</View>
|
|
136
136
|
</Pressable>
|
|
137
|
-
</ScrollView>
|
|
137
|
+
// </ScrollView>
|
|
138
138
|
);
|
|
139
139
|
};
|
|
140
140
|
|
|
141
141
|
const styles = StyleSheet.create({
|
|
142
142
|
buttonLandStyle: {
|
|
143
|
-
|
|
143
|
+
minWidth: 130,
|
|
144
144
|
marginBottom: 16
|
|
145
145
|
}
|
|
146
146
|
});
|