ordering-ui-react-native 0.16.79 → 0.16.80-release
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -5
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/ActiveOrders/styles.tsx +8 -14
- package/src/components/BusinessInformation/index.tsx +19 -4
- package/src/components/BusinessInformation/styles.tsx +2 -2
- package/src/components/BusinessProductsList/index.tsx +10 -10
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/LanguageSelector/index.tsx +21 -16
- package/src/components/Messages/index.tsx +2 -2
- package/src/components/OrderCreating/index.tsx +2 -2
- package/src/components/OrdersOption/index.tsx +54 -56
- package/src/components/PaymentOptionsWebView/index.tsx +119 -120
- package/src/components/SingleProductReview/index.tsx +7 -4
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +4 -4
- package/src/utils/index.tsx +2 -1
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +260 -238
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
- package/themes/business/src/components/BusinessController/index.tsx +2 -2
- package/themes/business/src/components/Chat/index.tsx +31 -31
- package/themes/business/src/components/DriverMap/index.tsx +22 -9
- package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
- package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/business/src/components/LoginForm/index.tsx +236 -80
- package/themes/business/src/components/LoginForm/styles.tsx +10 -0
- package/themes/business/src/components/MapView/index.tsx +14 -3
- package/themes/business/src/components/MessagesOption/index.tsx +11 -1
- package/themes/business/src/components/NewOrderNotification/index.tsx +31 -41
- package/themes/business/src/components/OrderDetails/Delivery.tsx +4 -3
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +88 -47
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +3 -3
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
- package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
- package/themes/business/src/components/OrdersOption/index.tsx +63 -73
- package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
- package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
- package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
- package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
- package/themes/business/src/components/PreviousOrders/index.tsx +447 -247
- package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
- package/themes/business/src/components/ProductItemAccordion/index.tsx +30 -5
- package/themes/business/src/components/ReviewCustomer/index.tsx +39 -15
- package/themes/business/src/components/shared/ODropDown.tsx +42 -8
- package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
- package/themes/business/src/components/shared/OLink.tsx +33 -13
- package/themes/business/src/components/shared/OText.tsx +8 -2
- package/themes/business/src/types/index.tsx +36 -3
- package/themes/business/src/utils/index.tsx +53 -0
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
- package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/kiosk/src/components/LoginForm/index.tsx +476 -153
- package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
- package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +1 -0
- package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
- package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
- package/themes/kiosk/src/layouts/Container.tsx +7 -1
- package/themes/kiosk/src/types/index.d.ts +14 -0
- package/themes/kiosk/src/utils/index.tsx +15 -0
- package/themes/original/index.tsx +8 -0
- package/themes/original/src/components/AddressDetails/index.tsx +10 -8
- package/themes/original/src/components/AddressForm/index.tsx +155 -139
- package/themes/original/src/components/AddressList/index.tsx +18 -18
- package/themes/original/src/components/AddressList/styles.tsx +4 -2
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +124 -78
- package/themes/original/src/components/BusinessController/index.tsx +101 -70
- package/themes/original/src/components/BusinessController/styles.tsx +14 -9
- package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
- package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
- package/themes/original/src/components/BusinessListingSearch/index.tsx +102 -155
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
- package/themes/original/src/components/BusinessProductsList/index.tsx +11 -8
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +562 -495
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +13 -12
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +116 -81
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
- package/themes/original/src/components/BusinessesListing/index.tsx +6 -6
- package/themes/original/src/components/Cart/index.tsx +75 -41
- package/themes/original/src/components/CartContent/index.tsx +80 -18
- package/themes/original/src/components/CartContent/styles.tsx +11 -1
- package/themes/original/src/components/Checkout/index.tsx +101 -106
- package/themes/original/src/components/Checkout/styles.tsx +4 -2
- package/themes/original/src/components/CitiesControl/index.tsx +89 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
- package/themes/original/src/components/DriverTips/index.tsx +52 -37
- package/themes/original/src/components/DriverTips/styles.tsx +2 -1
- package/themes/original/src/components/Favorite/index.tsx +7 -4
- package/themes/original/src/components/Favorite/styles.tsx +1 -1
- package/themes/original/src/components/FavoriteList/index.tsx +70 -80
- package/themes/original/src/components/FloatingButton/index.tsx +1 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/index.tsx +20 -19
- package/themes/original/src/components/GPSButton/styles.ts +3 -3
- package/themes/original/src/components/GoogleMap/index.tsx +10 -1
- package/themes/original/src/components/Help/index.tsx +8 -8
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +14 -20
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
- package/themes/original/src/components/HelpGuide/index.tsx +13 -12
- package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
- package/themes/original/src/components/HelpOrder/index.tsx +12 -20
- package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
- package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
- package/themes/original/src/components/LastOrder/index.tsx +1 -34
- package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
- package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
- package/themes/original/src/components/LoginForm/index.tsx +28 -8
- package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
- package/themes/original/src/components/MessageListing/index.tsx +7 -40
- package/themes/original/src/components/Messages/index.tsx +42 -26
- package/themes/original/src/components/MomentOption/index.tsx +22 -14
- package/themes/original/src/components/MultiCart/index.tsx +50 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
- package/themes/original/src/components/MultiCheckout/index.tsx +152 -77
- package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +85 -34
- package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
- package/themes/original/src/components/MyOrders/index.tsx +66 -17
- package/themes/original/src/components/NavBar/index.tsx +7 -6
- package/themes/original/src/components/NetworkError/index.tsx +5 -3
- package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
- package/themes/original/src/components/Notifications/index.tsx +144 -0
- package/themes/original/src/components/Notifications/styles.tsx +20 -0
- package/themes/original/src/components/OrderDetails/index.tsx +108 -218
- package/themes/original/src/components/OrderDetails/styles.tsx +10 -1
- package/themes/original/src/components/OrderItAgain/index.tsx +46 -43
- package/themes/original/src/components/OrderProgress/index.tsx +81 -105
- package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
- package/themes/original/src/components/OrderSummary/index.tsx +2 -2
- package/themes/original/src/components/OrderTypeSelector/index.tsx +13 -6
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +93 -97
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
- package/themes/original/src/components/OrdersOption/index.tsx +86 -92
- package/themes/original/src/components/PageBanner/index.tsx +146 -0
- package/themes/original/src/components/PageBanner/styles.tsx +11 -0
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +1 -1
- package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
- package/themes/original/src/components/PlaceSpot/index.tsx +16 -6
- package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
- package/themes/original/src/components/ProductForm/index.tsx +240 -254
- package/themes/original/src/components/ProductForm/styles.tsx +5 -8
- package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -10
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
- package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
- package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -49
- package/themes/original/src/components/ProfessionalProfile/index.tsx +54 -14
- package/themes/original/src/components/Promotions/index.tsx +234 -220
- package/themes/original/src/components/Promotions/styles.tsx +7 -2
- package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
- package/themes/original/src/components/ReviewOrder/index.tsx +43 -11
- package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
- package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
- package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
- package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
- package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
- package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
- package/themes/original/src/components/ServiceForm/index.tsx +377 -270
- package/themes/original/src/components/Sessions/index.tsx +11 -8
- package/themes/original/src/components/Sessions/styles.tsx +5 -0
- package/themes/original/src/components/SignupForm/index.tsx +78 -66
- package/themes/original/src/components/SingleOrderCard/index.tsx +125 -56
- package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
- package/themes/original/src/components/SingleProductCard/index.tsx +112 -77
- package/themes/original/src/components/SingleProductCard/styles.tsx +14 -13
- package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
- package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
- package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
- package/themes/original/src/components/StripeElementsForm/index.tsx +4 -1
- package/themes/original/src/components/UpsellingProducts/index.tsx +244 -215
- package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
- package/themes/original/src/components/UserDetails/index.tsx +5 -3
- package/themes/original/src/components/UserFormDetails/index.tsx +50 -54
- package/themes/original/src/components/UserProfile/index.tsx +58 -35
- package/themes/original/src/components/UserProfile/styles.ts +17 -0
- package/themes/original/src/components/UserProfileForm/index.tsx +21 -28
- package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
- package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
- package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
- package/themes/original/src/components/Wallets/index.tsx +177 -164
- package/themes/original/src/components/Wallets/styles.tsx +12 -8
- package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
- package/themes/original/src/components/shared/OBottomPopup.tsx +1 -1
- package/themes/original/src/components/shared/OButton.tsx +9 -4
- package/themes/original/src/components/shared/OIcon.tsx +8 -1
- package/themes/original/src/components/shared/OInput.tsx +10 -1
- package/themes/original/src/layouts/Container.tsx +13 -9
- package/themes/original/src/types/index.tsx +42 -7
- package/themes/original/src/utils/index.tsx +322 -58
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
TouchableOpacity,
|
|
6
6
|
Keyboard,
|
|
7
7
|
TouchableWithoutFeedback,
|
|
8
|
-
KeyboardAvoidingView,
|
|
9
8
|
Platform,
|
|
10
9
|
} from 'react-native';
|
|
11
10
|
import {
|
|
@@ -22,7 +21,7 @@ import Spinner from 'react-native-loading-spinner-overlay';
|
|
|
22
21
|
import { useForm, Controller } from 'react-hook-form';
|
|
23
22
|
import Geocoder from 'react-native-geocoding';
|
|
24
23
|
|
|
25
|
-
import { OInput, OButton,
|
|
24
|
+
import { OInput, OButton, OModal, OIcon } from '../shared';
|
|
26
25
|
import { AddressFormParams } from '../../types';
|
|
27
26
|
import { getTraduction } from '../../utils';
|
|
28
27
|
import { useTheme } from 'styled-components/native';
|
|
@@ -57,15 +56,16 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
57
56
|
addressState,
|
|
58
57
|
addressesList,
|
|
59
58
|
saveAddress,
|
|
60
|
-
userCustomerSetup,
|
|
61
59
|
isGuestUser,
|
|
62
60
|
isRequiredField,
|
|
61
|
+
showField,
|
|
63
62
|
isFromProductsList,
|
|
64
63
|
hasAddressDefault,
|
|
65
64
|
afterSignup,
|
|
66
65
|
} = props;
|
|
67
66
|
|
|
68
67
|
const theme = useTheme();
|
|
68
|
+
const [autoCompleteInputFocused, setAutoCompleteInputFocused] = useState(false)
|
|
69
69
|
|
|
70
70
|
const tagsName = [
|
|
71
71
|
{ icon: theme.images.general.tag_home, value: 'home' },
|
|
@@ -84,7 +84,6 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
84
84
|
backgroundColor: theme.colors.clear
|
|
85
85
|
},
|
|
86
86
|
inputsStyle: {
|
|
87
|
-
borderColor: theme.colors.border,
|
|
88
87
|
borderRadius: 10,
|
|
89
88
|
marginBottom: 20,
|
|
90
89
|
height: 50,
|
|
@@ -93,7 +92,6 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
93
92
|
flex: 1,
|
|
94
93
|
},
|
|
95
94
|
textAreaStyles: {
|
|
96
|
-
borderColor: theme.colors.border,
|
|
97
95
|
borderRadius: 10,
|
|
98
96
|
marginBottom: 20,
|
|
99
97
|
height: 104,
|
|
@@ -107,6 +105,12 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
107
105
|
end: 0,
|
|
108
106
|
top: 12,
|
|
109
107
|
zIndex: 1002,
|
|
108
|
+
right: autoCompleteInputFocused && (
|
|
109
|
+
!!address?.address ||
|
|
110
|
+
!!formState.changes?.address ||
|
|
111
|
+
!!addressState.address.address
|
|
112
|
+
) ? 30 : 15,
|
|
113
|
+
width: 16
|
|
110
114
|
},
|
|
111
115
|
wrapperNavbar: Platform.OS === 'ios'
|
|
112
116
|
? { paddingVertical: 0, paddingHorizontal: 40 }
|
|
@@ -155,7 +159,7 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
155
159
|
'true';
|
|
156
160
|
const maxLimitLocation =
|
|
157
161
|
configState?.configs?.meters_to_change_address?.value;
|
|
158
|
-
|
|
162
|
+
const countryCode = configState?.configs?.country_autocomplete?.value
|
|
159
163
|
const continueAsGuest = () => navigation.navigate('BusinessList', { isGuestUser: true });
|
|
160
164
|
const goToBack = () => navigation?.canGoBack() && navigation.goBack();
|
|
161
165
|
|
|
@@ -358,7 +362,7 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
358
362
|
if (
|
|
359
363
|
orderState.loading &&
|
|
360
364
|
!addressesList &&
|
|
361
|
-
orderState
|
|
365
|
+
orderState?.options?.address &&
|
|
362
366
|
auth &&
|
|
363
367
|
!afterSignup
|
|
364
368
|
) {
|
|
@@ -366,7 +370,7 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
366
370
|
? navigation.navigate('BottomTab')
|
|
367
371
|
: navigation.navigate('Business');
|
|
368
372
|
}
|
|
369
|
-
}, [orderState
|
|
373
|
+
}, [orderState?.options?.address]);
|
|
370
374
|
|
|
371
375
|
useEffect(() => {
|
|
372
376
|
if (alertState.open && alertState?.key !== 'ERROR_MAX_LIMIT_LOCATION') {
|
|
@@ -545,7 +549,10 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
545
549
|
onPress={(data, details: any) => {
|
|
546
550
|
handleChangeAddress(data, details);
|
|
547
551
|
}}
|
|
548
|
-
query={{
|
|
552
|
+
query={{
|
|
553
|
+
key: googleMapsApiKey,
|
|
554
|
+
components: countryCode && countryCode !== '*' ? `country:${countryCode}` : ''
|
|
555
|
+
}}
|
|
549
556
|
fetchDetails
|
|
550
557
|
ref={googleInput}
|
|
551
558
|
textInputProps={{
|
|
@@ -564,6 +571,8 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
564
571
|
autoCorrect: false,
|
|
565
572
|
blurOnSubmit: false,
|
|
566
573
|
returnKeyType: 'next',
|
|
574
|
+
onFocus: () => setAutoCompleteInputFocused(true),
|
|
575
|
+
onBlur: () => setAutoCompleteInputFocused(false)
|
|
567
576
|
}}
|
|
568
577
|
onFail={(error) =>
|
|
569
578
|
setAlertState({
|
|
@@ -587,45 +596,40 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
587
596
|
textInput: {
|
|
588
597
|
borderWidth: 1,
|
|
589
598
|
borderRadius: 7.6,
|
|
590
|
-
borderColor: theme.colors.border,
|
|
599
|
+
borderColor: autoCompleteInputFocused ? theme.colors.primary : theme.colors.border,
|
|
591
600
|
flexGrow: 1,
|
|
592
601
|
fontSize: 15,
|
|
593
|
-
|
|
602
|
+
paddingLeft: 16,
|
|
603
|
+
paddingRight: 32,
|
|
594
604
|
minHeight: 50,
|
|
595
605
|
fontFamily: 'Poppins-Regular',
|
|
596
|
-
marginBottom: 24
|
|
606
|
+
marginBottom: 24
|
|
597
607
|
},
|
|
598
608
|
}}
|
|
599
609
|
/>
|
|
600
610
|
)}
|
|
601
611
|
/>
|
|
602
|
-
{hasEditing ? (
|
|
603
|
-
<View style={styles.pinIcon}>
|
|
604
|
-
<GPSButton
|
|
605
|
-
apiKey={googleMapsApiKey}
|
|
606
|
-
handleGPS={(data: any, detail: any) => {
|
|
607
|
-
handleChangeAddress(data, detail);
|
|
608
|
-
setValue(data.address);
|
|
609
|
-
if (googleInput?.current) {
|
|
610
|
-
googleInput?.current?.setAddressText(data.address);
|
|
611
|
-
}
|
|
612
|
-
}}
|
|
613
|
-
IconButton={<OIcon src={theme.images.general.pin} width={16} />}
|
|
614
|
-
/>
|
|
615
|
-
</View>
|
|
616
|
-
) : null}
|
|
617
|
-
</AutocompleteInput>
|
|
618
612
|
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
613
|
+
{(
|
|
614
|
+
((!isEditing && !isGuestUser) ||
|
|
615
|
+
(isEditing && !isGuestUser)) ||
|
|
616
|
+
(isGuestUser)) &&
|
|
617
|
+
(
|
|
618
|
+
<View style={styles.pinIcon}>
|
|
619
|
+
<GPSButton
|
|
620
|
+
apiKey={googleMapsApiKey}
|
|
621
|
+
handleGPS={(data: any, detail: any) => {
|
|
622
|
+
handleChangeAddress(data, detail);
|
|
623
|
+
setValue('address', data.address);
|
|
624
|
+
if (googleInput?.current) {
|
|
625
|
+
googleInput?.current?.setAddressText(data.address);
|
|
626
|
+
}
|
|
627
|
+
}}
|
|
628
|
+
IconButton={<OIcon src={theme.images.general.pin} width={16} />}
|
|
629
|
+
/>
|
|
630
|
+
</View>
|
|
631
|
+
)}
|
|
632
|
+
</AutocompleteInput>
|
|
629
633
|
|
|
630
634
|
{(locationChange || formState.changes?.location) && (
|
|
631
635
|
<View
|
|
@@ -649,129 +653,141 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
649
653
|
)}
|
|
650
654
|
|
|
651
655
|
<View style={{ flexDirection: 'row', flexBasis: '50%' }}>
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
656
|
+
{showField && showField('internal_number') && (
|
|
657
|
+
<Controller
|
|
658
|
+
control={control}
|
|
659
|
+
name="internal_number"
|
|
660
|
+
rules={{
|
|
661
|
+
required:
|
|
662
|
+
isRequiredField && isRequiredField('internal_number')
|
|
663
|
+
? t(
|
|
664
|
+
`VALIDATION_ERROR_INTERNAL_NUMBER_REQUIRED`,
|
|
665
|
+
`The field internal number is required`,
|
|
666
|
+
)
|
|
667
|
+
: null,
|
|
668
|
+
}}
|
|
669
|
+
defaultValue={
|
|
670
|
+
address?.internal_number ||
|
|
671
|
+
formState.changes?.internal_number ||
|
|
672
|
+
addressState?.address?.internal_number ||
|
|
673
|
+
''
|
|
674
|
+
}
|
|
675
|
+
render={() => (
|
|
676
|
+
<OInput
|
|
677
|
+
name="internal_number"
|
|
678
|
+
placeholder={t('INTERNAL_NUMBER', 'Internal number')}
|
|
679
|
+
onChange={(text: string) => {
|
|
680
|
+
handleChangeInput(text);
|
|
681
|
+
setValue('internal_number', text);
|
|
682
|
+
}}
|
|
683
|
+
value={
|
|
684
|
+
address?.internal_number ||
|
|
685
|
+
formState.changes?.internal_number ||
|
|
686
|
+
addressState?.address?.internal_number ||
|
|
687
|
+
''
|
|
688
|
+
}
|
|
689
|
+
isFocusHighlight
|
|
690
|
+
style={{
|
|
691
|
+
...styles.inputsStyle,
|
|
692
|
+
marginRight: showField('internal_number') && showField('zipcode') ? 24 : 0
|
|
693
|
+
}}
|
|
694
|
+
forwardRef={internalNumberRef}
|
|
695
|
+
returnKeyType="next"
|
|
696
|
+
onSubmitEditing={() => zipCodeRef?.current?.focus?.()}
|
|
697
|
+
blurOnSubmit={false}
|
|
698
|
+
/>
|
|
699
|
+
)}
|
|
700
|
+
/>
|
|
701
|
+
)}
|
|
692
702
|
|
|
703
|
+
{showField && showField('zipcode') && (
|
|
704
|
+
<Controller
|
|
705
|
+
control={control}
|
|
706
|
+
name="zipcode"
|
|
707
|
+
rules={{
|
|
708
|
+
required:
|
|
709
|
+
isRequiredField && isRequiredField('zipcode')
|
|
710
|
+
? t(
|
|
711
|
+
`VALIDATION_ERROR_ZIP_CODE_REQUIRED`,
|
|
712
|
+
`The field Zip Code is required`,
|
|
713
|
+
)
|
|
714
|
+
: null,
|
|
715
|
+
}}
|
|
716
|
+
defaultValue={
|
|
717
|
+
address?.zipcode ||
|
|
718
|
+
formState.changes?.zipcode ||
|
|
719
|
+
addressState.address.zipcode ||
|
|
720
|
+
''
|
|
721
|
+
}
|
|
722
|
+
render={() => (
|
|
723
|
+
<OInput
|
|
724
|
+
name="zipcode"
|
|
725
|
+
placeholder={t('ZIP_CODE', 'Zip code')}
|
|
726
|
+
onChange={(text: string) => {
|
|
727
|
+
handleChangeInput(text);
|
|
728
|
+
setValue('zipcode', text);
|
|
729
|
+
}}
|
|
730
|
+
value={
|
|
731
|
+
address?.zipcode ||
|
|
732
|
+
formState.changes?.zipcode ||
|
|
733
|
+
addressState.address.zipcode ||
|
|
734
|
+
''
|
|
735
|
+
}
|
|
736
|
+
isFocusHighlight
|
|
737
|
+
style={styles.inputsStyle}
|
|
738
|
+
forwardRef={zipCodeRef}
|
|
739
|
+
returnKeyType="next"
|
|
740
|
+
onSubmitEditing={() => addressNotesRef?.current?.focus?.()}
|
|
741
|
+
blurOnSubmit={false}
|
|
742
|
+
/>
|
|
743
|
+
)}
|
|
744
|
+
/>
|
|
745
|
+
)}
|
|
746
|
+
</View>
|
|
747
|
+
|
|
748
|
+
{showField && showField('address_notes') && (
|
|
693
749
|
<Controller
|
|
694
750
|
control={control}
|
|
695
|
-
name="
|
|
751
|
+
name="address_notes"
|
|
696
752
|
rules={{
|
|
697
753
|
required:
|
|
698
|
-
isRequiredField && isRequiredField('
|
|
754
|
+
isRequiredField && isRequiredField('address_notes')
|
|
699
755
|
? t(
|
|
700
|
-
`
|
|
701
|
-
`The field
|
|
756
|
+
`VALIDATION_ERROR_ADDRESS_NOTES_REQUIRED`,
|
|
757
|
+
`The field address notes is required`,
|
|
702
758
|
)
|
|
703
759
|
: null,
|
|
704
760
|
}}
|
|
705
761
|
defaultValue={
|
|
706
|
-
address?.
|
|
707
|
-
formState.changes?.
|
|
708
|
-
addressState.address.
|
|
762
|
+
address?.address_notes ||
|
|
763
|
+
formState.changes?.address_notes ||
|
|
764
|
+
addressState.address.address_notes ||
|
|
709
765
|
''
|
|
710
766
|
}
|
|
711
767
|
render={() => (
|
|
712
768
|
<OInput
|
|
713
|
-
name="
|
|
714
|
-
placeholder={t('
|
|
715
|
-
onChange={(text:
|
|
769
|
+
name="address_notes"
|
|
770
|
+
placeholder={t('ADDRESS_NOTES', 'Address notes')}
|
|
771
|
+
onChange={(text: any) => {
|
|
716
772
|
handleChangeInput(text);
|
|
717
|
-
setValue('
|
|
773
|
+
setValue('address_notes', text);
|
|
718
774
|
}}
|
|
719
775
|
value={
|
|
720
|
-
address?.
|
|
721
|
-
formState.changes?.
|
|
722
|
-
addressState.address.
|
|
776
|
+
address?.address_notes ||
|
|
777
|
+
formState.changes?.address_notes ||
|
|
778
|
+
addressState.address.address_notes ||
|
|
723
779
|
''
|
|
724
780
|
}
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
781
|
+
multiline
|
|
782
|
+
isFocusHighlight
|
|
783
|
+
style={styles.textAreaStyles}
|
|
784
|
+
returnKeyType="done"
|
|
785
|
+
forwardRef={addressNotesRef}
|
|
786
|
+
blurOnSubmit
|
|
730
787
|
/>
|
|
731
788
|
)}
|
|
732
789
|
/>
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
<Controller
|
|
736
|
-
control={control}
|
|
737
|
-
name="address_notes"
|
|
738
|
-
rules={{
|
|
739
|
-
required:
|
|
740
|
-
isRequiredField && isRequiredField('address_notes')
|
|
741
|
-
? t(
|
|
742
|
-
`VALIDATION_ERROR_ADDRESS_NOTES_REQUIRED`,
|
|
743
|
-
`The field address notes is required`,
|
|
744
|
-
)
|
|
745
|
-
: null,
|
|
746
|
-
}}
|
|
747
|
-
defaultValue={
|
|
748
|
-
address?.address_notes ||
|
|
749
|
-
formState.changes?.address_notes ||
|
|
750
|
-
addressState.address.address_notes ||
|
|
751
|
-
''
|
|
752
|
-
}
|
|
753
|
-
render={() => (
|
|
754
|
-
<OInput
|
|
755
|
-
name="address_notes"
|
|
756
|
-
placeholder={t('ADDRESS_NOTES', 'Address notes')}
|
|
757
|
-
onChange={(text: any) => {
|
|
758
|
-
handleChangeInput(text);
|
|
759
|
-
setValue('address_notes', text);
|
|
760
|
-
}}
|
|
761
|
-
value={
|
|
762
|
-
address?.address_notes ||
|
|
763
|
-
formState.changes?.address_notes ||
|
|
764
|
-
addressState.address.address_notes ||
|
|
765
|
-
''
|
|
766
|
-
}
|
|
767
|
-
multiline
|
|
768
|
-
style={styles.textAreaStyles}
|
|
769
|
-
returnKeyType="done"
|
|
770
|
-
forwardRef={addressNotesRef}
|
|
771
|
-
blurOnSubmit
|
|
772
|
-
/>
|
|
773
|
-
)}
|
|
774
|
-
/>
|
|
790
|
+
)}
|
|
775
791
|
</FormInput>
|
|
776
792
|
<IconsContainer>
|
|
777
793
|
{tagsName.map((tag) => (
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React, { useEffect } from 'react'
|
|
2
2
|
import { AddressList as AddressListController, useLanguage, useOrder, useSession } from 'ordering-components/native'
|
|
3
|
-
import {
|
|
3
|
+
import { AddressItem, Container } from './styles'
|
|
4
4
|
import { Platform, RefreshControl, StyleSheet, View } from 'react-native'
|
|
5
5
|
import { OButton, OText, OAlert, OModal, OIcon } from '../shared'
|
|
6
|
-
import { Container } from '../../layouts/Container'
|
|
7
6
|
import { AddressListParams } from '../../types'
|
|
8
7
|
import { NotFoundSource } from '../NotFoundSource'
|
|
9
8
|
import NavBar from '../NavBar'
|
|
@@ -56,7 +55,7 @@ const AddressListUI = (props: AddressListParams) => {
|
|
|
56
55
|
}
|
|
57
56
|
|
|
58
57
|
const uniqueAddressesList = (addressList.addresses && addressList.addresses.filter(
|
|
59
|
-
(address: any, i: number, self: any) =>
|
|
58
|
+
(address: any, i: number, self: any) => address.address &&
|
|
60
59
|
i === self.findIndex((obj: any) => (
|
|
61
60
|
address.address === obj.address &&
|
|
62
61
|
address.address_notes === obj.address_notes &&
|
|
@@ -143,8 +142,7 @@ const AddressListUI = (props: AddressListParams) => {
|
|
|
143
142
|
}, [])
|
|
144
143
|
|
|
145
144
|
return (
|
|
146
|
-
<Container
|
|
147
|
-
noPadding
|
|
145
|
+
<Container
|
|
148
146
|
refreshControl={
|
|
149
147
|
<RefreshControl
|
|
150
148
|
refreshing={refreshing}
|
|
@@ -152,17 +150,18 @@ const AddressListUI = (props: AddressListParams) => {
|
|
|
152
150
|
/>
|
|
153
151
|
}
|
|
154
152
|
>
|
|
155
|
-
{isProfile && (
|
|
156
|
-
<NavBar
|
|
157
|
-
title={t('SAVED_PLACES', 'My saved places')}
|
|
158
|
-
titleAlign={'center'}
|
|
159
|
-
onActionLeft={goToBack}
|
|
160
|
-
showCall={false}
|
|
161
|
-
style={{ paddingHorizontal: 40, paddingVertical: Platform.OS === 'ios' ? 0 : 20, marginTop: Platform.OS === 'ios' ? 0 : 30 }}
|
|
162
|
-
/>
|
|
163
|
-
)}
|
|
164
153
|
{(!addressList.loading || (isFromProductsList || isFromBusinesses || isFromProfile || isProfile)) && (
|
|
165
|
-
|
|
154
|
+
<>
|
|
155
|
+
{isProfile && (
|
|
156
|
+
<NavBar
|
|
157
|
+
title={t('SAVED_PLACES', 'My saved places')}
|
|
158
|
+
titleAlign={'center'}
|
|
159
|
+
onActionLeft={goToBack}
|
|
160
|
+
showCall={false}
|
|
161
|
+
paddingTop={10}
|
|
162
|
+
btnStyle={{ paddingLeft: 0 }}
|
|
163
|
+
/>
|
|
164
|
+
)}
|
|
166
165
|
{
|
|
167
166
|
route &&
|
|
168
167
|
(
|
|
@@ -178,8 +177,8 @@ const AddressListUI = (props: AddressListParams) => {
|
|
|
178
177
|
onActionLeft={() => goToBack()}
|
|
179
178
|
showCall={false}
|
|
180
179
|
btnStyle={{ paddingLeft: 0 }}
|
|
181
|
-
paddingTop={
|
|
182
|
-
style={{ marginTop:
|
|
180
|
+
paddingTop={10}
|
|
181
|
+
style={{ marginTop: 0 }}
|
|
183
182
|
titleWrapStyle={{ paddingHorizontal: 0 }}
|
|
184
183
|
titleStyle={{ marginLeft: 0, marginRight: 0 }}
|
|
185
184
|
/>
|
|
@@ -328,7 +327,8 @@ const AddressListUI = (props: AddressListParams) => {
|
|
|
328
327
|
/>
|
|
329
328
|
</>
|
|
330
329
|
)}
|
|
331
|
-
|
|
330
|
+
</>
|
|
331
|
+
|
|
332
332
|
)}
|
|
333
333
|
</Container>
|
|
334
334
|
)
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import styled from 'styled-components/native'
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const Container = styled.ScrollView`
|
|
4
|
+
position: relative;
|
|
4
5
|
flex: 1;
|
|
5
6
|
paddingLeft: 40px;
|
|
6
7
|
paddingRight: 40px;
|
|
7
|
-
|
|
8
|
+
margin-bottom: 40px;
|
|
9
|
+
padding-top: 10px;
|
|
8
10
|
`
|
|
9
11
|
|
|
10
12
|
export const AddressItem = styled.TouchableOpacity`
|
|
@@ -21,7 +21,7 @@ export const AppleLogin = (props: any) => {
|
|
|
21
21
|
const [{ configs }] = useConfig();
|
|
22
22
|
const [credentialStateForUser, updateCredentialStateForUser] = useState<any>(-1);
|
|
23
23
|
|
|
24
|
-
let user
|
|
24
|
+
let user: any = null
|
|
25
25
|
|
|
26
26
|
const buttonText = auth
|
|
27
27
|
? t('CONTINUE_WITH_APPLE', 'Logout with Apple')
|
|
@@ -53,7 +53,7 @@ export const AppleLogin = (props: any) => {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
const fetchAndUpdateCredentialState = async (updateCredentialStateForUser
|
|
56
|
+
const fetchAndUpdateCredentialState = async (updateCredentialStateForUser: any) => {
|
|
57
57
|
if (user === null) {
|
|
58
58
|
updateCredentialStateForUser('N/A');
|
|
59
59
|
} else {
|
|
@@ -66,7 +66,7 @@ export const AppleLogin = (props: any) => {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
const onIOSButtonPress = async (updateCredentialStateForUser
|
|
69
|
+
const onIOSButtonPress = async (updateCredentialStateForUser: any) => {
|
|
70
70
|
try {
|
|
71
71
|
const appleAuthRequestResponse = await appleAuth.performRequest({
|
|
72
72
|
requestedOperation: appleAuth.Operation.LOGIN,
|
|
@@ -79,7 +79,7 @@ export const AppleLogin = (props: any) => {
|
|
|
79
79
|
identityToken,
|
|
80
80
|
authorizationCode
|
|
81
81
|
} = appleAuthRequestResponse;
|
|
82
|
-
|
|
82
|
+
|
|
83
83
|
user = newUser;
|
|
84
84
|
|
|
85
85
|
fetchAndUpdateCredentialState(updateCredentialStateForUser).catch(error =>
|