ordering-ui-react-native 0.12.55 → 0.12.59
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 +1 -1
- package/src/components/Cart/index.tsx +50 -16
- package/src/components/OrderDetails/index.tsx +8 -0
- package/src/components/OrderSummary/index.tsx +38 -3
- package/src/layouts/Container.tsx +1 -1
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +8 -0
- package/themes/business/src/components/OrderDetails/styles.tsx +1 -0
- package/themes/business/src/layouts/Container.tsx +3 -1
- package/themes/doordash/src/components/Cart/index.tsx +37 -2
- package/themes/doordash/src/components/OrderDetails/index.tsx +8 -0
- package/themes/doordash/src/components/OrderSummary/index.tsx +37 -3
- package/themes/doordash/src/layouts/Container.tsx +1 -1
- package/themes/instacart/src/components/Cart/index.tsx +37 -3
- package/themes/instacart/src/components/OrderDetails/index.tsx +8 -0
- package/themes/instacart/src/components/OrderSummary/index.tsx +37 -4
- package/themes/instacart/src/layouts/Container.tsx +1 -1
- package/themes/kiosk/src/layouts/Container.tsx +2 -1
- package/themes/original/src/components/Cart/index.tsx +268 -234
- package/themes/original/src/components/OrderDetails/index.tsx +723 -715
- package/themes/original/src/components/OrderSummary/index.tsx +37 -3
- package/themes/original/src/layouts/Container.tsx +1 -1
- package/themes/single-business/src/components/Cart/index.tsx +127 -16
- package/themes/single-business/src/components/Cart/styles.tsx +39 -0
- package/themes/single-business/src/components/CartContent/index.tsx +56 -52
- package/themes/single-business/src/components/CartContent/styles.tsx +2 -16
- package/themes/single-business/src/components/OrderDetails/index.tsx +724 -708
- package/themes/single-business/src/components/OrderSummary/index.tsx +189 -154
- package/themes/single-business/src/layouts/Container.tsx +1 -1
- package/themes/uber-eats/src/components/Cart/index.tsx +37 -3
- package/themes/uber-eats/src/components/OrderDetails/index.tsx +8 -0
- package/themes/uber-eats/src/components/OrderSummary/index.tsx +40 -6
- package/themes/uber-eats/src/layouts/Container.tsx +1 -1
- package/themes/franchises/index.tsx +0 -111
- package/themes/franchises/src/components/ActiveOrders/index.tsx +0 -134
- package/themes/franchises/src/components/ActiveOrders/styles.tsx +0 -44
- package/themes/franchises/src/components/AddressDetails/index.tsx +0 -77
- package/themes/franchises/src/components/AddressDetails/styles.tsx +0 -21
- package/themes/franchises/src/components/AddressForm/index.tsx +0 -837
- package/themes/franchises/src/components/AddressForm/styles.tsx +0 -27
- package/themes/franchises/src/components/AddressList/index.tsx +0 -338
- package/themes/franchises/src/components/AddressList/styles.tsx +0 -20
- package/themes/franchises/src/components/AppleLogin/index.tsx +0 -149
- package/themes/franchises/src/components/AppleLogin/styles.tsx +0 -21
- package/themes/franchises/src/components/BottomWrapper/index.tsx +0 -29
- package/themes/franchises/src/components/BusinessBasicInformation/index.tsx +0 -310
- package/themes/franchises/src/components/BusinessBasicInformation/styles.tsx +0 -66
- package/themes/franchises/src/components/BusinessController/index.tsx +0 -184
- package/themes/franchises/src/components/BusinessController/styles.tsx +0 -64
- package/themes/franchises/src/components/BusinessFeaturedController/index.tsx +0 -189
- package/themes/franchises/src/components/BusinessFeaturedController/styles.tsx +0 -50
- package/themes/franchises/src/components/BusinessInformation/index.tsx +0 -202
- package/themes/franchises/src/components/BusinessInformation/styles.tsx +0 -39
- package/themes/franchises/src/components/BusinessItemAccordion/index.tsx +0 -125
- package/themes/franchises/src/components/BusinessItemAccordion/styles.tsx +0 -54
- package/themes/franchises/src/components/BusinessProductsCategories/index.tsx +0 -87
- package/themes/franchises/src/components/BusinessProductsCategories/styles.tsx +0 -8
- package/themes/franchises/src/components/BusinessProductsList/index.tsx +0 -199
- package/themes/franchises/src/components/BusinessProductsList/styles.tsx +0 -14
- package/themes/franchises/src/components/BusinessProductsListing/index.tsx +0 -292
- package/themes/franchises/src/components/BusinessProductsListing/styles.tsx +0 -30
- package/themes/franchises/src/components/BusinessReviews/index.tsx +0 -249
- package/themes/franchises/src/components/BusinessReviews/styles.tsx +0 -59
- package/themes/franchises/src/components/BusinessTypeFilter/index.tsx +0 -127
- package/themes/franchises/src/components/BusinessTypeFilter/styles.tsx +0 -40
- package/themes/franchises/src/components/BusinessesListing/index.tsx +0 -339
- package/themes/franchises/src/components/BusinessesListing/styles.tsx +0 -92
- package/themes/franchises/src/components/Cart/index.tsx +0 -298
- package/themes/franchises/src/components/Cart/styles.tsx +0 -28
- package/themes/franchises/src/components/CartContent/index.tsx +0 -60
- package/themes/franchises/src/components/CartContent/styles.tsx +0 -19
- package/themes/franchises/src/components/Checkout/index.tsx +0 -664
- package/themes/franchises/src/components/Checkout/styles.tsx +0 -89
- package/themes/franchises/src/components/CouponControl/index.tsx +0 -119
- package/themes/franchises/src/components/CouponControl/styles.tsx +0 -22
- package/themes/franchises/src/components/DriverTips/index.tsx +0 -167
- package/themes/franchises/src/components/DriverTips/styles.tsx +0 -63
- package/themes/franchises/src/components/FacebookLogin/index.tsx +0 -107
- package/themes/franchises/src/components/FacebookLogin/styles.tsx +0 -21
- package/themes/franchises/src/components/FloatingButton/index.tsx +0 -100
- package/themes/franchises/src/components/FloatingButton/styles.tsx +0 -26
- package/themes/franchises/src/components/ForgotPasswordForm/index.tsx +0 -156
- package/themes/franchises/src/components/ForgotPasswordForm/styles.tsx +0 -11
- package/themes/franchises/src/components/GPSButton/index.tsx +0 -84
- package/themes/franchises/src/components/GPSButton/styles.ts +0 -6
- package/themes/franchises/src/components/GoogleLogin/index.tsx +0 -122
- package/themes/franchises/src/components/GoogleLogin/styles.tsx +0 -23
- package/themes/franchises/src/components/GoogleMap/index.tsx +0 -229
- package/themes/franchises/src/components/Help/index.tsx +0 -56
- package/themes/franchises/src/components/Help/styles.tsx +0 -11
- package/themes/franchises/src/components/HelpAccountAndPayment/index.tsx +0 -68
- package/themes/franchises/src/components/HelpAccountAndPayment/styles.tsx +0 -6
- package/themes/franchises/src/components/HelpGuide/index.tsx +0 -67
- package/themes/franchises/src/components/HelpGuide/styles.tsx +0 -6
- package/themes/franchises/src/components/HelpOrder/index.tsx +0 -79
- package/themes/franchises/src/components/HelpOrder/styles.tsx +0 -6
- package/themes/franchises/src/components/Home/index.tsx +0 -102
- package/themes/franchises/src/components/Home/styles.tsx +0 -18
- package/themes/franchises/src/components/LanguageSelector/index.tsx +0 -98
- package/themes/franchises/src/components/LanguageSelector/styles.tsx +0 -7
- package/themes/franchises/src/components/LastOrder/index.tsx +0 -168
- package/themes/franchises/src/components/LastOrder/styles.tsx +0 -16
- package/themes/franchises/src/components/LastOrders/index.tsx +0 -104
- package/themes/franchises/src/components/LastOrders/styles.tsx +0 -17
- package/themes/franchises/src/components/LoginForm/index.tsx +0 -512
- package/themes/franchises/src/components/LoginForm/styles.tsx +0 -77
- package/themes/franchises/src/components/LogoutButton/index.tsx +0 -36
- package/themes/franchises/src/components/Messages/index.tsx +0 -359
- package/themes/franchises/src/components/Messages/styles.tsx +0 -20
- package/themes/franchises/src/components/MomentOption/index.tsx +0 -321
- package/themes/franchises/src/components/MomentOption/styles.tsx +0 -66
- package/themes/franchises/src/components/NavBar/index.tsx +0 -129
- package/themes/franchises/src/components/NotFoundSource/index.tsx +0 -50
- package/themes/franchises/src/components/NotFoundSource/styles.tsx +0 -16
- package/themes/franchises/src/components/Notifications/index.tsx +0 -120
- package/themes/franchises/src/components/Notifications/styles.ts +0 -21
- package/themes/franchises/src/components/OrderDetails/index.tsx +0 -820
- package/themes/franchises/src/components/OrderDetails/styles.tsx +0 -120
- package/themes/franchises/src/components/OrderSummary/index.tsx +0 -232
- package/themes/franchises/src/components/OrderSummary/styles.tsx +0 -41
- package/themes/franchises/src/components/OrderTypeSelector/index.tsx +0 -92
- package/themes/franchises/src/components/OrderTypeSelector/styles.tsx +0 -27
- package/themes/franchises/src/components/OrdersOption/index.tsx +0 -243
- package/themes/franchises/src/components/OrdersOption/styles.tsx +0 -5
- package/themes/franchises/src/components/PaymentOptionCash/index.tsx +0 -102
- package/themes/franchises/src/components/PaymentOptionCash/styles.tsx +0 -18
- package/themes/franchises/src/components/PaymentOptionStripe/index.tsx +0 -234
- package/themes/franchises/src/components/PaymentOptionStripe/styles.tsx +0 -71
- package/themes/franchises/src/components/PaymentOptions/index.tsx +0 -430
- package/themes/franchises/src/components/PaymentOptions/styles.tsx +0 -77
- package/themes/franchises/src/components/PhoneInputNumber/index.tsx +0 -127
- package/themes/franchises/src/components/PhoneInputNumber/styles.tsx +0 -3
- package/themes/franchises/src/components/PreviousOrders/index.tsx +0 -188
- package/themes/franchises/src/components/PreviousOrders/styles.tsx +0 -33
- package/themes/franchises/src/components/ProductForm/index.tsx +0 -695
- package/themes/franchises/src/components/ProductForm/styles.tsx +0 -78
- package/themes/franchises/src/components/ProductIngredient/index.tsx +0 -43
- package/themes/franchises/src/components/ProductIngredient/styles.tsx +0 -7
- package/themes/franchises/src/components/ProductItemAccordion/index.tsx +0 -276
- package/themes/franchises/src/components/ProductItemAccordion/styles.tsx +0 -57
- package/themes/franchises/src/components/ProductOption/index.tsx +0 -50
- package/themes/franchises/src/components/ProductOption/styles.tsx +0 -11
- package/themes/franchises/src/components/ProductOptionSubOption/index.tsx +0 -146
- package/themes/franchises/src/components/ProductOptionSubOption/styles.tsx +0 -32
- package/themes/franchises/src/components/ReviewDriver/index.tsx +0 -221
- package/themes/franchises/src/components/ReviewDriver/styles.tsx +0 -46
- package/themes/franchises/src/components/ReviewOrder/index.tsx +0 -325
- package/themes/franchises/src/components/ReviewOrder/styles.tsx +0 -46
- package/themes/franchises/src/components/ReviewProduct/index.tsx +0 -275
- package/themes/franchises/src/components/ReviewProduct/styles.tsx +0 -53
- package/themes/franchises/src/components/SearchBar/index.tsx +0 -139
- package/themes/franchises/src/components/SignupForm/index.tsx +0 -643
- package/themes/franchises/src/components/SignupForm/styles.tsx +0 -27
- package/themes/franchises/src/components/SingleProductCard/index.tsx +0 -124
- package/themes/franchises/src/components/SingleProductCard/styles.tsx +0 -23
- package/themes/franchises/src/components/StripeCardForm/index.tsx +0 -97
- package/themes/franchises/src/components/StripeCardForm/naked.tsx +0 -128
- package/themes/franchises/src/components/StripeCardForm/styles.tsx +0 -32
- package/themes/franchises/src/components/StripeCardsList/index.tsx +0 -182
- package/themes/franchises/src/components/StripeElementsForm/index.tsx +0 -204
- package/themes/franchises/src/components/StripeElementsForm/naked.tsx +0 -90
- package/themes/franchises/src/components/StripeElementsForm/styles.tsx +0 -13
- package/themes/franchises/src/components/StripeRedirectForm/index.tsx +0 -159
- package/themes/franchises/src/components/StripeRedirectForm/styles.tsx +0 -23
- package/themes/franchises/src/components/TagSelector/index.tsx +0 -94
- package/themes/franchises/src/components/TagSelector/styles.ts +0 -0
- package/themes/franchises/src/components/TaxInformation/index.tsx +0 -51
- package/themes/franchises/src/components/TaxInformation/styles.tsx +0 -9
- package/themes/franchises/src/components/UpsellingProducts/index.tsx +0 -222
- package/themes/franchises/src/components/UpsellingProducts/styles.tsx +0 -50
- package/themes/franchises/src/components/UserDetails/index.tsx +0 -134
- package/themes/franchises/src/components/UserDetails/styles.tsx +0 -26
- package/themes/franchises/src/components/UserFormDetails/index.tsx +0 -351
- package/themes/franchises/src/components/UserFormDetails/styles.tsx +0 -35
- package/themes/franchises/src/components/UserProfile/index.tsx +0 -179
- package/themes/franchises/src/components/UserProfile/styles.ts +0 -42
- package/themes/franchises/src/components/UserProfileForm/index.tsx +0 -253
- package/themes/franchises/src/components/UserProfileForm/styles.tsx +0 -29
- package/themes/franchises/src/components/VerifyPhone/index.tsx +0 -188
- package/themes/franchises/src/components/VerifyPhone/styles.tsx +0 -43
- package/themes/franchises/src/components/shared/OAlert.tsx +0 -55
- package/themes/franchises/src/components/shared/OBottomPopup.tsx +0 -73
- package/themes/franchises/src/components/shared/OBottomStickBar.tsx +0 -62
- package/themes/franchises/src/components/shared/OButton.tsx +0 -132
- package/themes/franchises/src/components/shared/ODropDown.tsx +0 -169
- package/themes/franchises/src/components/shared/OIcon.tsx +0 -53
- package/themes/franchises/src/components/shared/OIconButton.tsx +0 -127
- package/themes/franchises/src/components/shared/OIconText.tsx +0 -54
- package/themes/franchises/src/components/shared/OInput.tsx +0 -113
- package/themes/franchises/src/components/shared/OKeyButton.tsx +0 -35
- package/themes/franchises/src/components/shared/OModal.tsx +0 -172
- package/themes/franchises/src/components/shared/OText.tsx +0 -52
- package/themes/franchises/src/components/shared/OTextarea.tsx +0 -36
- package/themes/franchises/src/components/shared/OToast.tsx +0 -93
- package/themes/franchises/src/components/shared/OToggle.tsx +0 -158
- package/themes/franchises/src/components/shared/index.tsx +0 -29
- package/themes/franchises/src/config/constants.tsx +0 -57
- package/themes/franchises/src/layouts/Container.tsx +0 -23
- package/themes/franchises/src/layouts/SafeAreaContainer.tsx +0 -6
- package/themes/franchises/src/providers/AlertProvider.tsx +0 -43
- package/themes/franchises/src/providers/StoreUtil.tsx +0 -50
- package/themes/franchises/src/types/index.tsx +0 -445
- package/themes/franchises/src/utils/index.tsx +0 -222
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { View } from 'react-native'
|
|
2
|
+
import { ActivityIndicator, View } from 'react-native'
|
|
3
3
|
import {
|
|
4
4
|
Cart,
|
|
5
5
|
useOrder,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
|
|
20
20
|
import { ProductItemAccordion } from '../ProductItemAccordion';
|
|
21
21
|
import { CouponControl } from '../CouponControl';
|
|
22
|
-
import { OModal, OText } from '../shared';
|
|
22
|
+
import { OInput, OModal, OText } from '../shared';
|
|
23
23
|
import { ProductForm } from '../ProductForm';
|
|
24
24
|
import { verifyDecimals } from '../../utils';
|
|
25
25
|
import AntIcon from 'react-native-vector-icons/AntDesign'
|
|
@@ -34,7 +34,9 @@ const OrderSummaryUI = (props: any) => {
|
|
|
34
34
|
offsetDisabled,
|
|
35
35
|
removeProduct,
|
|
36
36
|
isCartPending,
|
|
37
|
-
isFromCheckout
|
|
37
|
+
isFromCheckout,
|
|
38
|
+
commentState,
|
|
39
|
+
handleChangeComment
|
|
38
40
|
} = props;
|
|
39
41
|
|
|
40
42
|
const theme = useTheme()
|
|
@@ -188,6 +190,38 @@ const OrderSummaryUI = (props: any) => {
|
|
|
188
190
|
</OSTable>
|
|
189
191
|
</View>
|
|
190
192
|
)}
|
|
193
|
+
{cart?.status !== 2 && (
|
|
194
|
+
<OSTable>
|
|
195
|
+
<View style={{ width: '100%', marginTop: 20 }}>
|
|
196
|
+
<OText size={12}>{t('COMMENTS', 'Comments')}</OText>
|
|
197
|
+
<View style={{ flex: 1, width: '100%' }}>
|
|
198
|
+
<OInput
|
|
199
|
+
value={cart?.comment}
|
|
200
|
+
placeholder={t('SPECIAL_COMMENTS', 'Special Comments')}
|
|
201
|
+
onChange={(value: string) => handleChangeComment(value)}
|
|
202
|
+
style={{
|
|
203
|
+
alignItems: 'flex-start',
|
|
204
|
+
width: '100%',
|
|
205
|
+
height: 100,
|
|
206
|
+
borderColor: theme.colors.textSecondary,
|
|
207
|
+
paddingRight: 50,
|
|
208
|
+
marginTop: 10
|
|
209
|
+
}}
|
|
210
|
+
multiline
|
|
211
|
+
/>
|
|
212
|
+
{commentState?.loading && (
|
|
213
|
+
<View style={{ position: 'absolute', right: 20 }}>
|
|
214
|
+
<ActivityIndicator
|
|
215
|
+
size='large'
|
|
216
|
+
style={{ height: 100 }}
|
|
217
|
+
color={theme.colors.primary}
|
|
218
|
+
/>
|
|
219
|
+
</View>
|
|
220
|
+
)}
|
|
221
|
+
</View>
|
|
222
|
+
</View>
|
|
223
|
+
</OSTable>
|
|
224
|
+
)}
|
|
191
225
|
</OSBill>
|
|
192
226
|
)}
|
|
193
227
|
<OModal
|
|
@@ -18,7 +18,7 @@ const SafeAreaStyled = styled.SafeAreaView`
|
|
|
18
18
|
export const Container = (props: any) => {
|
|
19
19
|
return (
|
|
20
20
|
<SafeAreaStyled>
|
|
21
|
-
<ContainerStyled keyboardShouldPersistTaps='handled'
|
|
21
|
+
<ContainerStyled {...props} ref={props?.forwardRef} keyboardShouldPersistTaps='handled' style={{...props.style}}>
|
|
22
22
|
{props.children}
|
|
23
23
|
</ContainerStyled>
|
|
24
24
|
</SafeAreaStyled>
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
useValidationFields,
|
|
9
9
|
} from 'ordering-components/native';
|
|
10
10
|
import { useTheme } from 'styled-components/native';
|
|
11
|
-
import { ScrollView, View, useWindowDimensions } from 'react-native';
|
|
11
|
+
import { ScrollView, View, useWindowDimensions, ActivityIndicator } from 'react-native';
|
|
12
12
|
import {
|
|
13
13
|
CheckoutAction,
|
|
14
14
|
OSBill,
|
|
@@ -16,32 +16,41 @@ import {
|
|
|
16
16
|
OSCoupon,
|
|
17
17
|
OSTotal,
|
|
18
18
|
Title,
|
|
19
|
-
LineDivider
|
|
19
|
+
LineDivider,
|
|
20
|
+
BIHeader,
|
|
21
|
+
BIInfo,
|
|
22
|
+
BIContentInfo,
|
|
23
|
+
BITotal
|
|
20
24
|
} from './styles';
|
|
21
25
|
|
|
22
26
|
import { ProductItemAccordion } from '../ProductItemAccordion';
|
|
23
27
|
import { CouponControl } from '../CouponControl';
|
|
24
28
|
|
|
25
|
-
import { OButton, OModal, OText } from '../shared';
|
|
29
|
+
import { OButton, OInput, OModal, OText, OIcon } from '../shared';
|
|
26
30
|
import { ProductForm } from '../ProductForm';
|
|
27
31
|
import { UpsellingProducts } from '../UpsellingProducts';
|
|
28
|
-
import { verifyDecimals } from '../../utils';
|
|
32
|
+
import { convertHoursToMinutes, verifyDecimals } from '../../utils';
|
|
29
33
|
import { Container } from '../../layouts/Container';
|
|
30
34
|
import { NotFoundSource } from '../NotFoundSource'
|
|
31
35
|
import { OSRow } from '../OrderSummary/styles';
|
|
32
36
|
import AntIcon from 'react-native-vector-icons/AntDesign'
|
|
37
|
+
import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons'
|
|
33
38
|
import { TaxInformation } from '../TaxInformation';
|
|
34
39
|
import { TouchableOpacity } from 'react-native';
|
|
40
|
+
|
|
35
41
|
const CartUI = (props: any) => {
|
|
36
42
|
const {
|
|
37
43
|
cart,
|
|
38
44
|
clearCart,
|
|
45
|
+
isCartList,
|
|
39
46
|
changeQuantity,
|
|
40
47
|
getProductMax,
|
|
41
48
|
offsetDisabled,
|
|
42
49
|
removeProduct,
|
|
43
50
|
handleCartOpen,
|
|
44
51
|
setIsCartsLoading,
|
|
52
|
+
handleChangeComment,
|
|
53
|
+
commentState
|
|
45
54
|
} = props
|
|
46
55
|
|
|
47
56
|
const theme = useTheme();
|
|
@@ -62,6 +71,8 @@ const CartUI = (props: any) => {
|
|
|
62
71
|
|
|
63
72
|
const isCartPending = cart?.status === 2
|
|
64
73
|
const isCouponEnabled = validationFields?.fields?.checkout?.coupon?.enabled
|
|
74
|
+
const isClosed = !cart?.valid_schedule
|
|
75
|
+
const isProducts = cart?.products?.length
|
|
65
76
|
|
|
66
77
|
const handleDeleteClick = (product: any) => {
|
|
67
78
|
removeProduct(product, cart)
|
|
@@ -110,22 +121,91 @@ const CartUI = (props: any) => {
|
|
|
110
121
|
}
|
|
111
122
|
}
|
|
112
123
|
|
|
124
|
+
const CartHeader = () => {
|
|
125
|
+
return (
|
|
126
|
+
<BIHeader isClosed={isClosed}>
|
|
127
|
+
<BIInfo>
|
|
128
|
+
{cart?.business?.logo && (
|
|
129
|
+
<View
|
|
130
|
+
style={{
|
|
131
|
+
height: 72,
|
|
132
|
+
width: 72,
|
|
133
|
+
borderWidth: 1,
|
|
134
|
+
borderColor: theme.colors.border,
|
|
135
|
+
borderRadius: 8
|
|
136
|
+
}}
|
|
137
|
+
>
|
|
138
|
+
<OIcon
|
|
139
|
+
url={cart?.business?.logo}
|
|
140
|
+
width={70}
|
|
141
|
+
height={70}
|
|
142
|
+
style={{ borderRadius: 16 }}
|
|
143
|
+
/>
|
|
144
|
+
</View>
|
|
145
|
+
)}
|
|
146
|
+
<BIContentInfo>
|
|
147
|
+
<OText>{cart?.business?.name}</OText>
|
|
148
|
+
{orderState?.options?.type === 1 ? (
|
|
149
|
+
<View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
|
|
150
|
+
<MaterialCommunityIcon
|
|
151
|
+
name='clock-outline'
|
|
152
|
+
size={20}
|
|
153
|
+
/>
|
|
154
|
+
<OText size={12}>{convertHoursToMinutes(cart?.business?.delivery_time)}</OText>
|
|
155
|
+
</View>
|
|
156
|
+
) : (
|
|
157
|
+
<View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
|
|
158
|
+
<MaterialCommunityIcon
|
|
159
|
+
name='clock-outline'
|
|
160
|
+
size={20}
|
|
161
|
+
/>
|
|
162
|
+
<OText size={12}>{convertHoursToMinutes(cart?.business?.pickup_time)}</OText>
|
|
163
|
+
</View>
|
|
164
|
+
)}
|
|
165
|
+
</BIContentInfo>
|
|
166
|
+
</BIInfo>
|
|
167
|
+
|
|
168
|
+
{!isClosed && !!isProducts && cart?.valid_products && cart?.total > 0 && (
|
|
169
|
+
<BITotal>
|
|
170
|
+
<OText size={12}>{t('CART_TOTAL', 'Total')}</OText>
|
|
171
|
+
<OText size={12} color='#000'>{parsePrice(cart?.total)}</OText>
|
|
172
|
+
</BITotal>
|
|
173
|
+
)}
|
|
174
|
+
|
|
175
|
+
{isClosed && (
|
|
176
|
+
<BITotal>
|
|
177
|
+
<OText>{t('CLOSED', 'Closed')}</OText>
|
|
178
|
+
</BITotal>
|
|
179
|
+
)}
|
|
180
|
+
|
|
181
|
+
{!isClosed && !isProducts && (
|
|
182
|
+
<BITotal>
|
|
183
|
+
<OText>{t('NO_PRODUCTS', 'No products')}</OText>
|
|
184
|
+
</BITotal>
|
|
185
|
+
)}
|
|
186
|
+
</BIHeader>
|
|
187
|
+
)
|
|
188
|
+
}
|
|
189
|
+
|
|
113
190
|
return (
|
|
114
191
|
cart?.products?.length > 0 ? (
|
|
115
192
|
<ScrollView
|
|
116
193
|
showsVerticalScrollIndicator={false}
|
|
117
194
|
showsHorizontalScrollIndicator={false}
|
|
118
|
-
style={{ height, backgroundColor: theme.colors.backgroundPage }}
|
|
195
|
+
style={{ height: isCartList ? 'auto' : height, backgroundColor: theme.colors.backgroundPage }}
|
|
119
196
|
>
|
|
120
|
-
<Container>
|
|
121
|
-
|
|
122
|
-
<
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
197
|
+
<Container noPadding={isCartList}>
|
|
198
|
+
{!isCartList ? (
|
|
199
|
+
<Title>
|
|
200
|
+
<OText
|
|
201
|
+
size={20}
|
|
202
|
+
>
|
|
203
|
+
{t('YOUR_CART', 'Your cart')}
|
|
204
|
+
</OText>
|
|
205
|
+
</Title>
|
|
206
|
+
) : (
|
|
207
|
+
<CartHeader />
|
|
208
|
+
)}
|
|
129
209
|
|
|
130
210
|
{cart?.products?.length > 0 && (
|
|
131
211
|
<View>
|
|
@@ -237,6 +317,38 @@ const CartUI = (props: any) => {
|
|
|
237
317
|
</OText>
|
|
238
318
|
</OSTable>
|
|
239
319
|
</OSTotal>
|
|
320
|
+
{cart?.status !== 2 && (
|
|
321
|
+
<OSTable>
|
|
322
|
+
<View style={{ width: '100%', marginTop: 20 }}>
|
|
323
|
+
<OText size={12}>{t('COMMENTS', 'Comments')}</OText>
|
|
324
|
+
<View style={{ flex: 1, width: '100%' }}>
|
|
325
|
+
<OInput
|
|
326
|
+
value={cart?.comment}
|
|
327
|
+
placeholder={t('SPECIAL_COMMENTS', 'Special Comments')}
|
|
328
|
+
onChange={(value: string) => handleChangeComment(value)}
|
|
329
|
+
style={{
|
|
330
|
+
alignItems: 'flex-start',
|
|
331
|
+
width: '100%',
|
|
332
|
+
height: 100,
|
|
333
|
+
borderColor: theme.colors.textSecondary,
|
|
334
|
+
paddingRight: 50,
|
|
335
|
+
marginTop: 10
|
|
336
|
+
}}
|
|
337
|
+
multiline
|
|
338
|
+
/>
|
|
339
|
+
{commentState?.loading && (
|
|
340
|
+
<View style={{ position: 'absolute', right: 20 }}>
|
|
341
|
+
<ActivityIndicator
|
|
342
|
+
size='large'
|
|
343
|
+
style={{ height: 100 }}
|
|
344
|
+
color={theme.colors.primary}
|
|
345
|
+
/>
|
|
346
|
+
</View>
|
|
347
|
+
)}
|
|
348
|
+
</View>
|
|
349
|
+
</View>
|
|
350
|
+
</OSTable>
|
|
351
|
+
)}
|
|
240
352
|
</OSBill>
|
|
241
353
|
)}
|
|
242
354
|
</View>
|
|
@@ -247,7 +359,7 @@ const CartUI = (props: any) => {
|
|
|
247
359
|
<>
|
|
248
360
|
<LineDivider />
|
|
249
361
|
|
|
250
|
-
<Container>
|
|
362
|
+
<Container noPadding={isCartList}>
|
|
251
363
|
<View style={{ padding: 0, }}>
|
|
252
364
|
<ScrollView
|
|
253
365
|
showsVerticalScrollIndicator={false}
|
|
@@ -323,7 +435,6 @@ const CartUI = (props: any) => {
|
|
|
323
435
|
<Title>
|
|
324
436
|
<OText
|
|
325
437
|
size={20}
|
|
326
|
-
weight='bold'
|
|
327
438
|
>
|
|
328
439
|
{t('YOUR_CART', 'Your cart')}
|
|
329
440
|
</OText>
|
|
@@ -61,3 +61,42 @@ export const OSCoupon = styled.View`
|
|
|
61
61
|
width: 100%;
|
|
62
62
|
padding: 5px 0px;
|
|
63
63
|
`
|
|
64
|
+
|
|
65
|
+
export const BIHeader = styled.View`
|
|
66
|
+
flex-direction: row;
|
|
67
|
+
align-items: center;
|
|
68
|
+
justify-content: space-between;
|
|
69
|
+
border-bottom-width: 1px;
|
|
70
|
+
border-bottom-color: ${(props: any) => props.theme.colors.border};
|
|
71
|
+
padding-bottom: 10px;
|
|
72
|
+
|
|
73
|
+
${(props: any) => props.isClosed && css`
|
|
74
|
+
background-color: rgba(0, 0, 0, 0.1);
|
|
75
|
+
`}
|
|
76
|
+
`
|
|
77
|
+
|
|
78
|
+
export const BIInfo = styled.View`
|
|
79
|
+
display: flex;
|
|
80
|
+
flex-direction: row;
|
|
81
|
+
align-items: center;
|
|
82
|
+
width: 55%;
|
|
83
|
+
`
|
|
84
|
+
|
|
85
|
+
export const BIContent = styled.View`
|
|
86
|
+
`
|
|
87
|
+
|
|
88
|
+
export const BIContentInfo = styled.View`
|
|
89
|
+
display: flex;
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
justify-content: flex-end;
|
|
92
|
+
text-transform: capitalize;
|
|
93
|
+
margin-left: 10px;
|
|
94
|
+
max-width: 65%;
|
|
95
|
+
`
|
|
96
|
+
|
|
97
|
+
export const BITotal = styled.View`
|
|
98
|
+
width: 25%;
|
|
99
|
+
display: flex;
|
|
100
|
+
flex-direction: column;
|
|
101
|
+
align-items: flex-end;
|
|
102
|
+
`
|
|
@@ -1,60 +1,64 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import {
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { useWindowDimensions, View } from 'react-native';
|
|
3
3
|
import { useTheme } from 'styled-components/native';
|
|
4
|
-
import {
|
|
4
|
+
import { useLanguage } from 'ordering-components/native';
|
|
5
|
+
import Spinner from 'react-native-loading-spinner-overlay';
|
|
5
6
|
|
|
7
|
+
import { Title } from './styles';
|
|
6
8
|
import { Cart } from '../Cart';
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import { View } from 'react-native';
|
|
9
|
+
import { NotFoundSource } from '../NotFoundSource';
|
|
10
|
+
import { OText } from '../shared';
|
|
10
11
|
|
|
11
12
|
export const CartContent = (props: any) => {
|
|
12
|
-
|
|
13
|
-
carts,
|
|
14
|
-
isOrderStateCarts
|
|
15
|
-
} = props
|
|
13
|
+
const { carts } = props
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
const { height } = useWindowDimensions()
|
|
16
|
+
const theme = useTheme();
|
|
17
|
+
const [, t] = useLanguage()
|
|
18
|
+
const [isCartsLoading, setIsCartsLoading] = useState(false)
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
20
|
+
return (
|
|
21
|
+
carts?.length > 0 ? (
|
|
22
|
+
<>
|
|
23
|
+
<Title>
|
|
24
|
+
<OText size={20} style={{ marginTop: 20 }}>
|
|
25
|
+
{carts.length > 1 ? t('MY_CARTS', 'My Carts') : t('CART', 'Cart')}
|
|
26
|
+
</OText>
|
|
27
|
+
</Title>
|
|
28
|
+
{carts.map((cart: any, i: number) => (
|
|
29
|
+
<View key={cart.uuid} style={{ overflow: 'visible' }}>
|
|
30
|
+
{cart.products.length > 0 && (
|
|
31
|
+
<>
|
|
32
|
+
<Cart
|
|
33
|
+
cart={cart}
|
|
34
|
+
isCartList
|
|
35
|
+
onNavigationRedirect={props.onNavigationRedirect}
|
|
36
|
+
isCartsLoading={isCartsLoading}
|
|
37
|
+
setIsCartsLoading={setIsCartsLoading}
|
|
38
|
+
/>
|
|
39
|
+
{!(i === (carts.length - 1)) && (
|
|
40
|
+
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginVertical: 20 }} />
|
|
41
|
+
)}
|
|
42
|
+
</>
|
|
43
|
+
)}
|
|
44
|
+
</View>
|
|
45
|
+
))}
|
|
46
|
+
<Spinner visible={isCartsLoading} />
|
|
47
|
+
</>
|
|
48
|
+
) : (
|
|
49
|
+
<>
|
|
50
|
+
<Title>
|
|
51
|
+
<OText size={20}>
|
|
52
|
+
{t('MY_CARTS', 'My Carts')}
|
|
53
|
+
</OText>
|
|
54
|
+
</Title>
|
|
55
|
+
<View style={{ height: height * 0.7, justifyContent: 'center' }}>
|
|
56
|
+
<NotFoundSource
|
|
57
|
+
content={t('NO_CARTS_FOUND', 'Sorry, no carts found')}
|
|
58
|
+
image={theme.images.general.notFound}
|
|
59
|
+
/>
|
|
60
|
+
</View>
|
|
61
|
+
</>
|
|
62
|
+
)
|
|
63
|
+
)
|
|
60
64
|
}
|
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
import styled from 'styled-components/native';
|
|
2
2
|
|
|
3
|
-
export const
|
|
4
|
-
|
|
5
|
-
`
|
|
6
|
-
|
|
7
|
-
export const CCNotCarts = styled.View`
|
|
8
|
-
height: 300px;
|
|
9
|
-
display: flex;
|
|
10
|
-
flex-direction: column;
|
|
11
|
-
justify-content: center;
|
|
12
|
-
align-items: center;
|
|
13
|
-
width: 80%;
|
|
14
|
-
margin: auto;
|
|
15
|
-
`
|
|
16
|
-
|
|
17
|
-
export const CCList = styled.ScrollView`
|
|
18
|
-
padding: 10px 0px;
|
|
3
|
+
export const Title = styled.View`
|
|
4
|
+
margin: 20px 0;
|
|
19
5
|
`
|