ordering-ui-react-native 0.16.15 → 0.16.16-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 +7 -4
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/ActiveOrders/index.tsx +61 -63
- package/src/components/ActiveOrders/styles.tsx +8 -14
- package/src/components/AddressForm/index.tsx +18 -2
- package/src/components/BusinessBasicInformation/index.tsx +11 -19
- package/src/components/BusinessController/index.tsx +10 -8
- package/src/components/BusinessInformation/index.tsx +33 -4
- package/src/components/BusinessInformation/styles.tsx +2 -2
- package/src/components/BusinessProductsList/index.tsx +10 -10
- package/src/components/BusinessTypeFilter/index.tsx +1 -2
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +2 -1
- package/src/components/LanguageSelector/index.tsx +21 -16
- package/src/components/LoginForm/index.tsx +118 -30
- package/src/components/LoginForm/styles.tsx +6 -0
- package/src/components/Messages/index.tsx +2 -2
- package/src/components/NotificationSetting/index.tsx +85 -0
- package/src/components/OrderDetails/index.tsx +7 -21
- package/src/components/OrdersOption/index.tsx +54 -56
- package/src/components/PaymentOptions/index.tsx +335 -365
- package/src/components/PaymentOptionsWebView/index.tsx +120 -121
- package/src/components/ReviewDriver/index.tsx +1 -1
- package/src/components/ReviewOrder/index.tsx +2 -1
- package/src/components/ReviewProducts/index.tsx +11 -0
- package/src/components/SignupForm/index.tsx +143 -61
- package/src/components/SingleProductReview/index.tsx +8 -5
- package/src/components/StripeElementsForm/index.tsx +25 -16
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OBottomPopup.tsx +6 -2
- package/src/index.tsx +2 -0
- package/src/pages/BusinessesListing.tsx +7 -6
- package/src/pages/OrderDetails.tsx +1 -1
- package/src/pages/ReviewDriver.tsx +2 -2
- package/src/pages/ReviewOrder.tsx +2 -2
- package/src/theme.json +0 -1
- package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
- package/src/types/index.tsx +13 -9
- package/src/utils/index.tsx +0 -1
- package/themes/business/index.tsx +4 -0
- package/themes/business/src/components/BusinessController/index.tsx +2 -2
- package/themes/business/src/components/Chat/index.tsx +42 -34
- package/themes/business/src/components/DriverMap/index.tsx +7 -5
- package/themes/business/src/components/DriverSchedule/index.tsx +71 -0
- package/themes/business/src/components/DriverSchedule/styles.tsx +6 -0
- package/themes/business/src/components/LoginForm/index.tsx +111 -74
- package/themes/business/src/components/MapView/index.tsx +12 -1
- package/themes/business/src/components/MessagesOption/index.tsx +11 -1
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
- package/themes/business/src/components/OrderDetails/Delivery.tsx +3 -3
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +27 -21
- package/themes/business/src/components/OrdersListManager/index.tsx +10 -3
- package/themes/business/src/components/OrdersOption/index.tsx +65 -21
- 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/index.tsx +21 -23
- package/themes/business/src/components/ProductItemAccordion/index.tsx +5 -4
- package/themes/business/src/components/ReviewCustomer/index.tsx +1 -1
- package/themes/business/src/components/ScheduleBlocked/index.tsx +53 -0
- package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
- package/themes/business/src/components/UserProfileForm/index.tsx +28 -4
- 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/OModal.tsx +40 -37
- package/themes/business/src/types/index.tsx +15 -9
- package/themes/business/src/utils/index.tsx +10 -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/BusinessMenu/index.tsx +2 -1
- package/themes/kiosk/src/components/CartItem/index.tsx +4 -3
- package/themes/kiosk/src/components/CategoriesMenu/index.tsx +1 -0
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/DrawerView/index.tsx +1 -0
- package/themes/kiosk/src/components/DrawerView/styles.tsx +2 -2
- package/themes/kiosk/src/components/LoginForm/index.tsx +121 -10
- package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
- 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/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/types/index.d.ts +2 -0
- package/themes/original/index.tsx +12 -0
- package/themes/original/src/components/AddressForm/index.tsx +136 -133
- package/themes/original/src/components/AddressList/index.tsx +1 -1
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +302 -160
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +6 -2
- package/themes/original/src/components/BusinessController/index.tsx +173 -108
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +9 -7
- package/themes/original/src/components/BusinessItemAccordion/styles.tsx +4 -0
- 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 +106 -126
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +18 -13
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
- package/themes/original/src/components/BusinessProductsList/index.tsx +53 -53
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +280 -175
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +18 -4
- package/themes/original/src/components/BusinessReviews/index.tsx +6 -1
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +109 -40
- package/themes/original/src/components/BusinessTypeFilter/styles.tsx +2 -0
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +561 -0
- package/themes/original/src/components/BusinessesListing/{styles.tsx → Layout/Appointment/styles.tsx} +24 -2
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +676 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +137 -0
- package/themes/original/src/components/BusinessesListing/index.tsx +100 -495
- package/themes/original/src/components/Cart/index.tsx +70 -34
- package/themes/original/src/components/Cart/styles.tsx +4 -0
- package/themes/original/src/components/CartContent/index.tsx +22 -16
- package/themes/original/src/components/Checkout/index.tsx +106 -66
- package/themes/original/src/components/Checkout/styles.tsx +0 -1
- package/themes/original/src/components/DriverTips/index.tsx +4 -4
- package/themes/original/src/components/DriverTips/styles.tsx +2 -1
- package/themes/original/src/components/Favorite/index.tsx +1 -0
- package/themes/original/src/components/Favorite/styles.tsx +1 -0
- package/themes/original/src/components/FavoriteList/index.tsx +143 -94
- package/themes/original/src/components/GPSButton/index.tsx +20 -19
- package/themes/original/src/components/GoogleMap/index.tsx +20 -12
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +8 -3
- package/themes/original/src/components/HelpGuide/index.tsx +8 -3
- package/themes/original/src/components/HelpOrder/index.tsx +8 -3
- package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
- package/themes/original/src/components/LoginForm/Otp/index.tsx +3 -2
- package/themes/original/src/components/LoginForm/index.tsx +79 -42
- package/themes/original/src/components/Messages/index.tsx +17 -17
- package/themes/original/src/components/MomentSelector/index.tsx +197 -0
- package/themes/original/src/components/MomentSelector/styles.tsx +6 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +2 -2
- package/themes/original/src/components/MultiCheckout/index.tsx +14 -1
- package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +13 -11
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +31 -19
- package/themes/original/src/components/MyOrders/index.tsx +68 -6
- package/themes/original/src/components/NavBar/index.tsx +11 -5
- 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 +148 -0
- package/themes/original/src/components/Notifications/styles.tsx +17 -0
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +167 -0
- package/themes/original/src/components/OrderDetails/index.tsx +209 -49
- package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
- package/themes/original/src/components/OrderItAgain/index.tsx +75 -0
- package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
- package/themes/original/src/components/OrderProgress/index.tsx +8 -2
- package/themes/original/src/components/OrderSummary/index.tsx +1 -34
- package/themes/original/src/components/OrderTypeSelector/index.tsx +84 -36
- package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +100 -106
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +17 -12
- package/themes/original/src/components/OrdersOption/index.tsx +38 -23
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +57 -37
- package/themes/original/src/components/PhoneInputNumber/index.tsx +4 -10
- package/themes/original/src/components/PlaceSpot/index.tsx +243 -47
- package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
- package/themes/original/src/components/ProductForm/index.tsx +712 -655
- package/themes/original/src/components/ProductForm/styles.tsx +9 -7
- package/themes/original/src/components/ProductItemAccordion/index.tsx +170 -128
- package/themes/original/src/components/ProductOption/index.tsx +1 -1
- package/themes/original/src/components/ProfessionalFilter/index.tsx +129 -0
- package/themes/original/src/components/ProfessionalFilter/styles.tsx +0 -0
- package/themes/original/src/components/ProfessionalProfile/index.tsx +309 -0
- package/themes/original/src/components/ProfessionalProfile/styles.tsx +46 -0
- package/themes/original/src/components/ReviewDriver/index.tsx +6 -6
- package/themes/original/src/components/ReviewOrder/index.tsx +18 -3
- package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
- package/themes/original/src/components/ReviewTrigger/index.tsx +118 -0
- package/themes/original/src/components/ReviewTrigger/styles.tsx +34 -0
- package/themes/original/src/components/SearchBar/index.tsx +10 -5
- package/themes/original/src/components/ServiceForm/index.tsx +631 -0
- package/themes/original/src/components/ServiceForm/styles.tsx +50 -0
- package/themes/original/src/components/SignupForm/index.tsx +301 -158
- package/themes/original/src/components/SingleOrderCard/index.tsx +213 -177
- package/themes/original/src/components/SingleProductCard/index.tsx +198 -110
- package/themes/original/src/components/SingleProductCard/styles.tsx +2 -2
- package/themes/original/src/components/SingleProductReview/index.tsx +30 -3
- package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
- package/themes/original/src/components/StripeElementsForm/index.tsx +15 -7
- package/themes/original/src/components/UpsellingProducts/index.tsx +14 -4
- package/themes/original/src/components/UserDetails/index.tsx +31 -17
- package/themes/original/src/components/UserFormDetails/index.tsx +74 -81
- package/themes/original/src/components/UserProfile/index.tsx +57 -29
- package/themes/original/src/components/UserProfile/styles.ts +17 -0
- package/themes/original/src/components/UserProfileForm/index.tsx +15 -10
- 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 +174 -162
- package/themes/original/src/components/Wallets/styles.tsx +10 -8
- package/themes/original/src/components/shared/OBottomPopup.tsx +47 -14
- package/themes/original/src/components/shared/OButton.tsx +10 -3
- package/themes/original/src/components/shared/OInput.tsx +3 -2
- package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
- package/themes/original/src/types/index.tsx +123 -29
- package/themes/original/src/utils/index.tsx +77 -0
- 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,9 +56,9 @@ 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,
|
|
@@ -109,8 +108,8 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
109
108
|
zIndex: 1002,
|
|
110
109
|
},
|
|
111
110
|
wrapperNavbar: Platform.OS === 'ios'
|
|
112
|
-
? {
|
|
113
|
-
: {
|
|
111
|
+
? { paddingVertical: 0, paddingHorizontal: 40 }
|
|
112
|
+
: { paddingVertical: 20, paddingHorizontal: 40 }
|
|
114
113
|
});
|
|
115
114
|
|
|
116
115
|
const [, t] = useLanguage();
|
|
@@ -156,7 +155,7 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
156
155
|
const maxLimitLocation =
|
|
157
156
|
configState?.configs?.meters_to_change_address?.value;
|
|
158
157
|
|
|
159
|
-
const continueAsGuest = () => navigation.navigate('BusinessList');
|
|
158
|
+
const continueAsGuest = () => navigation.navigate('BusinessList', { isGuestUser: true });
|
|
160
159
|
const goToBack = () => navigation?.canGoBack() && navigation.goBack();
|
|
161
160
|
|
|
162
161
|
const getAddressFormatted = (address: any) => {
|
|
@@ -203,6 +202,7 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
203
202
|
saveAddress(data.address);
|
|
204
203
|
if (isGuestUser) {
|
|
205
204
|
continueAsGuest();
|
|
205
|
+
return;
|
|
206
206
|
}
|
|
207
207
|
if (!isGuestUser && !auth) {
|
|
208
208
|
!isFromProductsList
|
|
@@ -598,33 +598,27 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
598
598
|
/>
|
|
599
599
|
)}
|
|
600
600
|
/>
|
|
601
|
-
{hasEditing ? (
|
|
602
|
-
<View style={styles.pinIcon}>
|
|
603
|
-
<GPSButton
|
|
604
|
-
apiKey={googleMapsApiKey}
|
|
605
|
-
handleGPS={(data: any, detail: any) => {
|
|
606
|
-
handleChangeAddress(data, detail);
|
|
607
|
-
setValue(data.address);
|
|
608
|
-
if (googleInput?.current) {
|
|
609
|
-
googleInput?.current?.setAddressText( data.address );
|
|
610
|
-
}
|
|
611
|
-
}}
|
|
612
|
-
IconButton={<OIcon src={theme.images.general.pin} width={16} />}
|
|
613
|
-
/>
|
|
614
|
-
</View>
|
|
615
|
-
) : null}
|
|
616
|
-
</AutocompleteInput>
|
|
617
601
|
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
602
|
+
{(
|
|
603
|
+
(!isEditing && !isGuestUser && !formState.changes?.address) ||
|
|
604
|
+
(isEditing && !isGuestUser && !formState.changes?.address && formState.changes?.address !== undefined)) ||
|
|
605
|
+
(isGuestUser && !formState.changes?.address && formState.changes?.address !== undefined) &&
|
|
606
|
+
(
|
|
607
|
+
<View style={styles.pinIcon}>
|
|
608
|
+
<GPSButton
|
|
609
|
+
apiKey={googleMapsApiKey}
|
|
610
|
+
handleGPS={(data: any, detail: any) => {
|
|
611
|
+
handleChangeAddress(data, detail);
|
|
612
|
+
setValue('address', data.address);
|
|
613
|
+
if (googleInput?.current) {
|
|
614
|
+
googleInput?.current?.setAddressText(data.address);
|
|
615
|
+
}
|
|
616
|
+
}}
|
|
617
|
+
IconButton={<OIcon src={theme.images.general.pin} width={16} />}
|
|
618
|
+
/>
|
|
619
|
+
</View>
|
|
620
|
+
)}
|
|
621
|
+
</AutocompleteInput>
|
|
628
622
|
|
|
629
623
|
{(locationChange || formState.changes?.location) && (
|
|
630
624
|
<View
|
|
@@ -648,129 +642,138 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
648
642
|
)}
|
|
649
643
|
|
|
650
644
|
<View style={{ flexDirection: 'row', flexBasis: '50%' }}>
|
|
651
|
-
|
|
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
|
-
|
|
645
|
+
{showField && showField('internal_number') && (
|
|
646
|
+
<Controller
|
|
647
|
+
control={control}
|
|
648
|
+
name="internal_number"
|
|
649
|
+
rules={{
|
|
650
|
+
required:
|
|
651
|
+
isRequiredField && isRequiredField('internal_number')
|
|
652
|
+
? t(
|
|
653
|
+
`VALIDATION_ERROR_INTERNAL_NUMBER_REQUIRED`,
|
|
654
|
+
`The field internal number is required`,
|
|
655
|
+
)
|
|
656
|
+
: null,
|
|
657
|
+
}}
|
|
658
|
+
defaultValue={
|
|
659
|
+
address?.internal_number ||
|
|
660
|
+
formState.changes?.internal_number ||
|
|
661
|
+
addressState?.address?.internal_number ||
|
|
662
|
+
''
|
|
663
|
+
}
|
|
664
|
+
render={() => (
|
|
665
|
+
<OInput
|
|
666
|
+
name="internal_number"
|
|
667
|
+
placeholder={t('INTERNAL_NUMBER', 'Internal number')}
|
|
668
|
+
onChange={(text: string) => {
|
|
669
|
+
handleChangeInput(text);
|
|
670
|
+
setValue('internal_number', text);
|
|
671
|
+
}}
|
|
672
|
+
value={
|
|
673
|
+
address?.internal_number ||
|
|
674
|
+
formState.changes?.internal_number ||
|
|
675
|
+
addressState?.address?.internal_number ||
|
|
676
|
+
''
|
|
677
|
+
}
|
|
678
|
+
style={{
|
|
679
|
+
...styles.inputsStyle,
|
|
680
|
+
marginRight: showField('internal_number') && showField('zipcode') ? 24 : 0
|
|
681
|
+
}}
|
|
682
|
+
forwardRef={internalNumberRef}
|
|
683
|
+
returnKeyType="next"
|
|
684
|
+
onSubmitEditing={() => zipCodeRef?.current?.focus?.()}
|
|
685
|
+
blurOnSubmit={false}
|
|
686
|
+
/>
|
|
687
|
+
)}
|
|
688
|
+
/>
|
|
689
|
+
)}
|
|
690
|
+
|
|
691
|
+
{showField && showField('zipcode') && (
|
|
692
|
+
<Controller
|
|
693
|
+
control={control}
|
|
694
|
+
name="zipcode"
|
|
695
|
+
rules={{
|
|
696
|
+
required:
|
|
697
|
+
isRequiredField && isRequiredField('zipcode')
|
|
698
|
+
? t(
|
|
699
|
+
`VALIDATION_ERROR_ZIP_CODE_REQUIRED`,
|
|
700
|
+
`The field Zip Code is required`,
|
|
701
|
+
)
|
|
702
|
+
: null,
|
|
703
|
+
}}
|
|
704
|
+
defaultValue={
|
|
705
|
+
address?.zipcode ||
|
|
706
|
+
formState.changes?.zipcode ||
|
|
707
|
+
addressState.address.zipcode ||
|
|
708
|
+
''
|
|
709
|
+
}
|
|
710
|
+
render={() => (
|
|
711
|
+
<OInput
|
|
712
|
+
name="zipcode"
|
|
713
|
+
placeholder={t('ZIP_CODE', 'Zip code')}
|
|
714
|
+
onChange={(text: string) => {
|
|
715
|
+
handleChangeInput(text);
|
|
716
|
+
setValue('zipcode', text);
|
|
717
|
+
}}
|
|
718
|
+
value={
|
|
719
|
+
address?.zipcode ||
|
|
720
|
+
formState.changes?.zipcode ||
|
|
721
|
+
addressState.address.zipcode ||
|
|
722
|
+
''
|
|
723
|
+
}
|
|
724
|
+
style={styles.inputsStyle}
|
|
725
|
+
forwardRef={zipCodeRef}
|
|
726
|
+
returnKeyType="next"
|
|
727
|
+
onSubmitEditing={() => addressNotesRef?.current?.focus?.()}
|
|
728
|
+
blurOnSubmit={false}
|
|
729
|
+
/>
|
|
730
|
+
)}
|
|
731
|
+
/>
|
|
732
|
+
)}
|
|
733
|
+
</View>
|
|
691
734
|
|
|
735
|
+
{showField && showField('address_notes') && (
|
|
692
736
|
<Controller
|
|
693
737
|
control={control}
|
|
694
|
-
name="
|
|
738
|
+
name="address_notes"
|
|
695
739
|
rules={{
|
|
696
740
|
required:
|
|
697
|
-
isRequiredField && isRequiredField('
|
|
741
|
+
isRequiredField && isRequiredField('address_notes')
|
|
698
742
|
? t(
|
|
699
|
-
`
|
|
700
|
-
`The field
|
|
743
|
+
`VALIDATION_ERROR_ADDRESS_NOTES_REQUIRED`,
|
|
744
|
+
`The field address notes is required`,
|
|
701
745
|
)
|
|
702
746
|
: null,
|
|
703
747
|
}}
|
|
704
748
|
defaultValue={
|
|
705
|
-
address?.
|
|
706
|
-
formState.changes?.
|
|
707
|
-
addressState.address.
|
|
749
|
+
address?.address_notes ||
|
|
750
|
+
formState.changes?.address_notes ||
|
|
751
|
+
addressState.address.address_notes ||
|
|
708
752
|
''
|
|
709
753
|
}
|
|
710
754
|
render={() => (
|
|
711
755
|
<OInput
|
|
712
|
-
name="
|
|
713
|
-
placeholder={t('
|
|
714
|
-
onChange={(text:
|
|
756
|
+
name="address_notes"
|
|
757
|
+
placeholder={t('ADDRESS_NOTES', 'Address notes')}
|
|
758
|
+
onChange={(text: any) => {
|
|
715
759
|
handleChangeInput(text);
|
|
716
|
-
setValue('
|
|
760
|
+
setValue('address_notes', text);
|
|
717
761
|
}}
|
|
718
762
|
value={
|
|
719
|
-
address?.
|
|
720
|
-
formState.changes?.
|
|
721
|
-
addressState.address.
|
|
763
|
+
address?.address_notes ||
|
|
764
|
+
formState.changes?.address_notes ||
|
|
765
|
+
addressState.address.address_notes ||
|
|
722
766
|
''
|
|
723
767
|
}
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
returnKeyType="
|
|
727
|
-
|
|
728
|
-
blurOnSubmit
|
|
768
|
+
multiline
|
|
769
|
+
style={styles.textAreaStyles}
|
|
770
|
+
returnKeyType="done"
|
|
771
|
+
forwardRef={addressNotesRef}
|
|
772
|
+
blurOnSubmit
|
|
729
773
|
/>
|
|
730
774
|
)}
|
|
731
775
|
/>
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
<Controller
|
|
735
|
-
control={control}
|
|
736
|
-
name="address_notes"
|
|
737
|
-
rules={{
|
|
738
|
-
required:
|
|
739
|
-
isRequiredField && isRequiredField('address_notes')
|
|
740
|
-
? t(
|
|
741
|
-
`VALIDATION_ERROR_ADDRESS_NOTES_REQUIRED`,
|
|
742
|
-
`The field address notes is required`,
|
|
743
|
-
)
|
|
744
|
-
: null,
|
|
745
|
-
}}
|
|
746
|
-
defaultValue={
|
|
747
|
-
address?.address_notes ||
|
|
748
|
-
formState.changes?.address_notes ||
|
|
749
|
-
addressState.address.address_notes ||
|
|
750
|
-
''
|
|
751
|
-
}
|
|
752
|
-
render={() => (
|
|
753
|
-
<OInput
|
|
754
|
-
name="address_notes"
|
|
755
|
-
placeholder={t('ADDRESS_NOTES', 'Address notes')}
|
|
756
|
-
onChange={(text: any) => {
|
|
757
|
-
handleChangeInput(text);
|
|
758
|
-
setValue('address_notes', text);
|
|
759
|
-
}}
|
|
760
|
-
value={
|
|
761
|
-
address?.address_notes ||
|
|
762
|
-
formState.changes?.address_notes ||
|
|
763
|
-
addressState.address.address_notes ||
|
|
764
|
-
''
|
|
765
|
-
}
|
|
766
|
-
multiline
|
|
767
|
-
style={styles.textAreaStyles}
|
|
768
|
-
returnKeyType="done"
|
|
769
|
-
forwardRef={addressNotesRef}
|
|
770
|
-
blurOnSubmit
|
|
771
|
-
/>
|
|
772
|
-
)}
|
|
773
|
-
/>
|
|
776
|
+
)}
|
|
774
777
|
</FormInput>
|
|
775
778
|
<IconsContainer>
|
|
776
779
|
{tagsName.map((tag) => (
|
|
@@ -56,7 +56,7 @@ const AddressListUI = (props: AddressListParams) => {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
const uniqueAddressesList = (addressList.addresses && addressList.addresses.filter(
|
|
59
|
-
(address: any, i: number, self: any) =>
|
|
59
|
+
(address: any, i: number, self: any) => address.address &&
|
|
60
60
|
i === self.findIndex((obj: any) => (
|
|
61
61
|
address.address === obj.address &&
|
|
62
62
|
address.address_notes === obj.address_notes &&
|
|
@@ -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 =>
|