ordering-ui-react-native 0.12.54 → 0.12.58
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 +36 -2
- package/themes/doordash/src/components/OrderDetails/index.tsx +8 -0
- package/themes/doordash/src/components/OrderSummary/index.tsx +36 -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 +92 -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/PhoneInputNumber/index.tsx +103 -112
- package/themes/single-business/src/components/UserDetails/index.tsx +107 -111
- package/themes/single-business/src/components/UserDetails/styles.tsx +3 -8
- package/themes/single-business/src/components/UserFormDetails/index.tsx +279 -326
- package/themes/single-business/src/components/UserFormDetails/styles.tsx +7 -5
- 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
|
@@ -16,14 +16,14 @@ import { ProductItemAccordion } from '../ProductItemAccordion';
|
|
|
16
16
|
import { BusinessItemAccordion } from '../BusinessItemAccordion';
|
|
17
17
|
import { CouponControl } from '../CouponControl';
|
|
18
18
|
|
|
19
|
-
import { OButton, OModal, OText } from '../shared';
|
|
19
|
+
import { OButton, OInput, OModal, OText } from '../shared';
|
|
20
20
|
import { ProductForm } from '../ProductForm';
|
|
21
21
|
import { UpsellingProducts } from '../UpsellingProducts';
|
|
22
22
|
import { verifyDecimals } from '../../utils';
|
|
23
23
|
import { useTheme } from 'styled-components/native';
|
|
24
24
|
import AntIcon from 'react-native-vector-icons/AntDesign'
|
|
25
25
|
import { TaxInformation } from '../TaxInformation';
|
|
26
|
-
import { TouchableOpacity } from 'react-native';
|
|
26
|
+
import { ActivityIndicator, TouchableOpacity, View } from 'react-native';
|
|
27
27
|
|
|
28
28
|
const CartUI = (props: any) => {
|
|
29
29
|
const {
|
|
@@ -36,7 +36,9 @@ const CartUI = (props: any) => {
|
|
|
36
36
|
handleCartOpen,
|
|
37
37
|
setIsCartsLoading,
|
|
38
38
|
isForceOpenCart,
|
|
39
|
-
isBusinessCart
|
|
39
|
+
isBusinessCart,
|
|
40
|
+
handleChangeComment,
|
|
41
|
+
commentState
|
|
40
42
|
} = props
|
|
41
43
|
|
|
42
44
|
const theme = useTheme()
|
|
@@ -235,6 +237,38 @@ const CartUI = (props: any) => {
|
|
|
235
237
|
</OText>
|
|
236
238
|
</OSTable>
|
|
237
239
|
</OSTotal>
|
|
240
|
+
{cart?.status !== 2 && (
|
|
241
|
+
<OSTable>
|
|
242
|
+
<View style={{ width: '100%', marginTop: 20 }}>
|
|
243
|
+
<OText>{t('COMMENTS', 'Comments')}</OText>
|
|
244
|
+
<View style={{ flex: 1, width: '100%' }}>
|
|
245
|
+
<OInput
|
|
246
|
+
value={cart?.comment}
|
|
247
|
+
placeholder={t('SPECIAL_COMMENTS', 'Special Comments')}
|
|
248
|
+
onChange={(value: string) => handleChangeComment(value)}
|
|
249
|
+
style={{
|
|
250
|
+
alignItems: 'flex-start',
|
|
251
|
+
width: '100%',
|
|
252
|
+
height: 100,
|
|
253
|
+
borderColor: theme.colors.textSecondary,
|
|
254
|
+
paddingRight: 50,
|
|
255
|
+
marginTop: 10
|
|
256
|
+
}}
|
|
257
|
+
multiline
|
|
258
|
+
/>
|
|
259
|
+
{commentState?.loading && (
|
|
260
|
+
<View style={{ position: 'absolute', right: 20 }}>
|
|
261
|
+
<ActivityIndicator
|
|
262
|
+
size='large'
|
|
263
|
+
style={{ height: 100 }}
|
|
264
|
+
color={theme.colors.primary}
|
|
265
|
+
/>
|
|
266
|
+
</View>
|
|
267
|
+
)}
|
|
268
|
+
</View>
|
|
269
|
+
</View>
|
|
270
|
+
</OSTable>
|
|
271
|
+
)}
|
|
238
272
|
</OSBill>
|
|
239
273
|
)}
|
|
240
274
|
</CartContent>
|
|
@@ -410,6 +410,14 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
410
410
|
<OText style={styles.textBold} color={theme.colors.primary}>{parsePrice(order?.summary?.total || order?.total)}</OText>
|
|
411
411
|
</Table>
|
|
412
412
|
</Total>
|
|
413
|
+
{order?.comment && (
|
|
414
|
+
<Table>
|
|
415
|
+
<OText style={{ flex: 1 }}>{t('COMMENT', 'Comment')}</OText>
|
|
416
|
+
<OText style={{ maxWidth: '70%' }}>
|
|
417
|
+
{order?.comment}
|
|
418
|
+
</OText>
|
|
419
|
+
</Table>
|
|
420
|
+
)}
|
|
413
421
|
</OrderBill>
|
|
414
422
|
<OrderCustomer>
|
|
415
423
|
<OText size={18} mBottom={5} style={{ textAlign: 'left' }}>{t('CUSTOMER', 'Customer')}</OText>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { TouchableOpacity, View } from 'react-native'
|
|
2
|
+
import { ActivityIndicator, TouchableOpacity, 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 { useTheme } from 'styled-components/native';
|
|
@@ -34,7 +34,9 @@ const OrderSummaryUI = (props: any) => {
|
|
|
34
34
|
offsetDisabled,
|
|
35
35
|
removeProduct,
|
|
36
36
|
isCartPending,
|
|
37
|
-
isFromCheckout
|
|
37
|
+
isFromCheckout,
|
|
38
|
+
handleChangeComment,
|
|
39
|
+
commentState
|
|
38
40
|
} = props;
|
|
39
41
|
|
|
40
42
|
const theme = useTheme();
|
|
@@ -158,9 +160,9 @@ const OrderSummaryUI = (props: any) => {
|
|
|
158
160
|
{cart?.driver_tip_rate > 0 &&
|
|
159
161
|
parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
|
|
160
162
|
!parseInt(configs?.driver_tip_use_custom?.value, 10) &&
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
163
|
+
(
|
|
164
|
+
`(${verifyDecimals(cart?.driver_tip_rate, parseNumber)}%)`
|
|
165
|
+
)}
|
|
164
166
|
</OText>
|
|
165
167
|
<OText size={16}>{parsePrice(cart?.driver_tip)}</OText>
|
|
166
168
|
</OSTable>
|
|
@@ -187,6 +189,38 @@ const OrderSummaryUI = (props: any) => {
|
|
|
187
189
|
</OSTable>
|
|
188
190
|
</View>
|
|
189
191
|
)}
|
|
192
|
+
{cart?.status !== 2 && (
|
|
193
|
+
<OSTable>
|
|
194
|
+
<View style={{ width: '100%', marginTop: 20 }}>
|
|
195
|
+
<OText>{t('COMMENTS', 'Comments')}</OText>
|
|
196
|
+
<View style={{ flex: 1, width: '100%' }}>
|
|
197
|
+
<OInput
|
|
198
|
+
value={cart?.comment}
|
|
199
|
+
placeholder={t('SPECIAL_COMMENTS', 'Special Comments')}
|
|
200
|
+
onChange={(value: string) => handleChangeComment(value)}
|
|
201
|
+
style={{
|
|
202
|
+
alignItems: 'flex-start',
|
|
203
|
+
width: '100%',
|
|
204
|
+
height: 100,
|
|
205
|
+
borderColor: theme.colors.textSecondary,
|
|
206
|
+
paddingRight: 50,
|
|
207
|
+
marginTop: 10
|
|
208
|
+
}}
|
|
209
|
+
multiline
|
|
210
|
+
/>
|
|
211
|
+
{commentState?.loading && (
|
|
212
|
+
<View style={{ position: 'absolute', right: 20 }}>
|
|
213
|
+
<ActivityIndicator
|
|
214
|
+
size='large'
|
|
215
|
+
style={{ height: 100 }}
|
|
216
|
+
color={theme.colors.primary}
|
|
217
|
+
/>
|
|
218
|
+
</View>
|
|
219
|
+
)}
|
|
220
|
+
</View>
|
|
221
|
+
</View>
|
|
222
|
+
</OSTable>
|
|
223
|
+
)}
|
|
190
224
|
</OSBill>
|
|
191
225
|
)}
|
|
192
226
|
<OModal
|
|
@@ -18,7 +18,7 @@ const ContentView = styled.View`
|
|
|
18
18
|
export const Container = (props: any) => {
|
|
19
19
|
return (
|
|
20
20
|
<SafeAreaStyled>
|
|
21
|
-
<ContainerStyled keyboardShouldPersistTaps='handled'>
|
|
21
|
+
<ContainerStyled ref={props?.forwardRef} keyboardShouldPersistTaps='handled'>
|
|
22
22
|
<ContentView>
|
|
23
23
|
{props.children}
|
|
24
24
|
</ContentView>
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { AddressForm } from './src/components/AddressForm';
|
|
2
|
-
import { AddressDetails } from './src/components/AddressDetails';
|
|
3
|
-
import { Home } from './src/components/Home';
|
|
4
|
-
import { LoginForm } from './src/components/LoginForm';
|
|
5
|
-
import { SignupForm } from './src/components/SignupForm';
|
|
6
|
-
import { ActiveOrders } from './src/components/ActiveOrders';
|
|
7
|
-
import { AddressList } from './src/components/AddressList';
|
|
8
|
-
import { AppleLogin } from './src/components/AppleLogin';
|
|
9
|
-
import { BusinessesListing } from './src/components/BusinessesListing';
|
|
10
|
-
import { BusinessProductsListing } from './src/components/BusinessProductsListing';
|
|
11
|
-
import { CartContent } from './src/components/CartContent';
|
|
12
|
-
import { Checkout } from './src/components/Checkout';
|
|
13
|
-
import { ForgotPasswordForm } from './src/components/ForgotPasswordForm';
|
|
14
|
-
import { MomentOption } from './src/components/MomentOption';
|
|
15
|
-
import { OrdersOption } from './src/components/OrdersOption';
|
|
16
|
-
import { OrderDetails } from './src/components/OrderDetails';
|
|
17
|
-
import { UserProfileForm } from './src/components/UserProfileForm';
|
|
18
|
-
import { ReviewOrder } from './src/components/ReviewOrder';
|
|
19
|
-
import { UserProfile } from './src/components/UserProfile';
|
|
20
|
-
import { NotFoundSource } from './src/components/NotFoundSource';
|
|
21
|
-
import { Help } from './src/components/Help';
|
|
22
|
-
import { HelpOrder } from './src/components/HelpOrder';
|
|
23
|
-
import { HelpGuide } from './src/components/HelpGuide';
|
|
24
|
-
import { HelpAccountAndPayment } from './src/components/HelpAccountAndPayment';
|
|
25
|
-
import { OrderTypeSelector } from './src/components/OrderTypeSelector';
|
|
26
|
-
import Notifications from './src/components/Notifications';
|
|
27
|
-
import { ReviewProduct } from './src/components/ReviewProduct';
|
|
28
|
-
import { ReviewDriver } from './src/components/ReviewDriver';
|
|
29
|
-
|
|
30
|
-
import { Toast } from './src/components/shared/OToast';
|
|
31
|
-
import {
|
|
32
|
-
OText,
|
|
33
|
-
OButton,
|
|
34
|
-
OInput,
|
|
35
|
-
ODropDown,
|
|
36
|
-
OIcon,
|
|
37
|
-
OIconText,
|
|
38
|
-
OIconButton,
|
|
39
|
-
OTextarea,
|
|
40
|
-
OToggle,
|
|
41
|
-
OKeyButton,
|
|
42
|
-
OAlert,
|
|
43
|
-
OModal,
|
|
44
|
-
OBottomPopup,
|
|
45
|
-
} from './src/components/shared';
|
|
46
|
-
|
|
47
|
-
import { Container } from './src/layouts/Container';
|
|
48
|
-
import { SafeAreaContainer } from './src/layouts/SafeAreaContainer';
|
|
49
|
-
import {
|
|
50
|
-
_retrieveStoreData,
|
|
51
|
-
_setStoreData,
|
|
52
|
-
_removeStoreData,
|
|
53
|
-
_clearStoreData
|
|
54
|
-
} from './src/providers/StoreUtil';
|
|
55
|
-
|
|
56
|
-
export {
|
|
57
|
-
AddressForm,
|
|
58
|
-
AddressDetails,
|
|
59
|
-
Home as HomeView,
|
|
60
|
-
SignupForm,
|
|
61
|
-
LoginForm,
|
|
62
|
-
ActiveOrders,
|
|
63
|
-
AddressList,
|
|
64
|
-
AppleLogin,
|
|
65
|
-
BusinessesListing,
|
|
66
|
-
BusinessProductsListing,
|
|
67
|
-
CartContent,
|
|
68
|
-
Checkout,
|
|
69
|
-
ForgotPasswordForm,
|
|
70
|
-
MomentOption,
|
|
71
|
-
OrdersOption,
|
|
72
|
-
OrderDetails,
|
|
73
|
-
UserProfileForm,
|
|
74
|
-
ReviewOrder,
|
|
75
|
-
UserProfile,
|
|
76
|
-
NotFoundSource,
|
|
77
|
-
Help,
|
|
78
|
-
HelpGuide,
|
|
79
|
-
HelpOrder,
|
|
80
|
-
HelpAccountAndPayment,
|
|
81
|
-
OrderTypeSelector,
|
|
82
|
-
Notifications,
|
|
83
|
-
ReviewProduct,
|
|
84
|
-
ReviewDriver,
|
|
85
|
-
|
|
86
|
-
// OComponents
|
|
87
|
-
Toast,
|
|
88
|
-
OText,
|
|
89
|
-
OButton,
|
|
90
|
-
OInput,
|
|
91
|
-
ODropDown,
|
|
92
|
-
OIcon,
|
|
93
|
-
OIconText,
|
|
94
|
-
OIconButton,
|
|
95
|
-
OTextarea,
|
|
96
|
-
OToggle,
|
|
97
|
-
OKeyButton,
|
|
98
|
-
OAlert,
|
|
99
|
-
OModal,
|
|
100
|
-
OBottomPopup,
|
|
101
|
-
|
|
102
|
-
// layout
|
|
103
|
-
Container,
|
|
104
|
-
SafeAreaContainer,
|
|
105
|
-
|
|
106
|
-
// utils
|
|
107
|
-
_retrieveStoreData,
|
|
108
|
-
_setStoreData,
|
|
109
|
-
_removeStoreData,
|
|
110
|
-
_clearStoreData
|
|
111
|
-
}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import React, { useEffect } from 'react';
|
|
2
|
-
import { useLanguage, useUtils, useConfig } from 'ordering-components/native';
|
|
3
|
-
import { OIcon, OIconButton, OText } from '../shared';
|
|
4
|
-
import {
|
|
5
|
-
ActiveOrdersContainer,
|
|
6
|
-
Card,
|
|
7
|
-
Information,
|
|
8
|
-
Logo,
|
|
9
|
-
OrderInformation,
|
|
10
|
-
BusinessInformation,
|
|
11
|
-
Price,
|
|
12
|
-
} from './styles';
|
|
13
|
-
import { View, StyleSheet } from 'react-native';
|
|
14
|
-
|
|
15
|
-
import { ActiveOrdersParams } from '../../types';
|
|
16
|
-
import moment from 'moment';
|
|
17
|
-
import { useTheme } from 'styled-components/native';
|
|
18
|
-
import { TouchableOpacity } from 'react-native-gesture-handler';
|
|
19
|
-
|
|
20
|
-
export const ActiveOrders = (props: ActiveOrdersParams) => {
|
|
21
|
-
const {
|
|
22
|
-
onNavigationRedirect,
|
|
23
|
-
orders,
|
|
24
|
-
pagination,
|
|
25
|
-
loadMoreOrders,
|
|
26
|
-
getOrderStatus,
|
|
27
|
-
isPreorders
|
|
28
|
-
} = props;
|
|
29
|
-
|
|
30
|
-
const theme = useTheme();
|
|
31
|
-
const [{ configs }] = useConfig();
|
|
32
|
-
const [, t] = useLanguage();
|
|
33
|
-
const [{ parseDate, parsePrice, optimizeImage }] = useUtils();
|
|
34
|
-
|
|
35
|
-
const formatDate = (date: string, option?: any) => {
|
|
36
|
-
return option?.utc ? moment.utc(date).format('DD/MM/YY \u2022 h:m a') : moment(date).format('DD/MM/YY \u2022 h:m a');
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const handleClickCard = (uuid: string) => {
|
|
40
|
-
onNavigationRedirect &&
|
|
41
|
-
onNavigationRedirect('OrderDetails', { orderId: uuid });
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const handleLike = () => {
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const Order = ({ order, index }: { order: any; index: number }) => (
|
|
49
|
-
<React.Fragment>
|
|
50
|
-
<Card
|
|
51
|
-
isMiniCard={configs?.google_maps_api_key?.value}
|
|
52
|
-
onPress={() => handleClickCard(order?.uuid)}
|
|
53
|
-
activeOpacity={0.7}>
|
|
54
|
-
<Information>
|
|
55
|
-
{/* {!!order.business?.logo && (
|
|
56
|
-
<Logo>
|
|
57
|
-
<OIcon
|
|
58
|
-
url={optimizeImage(order.business?.logo, 'h_300,c_limit')}
|
|
59
|
-
style={styles.logo}
|
|
60
|
-
/>
|
|
61
|
-
</Logo>
|
|
62
|
-
)} */}
|
|
63
|
-
<OrderInformation>
|
|
64
|
-
<BusinessInformation>
|
|
65
|
-
<OText size={12} lineHeight={18} weight={600} numberOfLines={1} ellipsizeMode={'tail'}>
|
|
66
|
-
{`${t('ORDER_NO', 'Order No')}.${order.id}`}
|
|
67
|
-
</OText>
|
|
68
|
-
<OText size={10} lineHeight={21} color={theme.colors.textSecondary}>
|
|
69
|
-
{order?.delivery_datetime_utc
|
|
70
|
-
? formatDate(order?.delivery_datetime_utc)
|
|
71
|
-
: formatDate(order?.delivery_datetime, { utc: false })}
|
|
72
|
-
</OText>
|
|
73
|
-
{/* {order?.status !== 0 && ( */}
|
|
74
|
-
<OText
|
|
75
|
-
color={theme.colors.primary}
|
|
76
|
-
size={10}
|
|
77
|
-
lineHeight={15}
|
|
78
|
-
weight={400}
|
|
79
|
-
numberOfLines={2}>
|
|
80
|
-
{getOrderStatus(order.status)?.value}
|
|
81
|
-
</OText>
|
|
82
|
-
{/* )} */}
|
|
83
|
-
</BusinessInformation>
|
|
84
|
-
<Price>
|
|
85
|
-
<OText size={12} lineHeight={18}>
|
|
86
|
-
{parsePrice(order?.summary?.total || order?.total)}
|
|
87
|
-
</OText>
|
|
88
|
-
{!isPreorders &&
|
|
89
|
-
<TouchableOpacity onPress={handleLike}>
|
|
90
|
-
<OIcon src={theme.images.general.heart} color={theme.colors.red} width={16} />
|
|
91
|
-
</TouchableOpacity>
|
|
92
|
-
}
|
|
93
|
-
</Price>
|
|
94
|
-
</OrderInformation>
|
|
95
|
-
</Information>
|
|
96
|
-
</Card>
|
|
97
|
-
</React.Fragment>
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
return (
|
|
101
|
-
<>
|
|
102
|
-
<ActiveOrdersContainer isMiniCards={configs?.google_maps_api_key?.value}>
|
|
103
|
-
{orders.length > 0 &&
|
|
104
|
-
orders.map((order: any, index: any) => (
|
|
105
|
-
<Order key={order?.id || order?.uuid} order={order} index={index} />
|
|
106
|
-
))}
|
|
107
|
-
</ActiveOrdersContainer>
|
|
108
|
-
<View
|
|
109
|
-
style={{
|
|
110
|
-
height: 8,
|
|
111
|
-
backgroundColor: theme.colors.backgroundGray100,
|
|
112
|
-
marginHorizontal: -40,
|
|
113
|
-
}}
|
|
114
|
-
/>
|
|
115
|
-
</>
|
|
116
|
-
);
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
const styles = StyleSheet.create({
|
|
120
|
-
logo: {
|
|
121
|
-
borderRadius: 7.6,
|
|
122
|
-
width: 64,
|
|
123
|
-
height: 64,
|
|
124
|
-
},
|
|
125
|
-
orderNumber: {
|
|
126
|
-
flexDirection: 'row',
|
|
127
|
-
marginVertical: 3,
|
|
128
|
-
},
|
|
129
|
-
loadOrders: {
|
|
130
|
-
justifyContent: 'center',
|
|
131
|
-
alignItems: 'center',
|
|
132
|
-
minWidth: 230,
|
|
133
|
-
},
|
|
134
|
-
});
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components/native'
|
|
2
|
-
|
|
3
|
-
export const ActiveOrdersContainer = styled.View`
|
|
4
|
-
margin-bottom: 20px;
|
|
5
|
-
`
|
|
6
|
-
|
|
7
|
-
export const Card = styled.TouchableOpacity`
|
|
8
|
-
flex: 1;
|
|
9
|
-
`
|
|
10
|
-
|
|
11
|
-
export const Map = styled.View`
|
|
12
|
-
flex: 1;
|
|
13
|
-
height: 125px;
|
|
14
|
-
margin-bottom: 22px
|
|
15
|
-
`
|
|
16
|
-
|
|
17
|
-
export const Information = styled.View`
|
|
18
|
-
flex-direction: row;
|
|
19
|
-
align-items: center;
|
|
20
|
-
padding-vertical: 5px;
|
|
21
|
-
margin-bottom: 12px;
|
|
22
|
-
`
|
|
23
|
-
|
|
24
|
-
export const Logo = styled.View`
|
|
25
|
-
border-radius: 7.6px;
|
|
26
|
-
box-shadow: 0 1px 2px #0000001A;
|
|
27
|
-
`
|
|
28
|
-
|
|
29
|
-
export const OrderInformation = styled.View`
|
|
30
|
-
flex-direction: row;
|
|
31
|
-
justify-content: space-between;
|
|
32
|
-
flex: 1;
|
|
33
|
-
`
|
|
34
|
-
|
|
35
|
-
export const BusinessInformation = styled.View`
|
|
36
|
-
flex-basis: 65%;
|
|
37
|
-
`
|
|
38
|
-
|
|
39
|
-
export const Price = styled.View`
|
|
40
|
-
justify-content: flex-start;
|
|
41
|
-
align-items: flex-end;
|
|
42
|
-
margin-left: 10px;
|
|
43
|
-
width: 30%;
|
|
44
|
-
`
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TouchableOpacity, View } from 'react-native';
|
|
3
|
-
import {
|
|
4
|
-
AddressDetails as AddressDetailsController,
|
|
5
|
-
useOrder,
|
|
6
|
-
useLanguage,
|
|
7
|
-
} from 'ordering-components/native';
|
|
8
|
-
|
|
9
|
-
import { ADContainer, ADHeader, ADAddress, ADMap } from './styles';
|
|
10
|
-
|
|
11
|
-
import { useTheme } from 'styled-components/native';
|
|
12
|
-
import { OText, OIcon } from '../shared';
|
|
13
|
-
import { useWindowDimensions } from 'react-native';
|
|
14
|
-
|
|
15
|
-
const AddressDetailsUI = (props: any) => {
|
|
16
|
-
const { navigation, addressToShow, isCartPending, googleMapsUrl, apiKey } =
|
|
17
|
-
props;
|
|
18
|
-
|
|
19
|
-
const theme = useTheme();
|
|
20
|
-
const [orderState] = useOrder();
|
|
21
|
-
const [, t] = useLanguage();
|
|
22
|
-
const { width } = useWindowDimensions();
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<ADContainer>
|
|
26
|
-
<ADHeader>
|
|
27
|
-
<OText
|
|
28
|
-
size={16}
|
|
29
|
-
lineHeight={24}
|
|
30
|
-
color={theme.colors.textNormal}
|
|
31
|
-
weight={'500'}>
|
|
32
|
-
{t('DELIVERY_ADDRESS', 'Delivery address')}
|
|
33
|
-
</OText>
|
|
34
|
-
</ADHeader>
|
|
35
|
-
{!!apiKey && (
|
|
36
|
-
<ADMap
|
|
37
|
-
style={{ marginStart: -40, marginEnd: -40, width: width, flex: 1 }}>
|
|
38
|
-
<OIcon url={googleMapsUrl} height={151} width={width} />
|
|
39
|
-
</ADMap>
|
|
40
|
-
)}
|
|
41
|
-
<ADAddress>
|
|
42
|
-
<OText
|
|
43
|
-
size={12}
|
|
44
|
-
color={theme.colors.textNormal}
|
|
45
|
-
numberOfLines={1}
|
|
46
|
-
ellipsizeMode="tail"
|
|
47
|
-
style={{ width: '85%' }}>
|
|
48
|
-
{addressToShow || orderState?.options?.address?.address}
|
|
49
|
-
</OText>
|
|
50
|
-
<OText size={12} lineHeight={18} color={theme.colors.textNormal}>
|
|
51
|
-
{orderState?.options?.address?.address_notes}
|
|
52
|
-
</OText>
|
|
53
|
-
{orderState?.options?.type === 1 && !isCartPending && (
|
|
54
|
-
<TouchableOpacity
|
|
55
|
-
onPress={() =>
|
|
56
|
-
navigation.navigate('AddressList', { isFromCheckout: true })
|
|
57
|
-
}>
|
|
58
|
-
<OText
|
|
59
|
-
size={12}
|
|
60
|
-
color={theme.colors.primary}
|
|
61
|
-
style={{ textDecorationLine: 'underline' }}>
|
|
62
|
-
{t('CHANGE', 'Change')}
|
|
63
|
-
</OText>
|
|
64
|
-
</TouchableOpacity>
|
|
65
|
-
)}
|
|
66
|
-
</ADAddress>
|
|
67
|
-
</ADContainer>
|
|
68
|
-
);
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export const AddressDetails = (props: any) => {
|
|
72
|
-
const addressDetailsProps = {
|
|
73
|
-
...props,
|
|
74
|
-
UIComponent: AddressDetailsUI,
|
|
75
|
-
};
|
|
76
|
-
return <AddressDetailsController {...addressDetailsProps} />;
|
|
77
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components/native';
|
|
2
|
-
|
|
3
|
-
export const ADContainer = styled.View`
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
width: 100%;
|
|
7
|
-
`
|
|
8
|
-
|
|
9
|
-
export const ADHeader = styled.View`
|
|
10
|
-
display: flex;
|
|
11
|
-
justify-content: flex-start;
|
|
12
|
-
`
|
|
13
|
-
|
|
14
|
-
export const ADAddress = styled.View`
|
|
15
|
-
align-items: flex-start;
|
|
16
|
-
justify-content: flex-start;
|
|
17
|
-
`
|
|
18
|
-
|
|
19
|
-
export const ADMap = styled.View`
|
|
20
|
-
width: 100%;
|
|
21
|
-
`
|