ordering-ui-react-native 0.17.51 → 0.17.53
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/themes/original/src/components/AddressDetails/index.tsx +1 -1
- package/themes/original/src/components/AddressForm/index.tsx +12 -5
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +15 -3
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +8 -2
- package/themes/original/src/components/BusinessProductsListing/index.tsx +2 -2
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +21 -12
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +0 -7
- package/themes/original/src/components/Cart/index.tsx +26 -20
- package/themes/original/src/components/Checkout/index.tsx +9 -4
- package/themes/original/src/components/OrderDetails/index.tsx +2 -2
- package/themes/original/src/components/OrderProgress/index.tsx +69 -64
- package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
- package/themes/original/src/components/PageBanner/index.tsx +1 -1
- package/themes/original/src/components/ProductForm/index.tsx +5 -3
- package/themes/original/src/components/ProductItemAccordion/index.tsx +2 -2
- package/themes/original/src/components/ReviewDriver/index.tsx +1 -1
- package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
- package/themes/original/src/components/SingleProductCard/index.tsx +2 -1
- package/themes/original/src/components/SingleProductCard/styles.tsx +1 -0
- package/themes/original/src/components/StripeElementsForm/index.tsx +3 -0
- package/themes/original/src/components/UserProfile/index.tsx +2 -2
- package/themes/original/src/components/shared/OInput.tsx +10 -1
package/package.json
CHANGED
|
@@ -83,7 +83,6 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
83
83
|
backgroundColor: theme.colors.clear
|
|
84
84
|
},
|
|
85
85
|
inputsStyle: {
|
|
86
|
-
borderColor: theme.colors.border,
|
|
87
86
|
borderRadius: 10,
|
|
88
87
|
marginBottom: 20,
|
|
89
88
|
height: 50,
|
|
@@ -92,7 +91,6 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
92
91
|
flex: 1,
|
|
93
92
|
},
|
|
94
93
|
textAreaStyles: {
|
|
95
|
-
borderColor: theme.colors.border,
|
|
96
94
|
borderRadius: 10,
|
|
97
95
|
marginBottom: 20,
|
|
98
96
|
height: 104,
|
|
@@ -140,6 +138,7 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
140
138
|
const [isKeyboardShow, setIsKeyboardShow] = useState(false);
|
|
141
139
|
const [isSignUpEffect, setIsSignUpEffect] = useState(false);
|
|
142
140
|
const [hasEditing, setAddressEditing] = useState(false);
|
|
141
|
+
const [autoCompleteInputFocused, setAutoCompleteInputFocused] = useState(false)
|
|
143
142
|
|
|
144
143
|
const googleInput: any = useRef(null);
|
|
145
144
|
const internalNumberRef: any = useRef(null);
|
|
@@ -154,7 +153,7 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
154
153
|
'true';
|
|
155
154
|
const maxLimitLocation =
|
|
156
155
|
configState?.configs?.meters_to_change_address?.value;
|
|
157
|
-
|
|
156
|
+
const countryCode = configState?.configs?.country_autocomplete?.value
|
|
158
157
|
const continueAsGuest = () => navigation.navigate('BusinessList', { isGuestUser: true });
|
|
159
158
|
const goToBack = () => navigation?.canGoBack() && navigation.goBack();
|
|
160
159
|
|
|
@@ -544,7 +543,10 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
544
543
|
onPress={(data, details: any) => {
|
|
545
544
|
handleChangeAddress(data, details);
|
|
546
545
|
}}
|
|
547
|
-
query={{
|
|
546
|
+
query={{
|
|
547
|
+
key: googleMapsApiKey,
|
|
548
|
+
components: countryCode && countryCode !== '*' ? `country:${countryCode}` : ''
|
|
549
|
+
}}
|
|
548
550
|
fetchDetails
|
|
549
551
|
ref={googleInput}
|
|
550
552
|
textInputProps={{
|
|
@@ -563,6 +565,8 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
563
565
|
autoCorrect: false,
|
|
564
566
|
blurOnSubmit: false,
|
|
565
567
|
returnKeyType: 'next',
|
|
568
|
+
onFocus: () => setAutoCompleteInputFocused(true),
|
|
569
|
+
onBlur: () => setAutoCompleteInputFocused(false)
|
|
566
570
|
}}
|
|
567
571
|
onFail={(error) =>
|
|
568
572
|
setAlertState({
|
|
@@ -586,7 +590,7 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
586
590
|
textInput: {
|
|
587
591
|
borderWidth: 1,
|
|
588
592
|
borderRadius: 7.6,
|
|
589
|
-
borderColor: theme.colors.border,
|
|
593
|
+
borderColor: autoCompleteInputFocused ? theme.colors.primary : theme.colors.border,
|
|
590
594
|
flexGrow: 1,
|
|
591
595
|
fontSize: 15,
|
|
592
596
|
paddingLeft: 16,
|
|
@@ -676,6 +680,7 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
676
680
|
addressState?.address?.internal_number ||
|
|
677
681
|
''
|
|
678
682
|
}
|
|
683
|
+
isFocusHighlight
|
|
679
684
|
style={{
|
|
680
685
|
...styles.inputsStyle,
|
|
681
686
|
marginRight: showField('internal_number') && showField('zipcode') ? 24 : 0
|
|
@@ -722,6 +727,7 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
722
727
|
addressState.address.zipcode ||
|
|
723
728
|
''
|
|
724
729
|
}
|
|
730
|
+
isFocusHighlight
|
|
725
731
|
style={styles.inputsStyle}
|
|
726
732
|
forwardRef={zipCodeRef}
|
|
727
733
|
returnKeyType="next"
|
|
@@ -767,6 +773,7 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
767
773
|
''
|
|
768
774
|
}
|
|
769
775
|
multiline
|
|
776
|
+
isFocusHighlight
|
|
770
777
|
style={styles.textAreaStyles}
|
|
771
778
|
returnKeyType="done"
|
|
772
779
|
forwardRef={addressNotesRef}
|
|
@@ -251,7 +251,11 @@ export const BusinessBasicInformation = (
|
|
|
251
251
|
)}
|
|
252
252
|
{isChewLayout && (
|
|
253
253
|
<TouchableOpacity onPress={() => handleClickBusinessInformation()}>
|
|
254
|
-
<OText
|
|
254
|
+
<OText
|
|
255
|
+
color={theme.colors.primary}
|
|
256
|
+
style={{ textDecorationColor: theme.colors.primary, textDecorationLine: 'underline' }}
|
|
257
|
+
size={12}
|
|
258
|
+
>
|
|
255
259
|
{t('SEE_MORE_DESCRIPTION', 'See more')}
|
|
256
260
|
</OText>
|
|
257
261
|
</TouchableOpacity>
|
|
@@ -416,7 +420,11 @@ export const BusinessBasicInformation = (
|
|
|
416
420
|
{isPreOrder && (!business?.professionals || business?.professionals?.length === 0) && (
|
|
417
421
|
<>
|
|
418
422
|
<TouchableOpacity onPress={() => navigation.navigate('BusinessPreorder', { business: businessState?.business, handleBusinessClick: () => navigation?.goBack() })}>
|
|
419
|
-
<OText
|
|
423
|
+
<OText
|
|
424
|
+
color={theme.colors.primary}
|
|
425
|
+
style={{ textDecorationColor: theme.colors.primary, textDecorationLine: 'underline' }}
|
|
426
|
+
size={12}
|
|
427
|
+
>
|
|
420
428
|
{t('PREORDER', 'Preorder')}
|
|
421
429
|
</OText>
|
|
422
430
|
</TouchableOpacity>
|
|
@@ -424,7 +432,11 @@ export const BusinessBasicInformation = (
|
|
|
424
432
|
</>
|
|
425
433
|
)}
|
|
426
434
|
<TouchableOpacity onPress={() => handleClickBusinessReviews()}>
|
|
427
|
-
<OText
|
|
435
|
+
<OText
|
|
436
|
+
color={theme.colors.primary}
|
|
437
|
+
style={{ textDecorationColor: theme.colors.primary, textDecorationLine: 'underline' }}
|
|
438
|
+
size={12}
|
|
439
|
+
>
|
|
428
440
|
{t('REVIEWS', 'Reviews')}
|
|
429
441
|
</OText>
|
|
430
442
|
</TouchableOpacity>
|
|
@@ -46,6 +46,12 @@ export const BusinessItemAccordion = (props: any) => {
|
|
|
46
46
|
}
|
|
47
47
|
}, [orderState?.carts, isClosed])
|
|
48
48
|
|
|
49
|
+
const subtotalWithTaxes = cart?.taxes?.reduce((acc: any, item: any) => {
|
|
50
|
+
if (item?.type === 1)
|
|
51
|
+
return acc = acc + item?.summary?.tax
|
|
52
|
+
return acc = acc
|
|
53
|
+
}, cart?.subtotal)
|
|
54
|
+
|
|
49
55
|
return (
|
|
50
56
|
<BIContainer isClosed={isClosed} isMultiCheckout={isMultiCheckout} checkoutVisible={!isActive && !isClosed && !!isProducts && !checkoutButtonDisabled}>
|
|
51
57
|
<BIHeader
|
|
@@ -102,7 +108,7 @@ export const BusinessItemAccordion = (props: any) => {
|
|
|
102
108
|
<OText
|
|
103
109
|
size={12}
|
|
104
110
|
lineHeight={18}
|
|
105
|
-
color={theme.colors.
|
|
111
|
+
color={theme.colors.primary}
|
|
106
112
|
style={{ textDecorationLine: 'underline' }}
|
|
107
113
|
>
|
|
108
114
|
{t('CHANGE_STORE', 'Change store')}
|
|
@@ -151,7 +157,7 @@ export const BusinessItemAccordion = (props: any) => {
|
|
|
151
157
|
textStyle={{ color: 'white', textAlign: 'center', flex: 1 }}
|
|
152
158
|
style={{ width: 180, flexDirection: 'row', justifyContent: 'center', borderRadius: 7.6, shadowOpacity: 0 }}
|
|
153
159
|
text={t('CHECKOUT', 'Checkout')}
|
|
154
|
-
bgColor={(
|
|
160
|
+
bgColor={(subtotalWithTaxes < cart?.minimum || !cart?.valid_address) ? theme.colors.secundary : theme.colors.primary}
|
|
155
161
|
borderColor={theme.colors.primary}
|
|
156
162
|
isDisabled={checkoutButtonDisabled}
|
|
157
163
|
/>
|
|
@@ -269,7 +269,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
269
269
|
{!isOpenSearchBar && (
|
|
270
270
|
<>
|
|
271
271
|
<TopActions onPress={() => handleBackNavigation()}>
|
|
272
|
-
<
|
|
272
|
+
<OIcon src={theme.images.general.arrow_left} color={theme.colors.textNormal} />
|
|
273
273
|
</TopActions>
|
|
274
274
|
{!errorQuantityProducts && (
|
|
275
275
|
<View style={{ ...styles.headerItem }}>
|
|
@@ -277,7 +277,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
277
277
|
onPress={() => setIsOpenSearchBar(true)}
|
|
278
278
|
style={styles.searchIcon}
|
|
279
279
|
>
|
|
280
|
-
<OIcon src={theme.images.general.search} color={theme.colors.textNormal} width={
|
|
280
|
+
<OIcon src={theme.images.general.search} color={theme.colors.textNormal} width={20} />
|
|
281
281
|
</TouchableOpacity>
|
|
282
282
|
</View>
|
|
283
283
|
)}
|
|
@@ -32,7 +32,6 @@ import {
|
|
|
32
32
|
HeaderWrapper,
|
|
33
33
|
ListWrapper,
|
|
34
34
|
FeaturedWrapper,
|
|
35
|
-
OrderProgressWrapper,
|
|
36
35
|
FarAwayMessage,
|
|
37
36
|
AddressInputContainer,
|
|
38
37
|
PreorderInput,
|
|
@@ -138,7 +137,8 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
138
137
|
minHeight: 45,
|
|
139
138
|
paddingVertical: 5,
|
|
140
139
|
paddingHorizontal: 20,
|
|
141
|
-
borderWidth: 1
|
|
140
|
+
borderWidth: 1,
|
|
141
|
+
justifyContent: 'center'
|
|
142
142
|
},
|
|
143
143
|
businessSkeleton: {
|
|
144
144
|
borderRadius: 8,
|
|
@@ -501,12 +501,10 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
501
501
|
</TouchableOpacity>
|
|
502
502
|
</View>
|
|
503
503
|
)}
|
|
504
|
-
<
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
/>
|
|
509
|
-
</OrderProgressWrapper>
|
|
504
|
+
<OrderProgress
|
|
505
|
+
{...props}
|
|
506
|
+
isFocused={isFocused}
|
|
507
|
+
/>
|
|
510
508
|
{
|
|
511
509
|
!businessId && !props.franchiseId && featuredBusiness && featuredBusiness.length > 0 && (
|
|
512
510
|
<FeaturedWrapper>
|
|
@@ -659,14 +657,25 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
659
657
|
key={city?.id}
|
|
660
658
|
style={{
|
|
661
659
|
padding: 10,
|
|
662
|
-
|
|
663
|
-
borderBottomColor: orderState?.options?.city_id === city?.id ? theme.colors.primary : theme.colors.backgroundGray,
|
|
664
|
-
marginBottom: 10,
|
|
660
|
+
flexDirection: 'row'
|
|
665
661
|
}}
|
|
666
662
|
onPress={() => handleChangeCity(city?.id)}
|
|
667
663
|
disabled={orderState?.loading}
|
|
668
664
|
>
|
|
669
|
-
|
|
665
|
+
{orderState?.options?.city_id === city?.id ? (
|
|
666
|
+
<OIcon
|
|
667
|
+
src={theme.images.general.option_checked}
|
|
668
|
+
width={16}
|
|
669
|
+
style={{ marginEnd: 24 }}
|
|
670
|
+
/>
|
|
671
|
+
) : (
|
|
672
|
+
<OIcon
|
|
673
|
+
src={theme.images.general.option_normal}
|
|
674
|
+
width={16}
|
|
675
|
+
style={{ marginEnd: 24 }}
|
|
676
|
+
/>
|
|
677
|
+
)}
|
|
678
|
+
<OText color={theme.colors.black}>
|
|
670
679
|
{city?.name}
|
|
671
680
|
</OText>
|
|
672
681
|
</TouchableOpacity>
|
|
@@ -74,16 +74,9 @@ export const ListWrapper = styled.View`
|
|
|
74
74
|
|
|
75
75
|
export const FeaturedWrapper = styled.View`
|
|
76
76
|
background-color: ${(props: any) => props.theme.colors.backgroundLight};
|
|
77
|
-
height: 220px;
|
|
78
77
|
paddingVertical: 30px;
|
|
79
78
|
`;
|
|
80
79
|
|
|
81
|
-
export const OrderProgressWrapper = styled.View`
|
|
82
|
-
margin-top: 37px;
|
|
83
|
-
margin-bottom: 20px;
|
|
84
|
-
padding-horizontal: 40px;
|
|
85
|
-
`
|
|
86
|
-
|
|
87
80
|
export const FarAwayMessage = styled.View`
|
|
88
81
|
flex-direction: row;
|
|
89
82
|
align-items: center;
|
|
@@ -154,6 +154,12 @@ const CartUI = (props: any) => {
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
+
const subtotalWithTaxes = cart?.taxes?.reduce((acc: any, item: any) => {
|
|
158
|
+
if (item?.type === 1)
|
|
159
|
+
return acc = acc + item?.summary?.tax
|
|
160
|
+
return acc = acc
|
|
161
|
+
}, cart?.subtotal)
|
|
162
|
+
|
|
157
163
|
return (
|
|
158
164
|
<CContainer>
|
|
159
165
|
{openUpselling && (
|
|
@@ -178,7 +184,7 @@ const CartUI = (props: any) => {
|
|
|
178
184
|
onNavigationRedirect={props.onNavigationRedirect}
|
|
179
185
|
handleChangeStore={() => setOpenChangeStore(true)}
|
|
180
186
|
handleClickCheckout={() => setOpenUpselling(true)}
|
|
181
|
-
checkoutButtonDisabled={(openUpselling && !canOpenUpselling) ||
|
|
187
|
+
checkoutButtonDisabled={(openUpselling && !canOpenUpselling) || subtotalWithTaxes < cart?.minimum || !cart?.valid_address}
|
|
182
188
|
isMultiCheckout={isMultiCheckout}
|
|
183
189
|
>
|
|
184
190
|
{cart?.products?.length > 0 && cart?.products.map((product: any, i: number) => (
|
|
@@ -369,22 +375,22 @@ const CartUI = (props: any) => {
|
|
|
369
375
|
validationFields?.fields?.checkout?.driver_tip?.enabled &&
|
|
370
376
|
driverTipsOptions && driverTipsOptions?.length > 0 &&
|
|
371
377
|
(
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
378
|
+
<DriverTipsContainer>
|
|
379
|
+
<OText size={14} lineHeight={20} color={theme.colors.textNormal}>
|
|
380
|
+
{t('DRIVER_TIPS', 'Driver Tips')}
|
|
381
|
+
</OText>
|
|
382
|
+
<DriverTips
|
|
383
|
+
uuid={cart?.uuid}
|
|
384
|
+
businessId={cart?.business_id}
|
|
385
|
+
driverTipsOptions={driverTipsOptions}
|
|
386
|
+
isFixedPrice={parseInt(configs?.driver_tip_type?.value, 10) === 1 || !!parseInt(configs?.driver_tip_use_custom?.value, 10)}
|
|
387
|
+
isDriverTipUseCustom={!!parseInt(configs?.driver_tip_use_custom?.value, 10)}
|
|
388
|
+
driverTip={parseInt(configs?.driver_tip_type?.value, 10) === 1 || !!parseInt(configs?.driver_tip_use_custom?.value, 10)
|
|
389
|
+
? cart?.driver_tip
|
|
390
|
+
: cart?.driver_tip_rate}
|
|
391
|
+
useOrderContext
|
|
392
|
+
/>
|
|
393
|
+
</DriverTipsContainer>
|
|
388
394
|
)}
|
|
389
395
|
|
|
390
396
|
<OSTotal>
|
|
@@ -455,15 +461,15 @@ const CartUI = (props: any) => {
|
|
|
455
461
|
{cart?.valid_products ? (
|
|
456
462
|
<CheckoutAction>
|
|
457
463
|
<OButton
|
|
458
|
-
text={(
|
|
464
|
+
text={(subtotalWithTaxes >= cart?.minimum || !cart?.minimum) && cart?.valid_address ? (
|
|
459
465
|
!openUpselling !== canOpenUpselling ? t('CHECKOUT', 'Checkout') : t('LOADING', 'Loading')
|
|
460
466
|
) : !cart?.valid_address ? (
|
|
461
467
|
`${t('OUT_OF_COVERAGE', 'Out of Coverage')}`
|
|
462
468
|
) : (
|
|
463
469
|
`${t('MINIMUN_SUBTOTAL_ORDER', 'Minimum subtotal order:')} ${parsePrice(cart?.minimum)}`
|
|
464
470
|
)}
|
|
465
|
-
bgColor={(
|
|
466
|
-
isDisabled={(openUpselling && !canOpenUpselling) ||
|
|
471
|
+
bgColor={(subtotalWithTaxes < cart?.minimum || !cart?.valid_address) ? theme.colors.secundary : theme.colors.primary}
|
|
472
|
+
isDisabled={(openUpselling && !canOpenUpselling) || subtotalWithTaxes < cart?.minimum || !cart?.valid_address}
|
|
467
473
|
borderColor={theme.colors.primary}
|
|
468
474
|
imgRightSrc={null}
|
|
469
475
|
textStyle={{ color: 'white', textAlign: 'center', flex: 1 }}
|
|
@@ -154,8 +154,13 @@ const CheckoutUI = (props: any) => {
|
|
|
154
154
|
const isBusinessChangeEnabled = configs?.cart_change_business_validation?.value === '1'
|
|
155
155
|
|
|
156
156
|
const isPreOrder = configs?.preorder_status_enabled?.value === '1'
|
|
157
|
+
const subtotalWithTaxes = cart?.taxes?.reduce((acc: any, item: any) => {
|
|
158
|
+
if (item?.type === 1)
|
|
159
|
+
return acc = acc + item?.summary?.tax
|
|
160
|
+
return acc = acc
|
|
161
|
+
}, cart?.subtotal)
|
|
157
162
|
const isDisabledButtonPlace = loading || !cart?.valid || (!paymethodSelected && cart?.balance > 0) ||
|
|
158
|
-
placing || errorCash ||
|
|
163
|
+
placing || errorCash || subtotalWithTaxes < cart?.minimum ||
|
|
159
164
|
// (placeSpotTypes.includes(options?.type) && !cart?.place) ||
|
|
160
165
|
(options.type === 1 &&
|
|
161
166
|
validationFields?.fields?.checkout?.driver_tip?.enabled &&
|
|
@@ -634,7 +639,7 @@ const CheckoutUI = (props: any) => {
|
|
|
634
639
|
onPress={() => onNavigationRedirect('Business', { store: cart?.business?.slug })}
|
|
635
640
|
>
|
|
636
641
|
<OText
|
|
637
|
-
size={
|
|
642
|
+
size={12}
|
|
638
643
|
lineHeight={15}
|
|
639
644
|
color={theme.colors.primary}
|
|
640
645
|
style={{ textDecorationLine: 'underline' }}
|
|
@@ -651,7 +656,7 @@ const CheckoutUI = (props: any) => {
|
|
|
651
656
|
<OText
|
|
652
657
|
size={12}
|
|
653
658
|
lineHeight={18}
|
|
654
|
-
color={theme.colors.
|
|
659
|
+
color={theme.colors.primary}
|
|
655
660
|
style={{ textDecorationLine: 'underline' }}
|
|
656
661
|
>
|
|
657
662
|
{t('CHANGE_STORE', 'Change store')}
|
|
@@ -756,7 +761,7 @@ const CheckoutUI = (props: any) => {
|
|
|
756
761
|
handleClick={() => handlePlaceOrder(null)}
|
|
757
762
|
isSecondaryBtn={isDisabledButtonPlace}
|
|
758
763
|
disabled={isDisabledButtonPlace}
|
|
759
|
-
btnText={
|
|
764
|
+
btnText={subtotalWithTaxes >= cart?.minimum
|
|
760
765
|
? (
|
|
761
766
|
placing
|
|
762
767
|
? t('PLACING', 'Placing')
|
|
@@ -622,7 +622,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
622
622
|
onPress={() => handleClickOrderReview(order)}
|
|
623
623
|
>
|
|
624
624
|
<OText
|
|
625
|
-
size={
|
|
625
|
+
size={12}
|
|
626
626
|
lineHeight={15}
|
|
627
627
|
color={theme.colors.primary}
|
|
628
628
|
style={{ textDecorationLine: 'underline' }}
|
|
@@ -638,7 +638,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
638
638
|
|
|
639
639
|
>
|
|
640
640
|
<OText
|
|
641
|
-
size={
|
|
641
|
+
size={12}
|
|
642
642
|
lineHeight={15}
|
|
643
643
|
color={theme.colors.primary}
|
|
644
644
|
style={{ textDecorationLine: 'underline', textTransform: 'capitalize' }}
|
|
@@ -17,7 +17,8 @@ import {
|
|
|
17
17
|
ProgressBar,
|
|
18
18
|
TimeWrapper,
|
|
19
19
|
ProgressTextWrapper,
|
|
20
|
-
OrderInfoWrapper
|
|
20
|
+
OrderInfoWrapper,
|
|
21
|
+
OrderProgressWrapper
|
|
21
22
|
} from './styles'
|
|
22
23
|
const OrderProgressUI = (props: any) => {
|
|
23
24
|
const {
|
|
@@ -47,9 +48,9 @@ const OrderProgressUI = (props: any) => {
|
|
|
47
48
|
height: 1
|
|
48
49
|
},
|
|
49
50
|
shadowColor: '#000',
|
|
50
|
-
shadowOpacity: 0.
|
|
51
|
-
shadowRadius:
|
|
52
|
-
elevation:
|
|
51
|
+
shadowOpacity: 0.2,
|
|
52
|
+
shadowRadius: 2,
|
|
53
|
+
elevation: 3
|
|
53
54
|
},
|
|
54
55
|
logoWrapper: {
|
|
55
56
|
overflow: 'hidden',
|
|
@@ -144,70 +145,74 @@ const OrderProgressUI = (props: any) => {
|
|
|
144
145
|
return (
|
|
145
146
|
<>
|
|
146
147
|
{(orderList?.loading && !initialLoaded) && (
|
|
147
|
-
<
|
|
148
|
-
<
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
148
|
+
<OrderProgressWrapper>
|
|
149
|
+
<Placeholder Animation={Fade} height={Platform.OS === 'ios' ? 147.5 : 158}>
|
|
150
|
+
<PlaceholderLine height={60} style={{ borderRadius: 8, marginBottom: 10 }} />
|
|
151
|
+
<PlaceholderLine height={20} style={{ marginBottom: 10 }} />
|
|
152
|
+
<PlaceholderLine height={40} style={{ borderRadius: 8, marginBottom: 10 }} />
|
|
153
|
+
</Placeholder>
|
|
154
|
+
</OrderProgressWrapper>
|
|
152
155
|
)}
|
|
153
156
|
{(!orderList?.loading || initialLoaded) && orderList?.orders?.length > 0 && lastOrder && (
|
|
154
|
-
<
|
|
155
|
-
<
|
|
156
|
-
<
|
|
157
|
-
<
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
<
|
|
181
|
-
<
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
157
|
+
<OrderProgressWrapper>
|
|
158
|
+
<View style={styles.main}>
|
|
159
|
+
<OrderInfoWrapper style={{ flex: 1 }}>
|
|
160
|
+
<View style={styles.logoWrapper}>
|
|
161
|
+
<FastImage
|
|
162
|
+
style={{ width: 50, height: 50 }}
|
|
163
|
+
source={{
|
|
164
|
+
uri: optimizeImage(lastOrder?.business?.logo, 'h_50,c_limit'),
|
|
165
|
+
priority: FastImage.priority.normal,
|
|
166
|
+
}}
|
|
167
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
168
|
+
/>
|
|
169
|
+
</View>
|
|
170
|
+
<View style={{
|
|
171
|
+
paddingHorizontal: 10,
|
|
172
|
+
flex: 1
|
|
173
|
+
}}
|
|
174
|
+
>
|
|
175
|
+
<OText
|
|
176
|
+
size={13}
|
|
177
|
+
style={{
|
|
178
|
+
fontWeight: 'bold',
|
|
179
|
+
marginBottom: 3
|
|
180
|
+
}}
|
|
181
|
+
>{t('ORDER_IN_PROGRESS', 'Order in progress')}</OText>
|
|
182
|
+
<OText size={11} numberOfLines={1} ellipsizeMode='tail'>{t('RESTAURANT_PREPARING_YOUR_ORDER', 'The restaurant is preparing your order')}</OText>
|
|
183
|
+
<TouchableOpacity onPress={() => handleGoToOrder('MyOrders')}>
|
|
184
|
+
<View style={styles.navigationButton}>
|
|
185
|
+
<OText size={11} color={theme.colors.primary}>{t('GO_TO_MY_ORDERS', 'Go to my orders')}</OText>
|
|
186
|
+
<IconAntDesign
|
|
187
|
+
name='arrowright'
|
|
188
|
+
color={theme.colors.primary}
|
|
189
|
+
size={13}
|
|
190
|
+
style={{ marginHorizontal: 5 }}
|
|
191
|
+
/>
|
|
192
|
+
</View>
|
|
193
|
+
</TouchableOpacity>
|
|
194
|
+
</View>
|
|
195
|
+
</OrderInfoWrapper>
|
|
196
|
+
<View style={{ flex: 1 }}>
|
|
197
|
+
<ProgressContentWrapper>
|
|
198
|
+
<ProgressBar style={{ width: getOrderStatus(lastOrder.status)?.percentage ? `${getOrderStatus(lastOrder.status)?.percentage}%` : '0%' }} />
|
|
199
|
+
</ProgressContentWrapper>
|
|
200
|
+
<ProgressTextWrapper>
|
|
201
|
+
<OText size={12} style={{ width: '50%' }}>{getOrderStatus(lastOrder.status)?.value}</OText>
|
|
202
|
+
<TimeWrapper>
|
|
203
|
+
<OText size={11}>{t('ESTIMATED_DELIVERY', 'Estimated delivery')}</OText>
|
|
204
|
+
<OText size={11}>
|
|
205
|
+
{lastOrder?.delivery_datetime_utc
|
|
206
|
+
? parseTime(lastOrder?.delivery_datetime_utc, { outputFormat: 'hh:mm A' })
|
|
207
|
+
: parseTime(lastOrder?.delivery_datetime, { utc: false })}
|
|
208
|
+
-
|
|
209
|
+
{convertDiffToHours(lastOrder)}
|
|
210
|
+
</OText>
|
|
211
|
+
</TimeWrapper>
|
|
212
|
+
</ProgressTextWrapper>
|
|
190
213
|
</View>
|
|
191
|
-
</OrderInfoWrapper>
|
|
192
|
-
<View style={{ flex: 1 }}>
|
|
193
|
-
<ProgressContentWrapper>
|
|
194
|
-
<ProgressBar style={{ width: getOrderStatus(lastOrder.status)?.percentage ? `${getOrderStatus(lastOrder.status)?.percentage}%` : '0%' }} />
|
|
195
|
-
</ProgressContentWrapper>
|
|
196
|
-
<ProgressTextWrapper>
|
|
197
|
-
<OText size={12} style={{ width: '50%' }}>{getOrderStatus(lastOrder.status)?.value}</OText>
|
|
198
|
-
<TimeWrapper>
|
|
199
|
-
<OText size={11}>{t('ESTIMATED_DELIVERY', 'Estimated delivery')}</OText>
|
|
200
|
-
<OText size={11}>
|
|
201
|
-
{lastOrder?.delivery_datetime_utc
|
|
202
|
-
? parseTime(lastOrder?.delivery_datetime_utc, { outputFormat: 'hh:mm A' })
|
|
203
|
-
: parseTime(lastOrder?.delivery_datetime, { utc: false })}
|
|
204
|
-
-
|
|
205
|
-
{convertDiffToHours(lastOrder)}
|
|
206
|
-
</OText>
|
|
207
|
-
</TimeWrapper>
|
|
208
|
-
</ProgressTextWrapper>
|
|
209
214
|
</View>
|
|
210
|
-
</
|
|
215
|
+
</OrderProgressWrapper>
|
|
211
216
|
)}
|
|
212
217
|
{/* {!orderList?.loading && orderList?.orders?.length === 0 && (
|
|
213
218
|
<NotFoundSource
|
|
@@ -54,7 +54,7 @@ const PageBannerUI = (props: any) => {
|
|
|
54
54
|
{pageBannerState.banner?.items && pageBannerState.banner?.items.length > 0 && (
|
|
55
55
|
<PageBannerWrapper>
|
|
56
56
|
<Swiper
|
|
57
|
-
loop={
|
|
57
|
+
loop={pageBannerState.banner?.items.length > 1}
|
|
58
58
|
showsButtons={true}
|
|
59
59
|
style={styles.mainSwiper}
|
|
60
60
|
showsPagination={false}
|
|
@@ -126,6 +126,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
126
126
|
},
|
|
127
127
|
slide1: {
|
|
128
128
|
flex: 1,
|
|
129
|
+
alignItems: 'center'
|
|
129
130
|
},
|
|
130
131
|
mainSwiper: {
|
|
131
132
|
height: 258,
|
|
@@ -919,7 +920,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
919
920
|
disabled={productCart.quantity === 1 || !productCart.quantity || isSoldOut || ((productCart?.quantity + productAddedToCartLength) <= product?.minimum_per_order)}>
|
|
920
921
|
<OIcon
|
|
921
922
|
src={theme.images.general.minus}
|
|
922
|
-
width={
|
|
923
|
+
width={20}
|
|
923
924
|
color={
|
|
924
925
|
productCart.quantity === 1 || isSoldOut
|
|
925
926
|
? theme.colors.backgroundGray
|
|
@@ -940,7 +941,8 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
940
941
|
borderRadius: 8,
|
|
941
942
|
borderColor: theme.colors.inputBorderColor,
|
|
942
943
|
height: 44,
|
|
943
|
-
marginHorizontal: 10
|
|
944
|
+
marginHorizontal: 10,
|
|
945
|
+
fontSize: 16
|
|
944
946
|
}}
|
|
945
947
|
/>
|
|
946
948
|
)}
|
|
@@ -963,7 +965,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
963
965
|
}>
|
|
964
966
|
<OIcon
|
|
965
967
|
src={theme.images.general.plus}
|
|
966
|
-
width={
|
|
968
|
+
width={20}
|
|
967
969
|
color={
|
|
968
970
|
maxProductQuantity <= 0 ||
|
|
969
971
|
(productCart?.quantity + productAddedToCartLength) >= maxProductQuantity ||
|
|
@@ -241,7 +241,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
241
241
|
<TouchableOpacity onPress={() => handleEditProduct(product)} style={{ marginEnd: 7 }}>
|
|
242
242
|
<OIcon
|
|
243
243
|
src={theme.images.general.pencil}
|
|
244
|
-
width={
|
|
244
|
+
width={20}
|
|
245
245
|
color={theme.colors.textSecondary}
|
|
246
246
|
/>
|
|
247
247
|
</TouchableOpacity>
|
|
@@ -254,7 +254,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
254
254
|
>
|
|
255
255
|
<OIcon
|
|
256
256
|
src={theme.images.general.trash}
|
|
257
|
-
width={
|
|
257
|
+
width={20}
|
|
258
258
|
color={theme.colors.textSecondary}
|
|
259
259
|
/>
|
|
260
260
|
</OAlert>
|
|
@@ -186,7 +186,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
|
|
|
186
186
|
<NavBar
|
|
187
187
|
title={t('REVIEW_DRIVER', 'Review driver')}
|
|
188
188
|
titleAlign={'center'}
|
|
189
|
-
onActionLeft={() =>
|
|
189
|
+
onActionLeft={() => onNavigationRedirect('BottomTab')}
|
|
190
190
|
showCall={false}
|
|
191
191
|
btnStyle={{ paddingLeft: 0 }}
|
|
192
192
|
style={{ flexDirection: 'column', alignItems: 'flex-start' }}
|
|
@@ -67,7 +67,7 @@ const ReviewProductsUI = (props: ReviewProductParams) => {
|
|
|
67
67
|
<NavBar
|
|
68
68
|
title={t('REVIEW_PRODUCT', 'Review product')}
|
|
69
69
|
titleAlign={'center'}
|
|
70
|
-
onActionLeft={() => onNavigationRedirect('
|
|
70
|
+
onActionLeft={() => onNavigationRedirect('BottomTab')}
|
|
71
71
|
showCall={false}
|
|
72
72
|
btnStyle={{ paddingLeft: 0 }}
|
|
73
73
|
style={{ flexDirection: 'column', alignItems: 'flex-start' }}
|
|
@@ -168,7 +168,7 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
|
|
|
168
168
|
<View style={{ flexDirection: 'row' }}>
|
|
169
169
|
{productAddedToCartLength > 0 && (
|
|
170
170
|
<QuantityContainer style={[styles.quantityContainer, {
|
|
171
|
-
transform: [{ translateX: 25 }, { translateY:
|
|
171
|
+
transform: [{ translateX: 25 }, { translateY: -25 }],
|
|
172
172
|
}]}>
|
|
173
173
|
<OText size={12} color={theme.colors.white}>{productAddedToCartLength.toString()}</OText>
|
|
174
174
|
</QuantityContainer>
|
|
@@ -273,6 +273,7 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
|
|
|
273
273
|
width: '100%',
|
|
274
274
|
borderRadius: 7.6,
|
|
275
275
|
marginTop: 10,
|
|
276
|
+
height: 40
|
|
276
277
|
|
|
277
278
|
}}
|
|
278
279
|
bgColor={isSoldOut ? '#B8B8B8' : theme?.colors?.white}
|
|
@@ -163,7 +163,7 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
163
163
|
}, [removeAccountState])
|
|
164
164
|
|
|
165
165
|
return (
|
|
166
|
-
<View style={{ flex: 1, height: height - top - bottom -
|
|
166
|
+
<View style={{ flex: 1, height: height - top - bottom - 42, paddingTop: 20 }}>
|
|
167
167
|
{/* <OText size={24} style={{ marginTop: 15, paddingHorizontal: 40 }}>
|
|
168
168
|
{t('PROFILE', 'Profile')}
|
|
169
169
|
</OText> */}
|
|
@@ -183,7 +183,7 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
183
183
|
<View style={{ flexBasis: '70%' }}>
|
|
184
184
|
<OText size={20} lineHeight={30} weight={Platform.OS === 'ios' ? '500' : 'bold'} color={theme.colors.textNormal}>{user?.name} {user?.lastname}</OText>
|
|
185
185
|
<TouchableOpacity onPress={() => navigation.navigate('ProfileForm', { ...detailProps })}>
|
|
186
|
-
<OText size={12} lineHeight={18} color={theme.colors.
|
|
186
|
+
<OText size={12} lineHeight={18} color={theme.colors.primary} style={{ textDecorationLine: 'underline' }}>{t('VIEW_ACCOUNT', 'View account')}</OText>
|
|
187
187
|
</TouchableOpacity>
|
|
188
188
|
</View>
|
|
189
189
|
</CenterView>
|
|
@@ -3,6 +3,7 @@ import { ImageSourcePropType, ImageStyle, ViewStyle, TextInputProps, TextStyle }
|
|
|
3
3
|
import styled from 'styled-components/native';
|
|
4
4
|
import OIcon from './OIcon';
|
|
5
5
|
import MaterialIcon from 'react-native-vector-icons/MaterialIcons'
|
|
6
|
+
import { useTheme } from 'styled-components/native';
|
|
6
7
|
|
|
7
8
|
const Input = styled.TextInput`
|
|
8
9
|
flex-grow: 1;
|
|
@@ -39,6 +40,7 @@ interface Props extends TextInputProps {
|
|
|
39
40
|
inputStyle?: TextStyle;
|
|
40
41
|
wrapperRef?: any;
|
|
41
42
|
onPress?: any;
|
|
43
|
+
isFocusHighlight?: boolean
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
const Wrapper = styled.Pressable`
|
|
@@ -54,12 +56,16 @@ const Wrapper = styled.Pressable`
|
|
|
54
56
|
`;
|
|
55
57
|
|
|
56
58
|
const OInput = (props: Props): React.ReactElement => {
|
|
59
|
+
const theme = useTheme();
|
|
60
|
+
const [inputFocused, setInputFocused] = React.useState(false)
|
|
57
61
|
return (
|
|
58
62
|
<Wrapper
|
|
59
63
|
onPress={() => { props.forwardRef?.current?.focus?.(); props.onPress && props.onPress() }}
|
|
60
64
|
style={{
|
|
61
65
|
backgroundColor: props.bgColor,
|
|
62
|
-
borderColor: props.
|
|
66
|
+
borderColor: !props.isFocusHighlight
|
|
67
|
+
? props.borderColor
|
|
68
|
+
: inputFocused ? theme.colors.primary : theme.colors.border,
|
|
63
69
|
...props.style,
|
|
64
70
|
}}>
|
|
65
71
|
{props.icon ? (
|
|
@@ -95,6 +101,8 @@ const OInput = (props: Props): React.ReactElement => {
|
|
|
95
101
|
props.forwardRef && (props.forwardRef.current = e)
|
|
96
102
|
}}
|
|
97
103
|
style={props?.inputStyle}
|
|
104
|
+
onFocus={() => setInputFocused(true)}
|
|
105
|
+
onBlur={() => setInputFocused(false)}
|
|
98
106
|
/>
|
|
99
107
|
{props.iconRight && (
|
|
100
108
|
<OIcon
|
|
@@ -114,6 +122,7 @@ OInput.defaultProps = {
|
|
|
114
122
|
iconColor: '#959595',
|
|
115
123
|
bgColor: 'white',
|
|
116
124
|
borderColor: 'white',
|
|
125
|
+
isFocusHighlight: false
|
|
117
126
|
};
|
|
118
127
|
|
|
119
128
|
export default OInput;
|