ordering-ui-react-native 0.18.55 → 0.18.56-crash-driver-1
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 +6 -4
- package/src/components/BusinessInformation/index.tsx +10 -9
- package/src/components/PaymentOptionsWebView/index.tsx +30 -8
- package/src/components/PhoneInputNumber/index.tsx +6 -2
- package/src/components/StripeMethodForm/index.tsx +60 -55
- package/src/components/shared/OToast.tsx +3 -2
- package/src/types/index.tsx +3 -1
- package/src/utils/index.tsx +2 -2
- package/themes/business/index.tsx +6 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +15 -8
- package/themes/business/src/components/BusinessController/index.tsx +19 -17
- package/themes/business/src/components/BusinessProductList/AccordionDropdown.tsx +63 -0
- package/themes/business/src/components/BusinessProductList/IterateCategories.tsx +108 -0
- package/themes/business/src/components/BusinessProductList/ProductList.tsx +196 -0
- package/themes/business/src/components/BusinessProductList/index.tsx +196 -0
- package/themes/business/src/components/BusinessProductList/styles.tsx +10 -0
- package/themes/business/src/components/Chat/index.tsx +48 -19
- package/themes/business/src/components/DriverMap/index.tsx +36 -23
- package/themes/business/src/components/DriverSchedule/index.tsx +45 -8
- package/themes/business/src/components/FloatingButton/index.tsx +34 -31
- package/themes/business/src/components/GoogleMap/index.tsx +15 -8
- package/themes/business/src/components/Home/index.tsx +5 -1
- package/themes/business/src/components/LanguageSelector/index.tsx +1 -2
- package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
- package/themes/business/src/components/LoginForm/index.tsx +2 -2
- package/themes/business/src/components/LogoutButton/index.tsx +1 -1
- package/themes/business/src/components/MapView/index.tsx +28 -17
- package/themes/business/src/components/MessagesOption/index.tsx +22 -94
- package/themes/business/src/components/NewOrderNotification/index.tsx +162 -106
- package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
- package/themes/business/src/components/OrderDetails/Business.tsx +53 -3
- package/themes/business/src/components/OrderDetails/Delivery.tsx +209 -13
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +107 -75
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +79 -41
- package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +7 -2
- package/themes/business/src/components/OrderMessage/index.tsx +1 -1
- package/themes/business/src/components/OrderSummary/index.tsx +245 -82
- package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
- package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
- package/themes/business/src/components/OrdersOption/index.tsx +125 -48
- package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
- package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
- package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +43 -41
- package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
- package/themes/business/src/components/PreviousOrders/index.tsx +195 -221
- package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
- package/themes/business/src/components/PrinterEdition/index.tsx +363 -0
- package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
- package/themes/business/src/components/PrinterSettings/index.tsx +267 -0
- package/themes/business/src/components/PrinterSettings/styles.tsx +30 -0
- package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
- package/themes/business/src/components/ReviewCustomer/index.tsx +1 -1
- package/themes/business/src/components/SearchBar/index.tsx +2 -1
- package/themes/business/src/components/Sessions/index.tsx +187 -0
- package/themes/business/src/components/Sessions/styles.tsx +20 -0
- package/themes/business/src/components/StoresList/index.tsx +4 -3
- package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
- package/themes/business/src/components/UserProfileForm/index.tsx +103 -53
- package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
- package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
- package/themes/business/src/components/shared/OInput.tsx +2 -0
- package/themes/business/src/hooks/useLocation.tsx +5 -4
- package/themes/business/src/types/index.tsx +21 -1
- package/themes/business/src/utils/index.tsx +5 -0
- package/themes/kiosk/src/components/Checkout/index.tsx +5 -3
- package/themes/kiosk/src/components/CustomerName/index.tsx +1 -1
- package/themes/kiosk/src/components/Intro/index.tsx +16 -1
- package/themes/kiosk/src/components/LoginForm/index.tsx +131 -101
- package/themes/kiosk/src/components/PaymentOptions/index.tsx +57 -121
- package/themes/original/index.tsx +11 -3
- package/themes/original/src/components/AddressDetails/index.tsx +20 -10
- package/themes/original/src/components/AddressForm/index.tsx +41 -20
- package/themes/original/src/components/AddressForm/styles.tsx +1 -1
- package/themes/original/src/components/AddressList/index.tsx +22 -11
- package/themes/original/src/components/AddressList/styles.tsx +4 -4
- package/themes/original/src/components/AnalyticsSegment/index.tsx +10 -7
- package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +8 -11
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
- package/themes/original/src/components/BusinessController/index.tsx +40 -43
- package/themes/original/src/components/BusinessController/styles.tsx +12 -12
- package/themes/original/src/components/BusinessInformation/index.tsx +45 -17
- package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
- package/themes/original/src/components/BusinessListingSearch/index.tsx +57 -361
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
- package/themes/original/src/components/BusinessPreorder/index.tsx +9 -7
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +2 -3
- package/themes/original/src/components/BusinessProductsList/index.tsx +5 -4
- package/themes/original/src/components/BusinessProductsListing/index.tsx +67 -28
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +3 -4
- package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +30 -404
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +2 -2
- package/themes/original/src/components/Cart/index.tsx +51 -40
- package/themes/original/src/components/CartContent/index.tsx +98 -54
- package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +308 -75
- package/themes/original/src/components/Checkout/styles.tsx +17 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
- package/themes/original/src/components/DatePicker/index.tsx +33 -0
- package/themes/original/src/components/DatePicker/styles.tsx +20 -0
- package/themes/original/src/components/DriverTips/index.tsx +6 -3
- package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
- package/themes/original/src/components/Favorite/index.tsx +8 -4
- package/themes/original/src/components/Favorite/styles.tsx +0 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -0
- package/themes/original/src/components/GPSButton/index.tsx +7 -5
- package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
- package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +84 -8
- package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
- package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
- package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
- package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +83 -0
- package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
- package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
- package/themes/original/src/components/GoogleMap/index.tsx +52 -5
- package/themes/original/src/components/Help/index.tsx +7 -0
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +5 -0
- package/themes/original/src/components/HelpGuide/index.tsx +5 -0
- package/themes/original/src/components/HelpOrder/index.tsx +5 -0
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
- package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
- package/themes/original/src/components/Home/index.tsx +3 -2
- package/themes/original/src/components/LastOrder/index.tsx +2 -1
- package/themes/original/src/components/LastOrders/index.tsx +2 -1
- package/themes/original/src/components/LoginForm/Otp/index.tsx +79 -25
- package/themes/original/src/components/LoginForm/index.tsx +38 -14
- package/themes/original/src/components/MessageListing/index.tsx +6 -0
- package/themes/original/src/components/Messages/index.tsx +9 -3
- package/themes/original/src/components/Messages/styles.tsx +1 -1
- package/themes/original/src/components/MomentOption/index.tsx +20 -5
- package/themes/original/src/components/MomentSelector/index.tsx +1 -1
- package/themes/original/src/components/MultiCart/index.tsx +1 -1
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +48 -15
- package/themes/original/src/components/MultiCheckout/index.tsx +295 -56
- package/themes/original/src/components/MultiCheckout/styles.tsx +20 -1
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +21 -16
- package/themes/original/src/components/MyOrders/index.tsx +37 -39
- package/themes/original/src/components/NavBar/index.tsx +15 -14
- package/themes/original/src/components/NetworkError/index.tsx +2 -3
- package/themes/original/src/components/NetworkError/styles.tsx +2 -2
- package/themes/original/src/components/Notifications/index.tsx +9 -8
- package/themes/original/src/components/Notifications/styles.tsx +0 -1
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +21 -6
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +14 -5
- package/themes/original/src/components/OrderDetails/index.tsx +718 -667
- package/themes/original/src/components/OrderDetails/styles.tsx +24 -7
- package/themes/original/src/components/OrderProgress/index.tsx +50 -14
- package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
- package/themes/original/src/components/OrderSummary/index.tsx +26 -34
- package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -0
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/index.tsx +14 -6
- package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
- package/themes/original/src/components/PageBanner/index.tsx +3 -0
- package/themes/original/src/components/PaymentOptionCard/index.tsx +182 -0
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
- package/themes/original/src/components/PaymentOptions/index.tsx +118 -37
- package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -1
- package/themes/original/src/components/PreviousOrders/index.tsx +2 -0
- package/themes/original/src/components/ProductForm/ActionButton.tsx +122 -0
- package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
- package/themes/original/src/components/ProductForm/index.tsx +193 -267
- package/themes/original/src/components/ProductForm/styles.tsx +1 -1
- package/themes/original/src/components/ProductItemAccordion/index.tsx +55 -42
- package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +120 -79
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +10 -9
- package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
- package/themes/original/src/components/Promotions/index.tsx +13 -11
- package/themes/original/src/components/Promotions/styles.tsx +0 -2
- package/themes/original/src/components/ReviewDriver/index.tsx +5 -0
- package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
- package/themes/original/src/components/ReviewOrder/index.tsx +5 -0
- package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
- package/themes/original/src/components/ReviewProducts/index.tsx +5 -0
- package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
- package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
- package/themes/original/src/components/ServiceForm/index.tsx +2 -2
- package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
- package/themes/original/src/components/Sessions/index.tsx +5 -0
- package/themes/original/src/components/SignupForm/index.tsx +76 -60
- package/themes/original/src/components/SingleOrderCard/index.tsx +6 -5
- package/themes/original/src/components/SingleProductCard/index.tsx +5 -4
- package/themes/original/src/components/SingleProductCard/styles.tsx +0 -5
- package/themes/original/src/components/StripeCardsList/index.tsx +26 -8
- package/themes/original/src/components/StripeElementsForm/index.tsx +80 -62
- package/themes/original/src/components/StripeElementsForm/naked.tsx +59 -1
- package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
- package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +91 -0
- package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
- package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
- package/themes/original/src/components/UserFormDetails/index.tsx +128 -79
- package/themes/original/src/components/UserFormDetails/styles.tsx +8 -1
- package/themes/original/src/components/UserProfile/index.tsx +5 -4
- package/themes/original/src/components/UserProfileForm/index.tsx +35 -36
- package/themes/original/src/components/UserVerification/index.tsx +55 -50
- package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
- package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
- package/themes/original/src/components/Wallets/index.tsx +35 -49
- package/themes/original/src/components/Wallets/styles.tsx +3 -4
- package/themes/original/src/components/WebsocketStatus/index.tsx +172 -0
- package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
- package/themes/original/src/components/shared/OButton.tsx +5 -5
- package/themes/original/src/components/shared/OInput.tsx +7 -4
- package/themes/original/src/components/shared/OModal.tsx +12 -14
- package/themes/original/src/layouts/Container.tsx +5 -3
- package/themes/original/src/types/index.tsx +13 -2
- package/themes/original/src/utils/index.tsx +124 -22
- package/src/navigators/BottomNavigator.tsx +0 -117
- package/src/navigators/CheckoutNavigator.tsx +0 -66
- package/src/navigators/HomeNavigator.tsx +0 -202
- package/src/navigators/NavigationRef.tsx +0 -7
- package/src/navigators/RootNavigator.tsx +0 -269
- package/src/pages/Account.tsx +0 -34
- package/src/pages/AddressForm.tsx +0 -62
- package/src/pages/AddressList.tsx +0 -24
- package/src/pages/BusinessProductsList.tsx +0 -81
- package/src/pages/BusinessesListing.tsx +0 -43
- package/src/pages/CartList.tsx +0 -49
- package/src/pages/Checkout.tsx +0 -101
- package/src/pages/ForgotPassword.tsx +0 -24
- package/src/pages/Help.tsx +0 -23
- package/src/pages/HelpAccountAndPayment.tsx +0 -23
- package/src/pages/HelpGuide.tsx +0 -23
- package/src/pages/HelpOrder.tsx +0 -23
- package/src/pages/Home.tsx +0 -36
- package/src/pages/IntroductoryTutorial.tsx +0 -170
- package/src/pages/Login.tsx +0 -47
- package/src/pages/MomentOption.tsx +0 -30
- package/src/pages/MultiCheckout.tsx +0 -31
- package/src/pages/MultiOrdersDetails.tsx +0 -27
- package/src/pages/MyOrders.tsx +0 -40
- package/src/pages/NetworkError.tsx +0 -24
- package/src/pages/NotFound.tsx +0 -22
- package/src/pages/OrderDetails.tsx +0 -25
- package/src/pages/ProductDetails.tsx +0 -55
- package/src/pages/Profile.tsx +0 -36
- package/src/pages/ReviewDriver.tsx +0 -30
- package/src/pages/ReviewOrder.tsx +0 -32
- package/src/pages/ReviewProducts.tsx +0 -30
- package/src/pages/Sessions.tsx +0 -22
- package/src/pages/Signup.tsx +0 -53
- package/src/pages/SpinnerLoader.tsx +0 -10
- package/src/pages/Splash.tsx +0 -21
|
@@ -1,30 +1,40 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import FastImage from 'react-native-fast-image'
|
|
3
|
-
import { StyleSheet, TouchableOpacity,
|
|
3
|
+
import { StyleSheet, TouchableOpacity, useWindowDimensions } from 'react-native';
|
|
4
4
|
import {
|
|
5
5
|
AddressDetails as AddressDetailsController,
|
|
6
6
|
useOrder,
|
|
7
7
|
useLanguage,
|
|
8
8
|
} from 'ordering-components/native';
|
|
9
|
+
import { useTheme } from 'styled-components/native';
|
|
9
10
|
|
|
10
11
|
import { ADContainer, ADHeader, ADAddress, ADMap } from './styles';
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
import { OText, OIcon } from '../shared';
|
|
14
|
-
import { useWindowDimensions } from 'react-native';
|
|
12
|
+
import { OText } from '../shared';
|
|
13
|
+
import { getTypesText } from '../../utils';
|
|
15
14
|
|
|
16
15
|
const AddressDetailsUI = (props: any) => {
|
|
17
|
-
const {
|
|
18
|
-
|
|
16
|
+
const {
|
|
17
|
+
navigation,
|
|
18
|
+
addressToShow,
|
|
19
|
+
isCartPending,
|
|
20
|
+
googleMapsUrl,
|
|
21
|
+
apiKey
|
|
22
|
+
} = props;
|
|
19
23
|
|
|
20
24
|
const theme = useTheme();
|
|
21
25
|
const [orderState] = useOrder();
|
|
26
|
+
const [{ options }] = useOrder();
|
|
22
27
|
const [, t] = useLanguage();
|
|
23
28
|
const { width } = useWindowDimensions();
|
|
24
29
|
|
|
30
|
+
const orderTypeText = {
|
|
31
|
+
key: getTypesText(options?.type || 1),
|
|
32
|
+
value: t(getTypesText(options?.type || 1), 'Delivery')
|
|
33
|
+
}
|
|
34
|
+
|
|
25
35
|
const styles = StyleSheet.create({
|
|
26
36
|
productStyle: {
|
|
27
|
-
width
|
|
37
|
+
width,
|
|
28
38
|
height: 151,
|
|
29
39
|
marginVertical: 10
|
|
30
40
|
}
|
|
@@ -39,13 +49,13 @@ const AddressDetailsUI = (props: any) => {
|
|
|
39
49
|
lineHeight={24}
|
|
40
50
|
color={theme.colors.textNormal}
|
|
41
51
|
>
|
|
42
|
-
{t(
|
|
52
|
+
{t(`${orderTypeText.key}_ADDRESS`, `${orderTypeText.value} address`)}
|
|
43
53
|
</OText>
|
|
44
54
|
)}
|
|
45
55
|
</ADHeader>
|
|
46
56
|
{!!apiKey && googleMapsUrl && (
|
|
47
57
|
<ADMap
|
|
48
|
-
style={{
|
|
58
|
+
style={{ width, flex: 1, marginStart: -20, marginEnd: -20, }}>
|
|
49
59
|
<FastImage
|
|
50
60
|
style={styles.productStyle}
|
|
51
61
|
source={{
|
|
@@ -66,7 +66,8 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
66
66
|
isFromProductsList,
|
|
67
67
|
hasAddressDefault,
|
|
68
68
|
afterSignup,
|
|
69
|
-
businessSlug
|
|
69
|
+
businessSlug,
|
|
70
|
+
isFromCheckout
|
|
70
71
|
} = props;
|
|
71
72
|
|
|
72
73
|
const theme = useTheme();
|
|
@@ -122,8 +123,8 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
122
123
|
width: 16
|
|
123
124
|
},
|
|
124
125
|
wrapperNavbar: Platform.OS === 'ios'
|
|
125
|
-
? { paddingVertical: 0, paddingLeft:
|
|
126
|
-
: { paddingVertical:
|
|
126
|
+
? { paddingVertical: 0, paddingLeft: 20, paddingRight: 20 }
|
|
127
|
+
: { paddingVertical: 10, paddingLeft: 20, paddingRight: 20 }
|
|
127
128
|
});
|
|
128
129
|
|
|
129
130
|
const [, t] = useLanguage();
|
|
@@ -176,7 +177,6 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
176
177
|
|
|
177
178
|
const getAddressFormatted = (address: any) => {
|
|
178
179
|
const data: any = { address: null, error: null };
|
|
179
|
-
Geocoder.init(googleMapsApiKey);
|
|
180
180
|
Geocoder.from(address)
|
|
181
181
|
.then((json) => {
|
|
182
182
|
if (json.results && json.results?.length > 0) {
|
|
@@ -372,6 +372,10 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
372
372
|
setToggleMap(!toggleMap);
|
|
373
373
|
};
|
|
374
374
|
|
|
375
|
+
const showFieldWithTheme = (name) => {
|
|
376
|
+
return !theme?.address?.components?.[name]?.hidden
|
|
377
|
+
}
|
|
378
|
+
|
|
375
379
|
useEffect(() => {
|
|
376
380
|
if (
|
|
377
381
|
orderState.loading &&
|
|
@@ -380,9 +384,11 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
380
384
|
auth &&
|
|
381
385
|
!afterSignup
|
|
382
386
|
) {
|
|
383
|
-
|
|
384
|
-
? navigation.
|
|
385
|
-
:
|
|
387
|
+
isFromCheckout
|
|
388
|
+
? navigation.goBack()
|
|
389
|
+
: !isFromProductsList
|
|
390
|
+
? navigation.navigate('BottomTab')
|
|
391
|
+
: navigation.navigate('Business');
|
|
386
392
|
}
|
|
387
393
|
}, [orderState?.options?.address]);
|
|
388
394
|
|
|
@@ -437,16 +443,16 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
437
443
|
if (isEditing) {
|
|
438
444
|
if (formState?.changes?.location) {
|
|
439
445
|
const prevLocation = {
|
|
440
|
-
lat:
|
|
441
|
-
lng:
|
|
446
|
+
lat: locationChange?.lat?.toFixed(5),
|
|
447
|
+
lng: locationChange?.lng?.toFixed(5),
|
|
442
448
|
};
|
|
443
449
|
const newLocation = {
|
|
444
|
-
lat:
|
|
445
|
-
lng:
|
|
450
|
+
lat: formState?.changes?.location?.lat?.toFixed(5),
|
|
451
|
+
lng: formState?.changes?.location?.lng?.toFixed(5),
|
|
446
452
|
};
|
|
447
453
|
if (
|
|
448
|
-
prevLocation
|
|
449
|
-
prevLocation
|
|
454
|
+
prevLocation?.lat !== newLocation?.lat &&
|
|
455
|
+
prevLocation?.lng !== newLocation?.lng
|
|
450
456
|
) {
|
|
451
457
|
setLocationChange(formState?.changes?.location);
|
|
452
458
|
}
|
|
@@ -491,6 +497,10 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
491
497
|
}
|
|
492
498
|
}, []);
|
|
493
499
|
|
|
500
|
+
useEffect(() => {
|
|
501
|
+
Geocoder.init(googleMapsApiKey);
|
|
502
|
+
}, [googleMapsApiKey]);
|
|
503
|
+
|
|
494
504
|
useEffect(() => {
|
|
495
505
|
const keyboardDidShowListener = Keyboard.addListener(
|
|
496
506
|
'keyboardDidShow',
|
|
@@ -532,10 +542,15 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
532
542
|
style={{ marginTop: Platform.OS === 'ios' ? 0 : 10 }}
|
|
533
543
|
titleWrapStyle={{ paddingHorizontal: 0, width: '100%' }}
|
|
534
544
|
titleStyle={{ marginRight: 0, marginLeft: 0, paddingRight: 5 }}
|
|
545
|
+
buttonProps={{
|
|
546
|
+
bgColor: theme.colors.white,
|
|
547
|
+
borderColor: theme.colors.white,
|
|
548
|
+
textStyle: { color: theme.colors.btnFont }
|
|
549
|
+
}}
|
|
535
550
|
/>
|
|
536
551
|
</View>
|
|
537
552
|
<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
|
|
538
|
-
<AddressFormContainer style={{
|
|
553
|
+
<AddressFormContainer style={{ overflow: 'scroll' }}>
|
|
539
554
|
<View>
|
|
540
555
|
<FormInput>
|
|
541
556
|
<AutocompleteInput>
|
|
@@ -640,6 +655,7 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
640
655
|
}
|
|
641
656
|
}}
|
|
642
657
|
IconButton={<OIcon src={theme.images.general.pin} width={16} />}
|
|
658
|
+
isIntGeoCoder
|
|
643
659
|
/>
|
|
644
660
|
</View>
|
|
645
661
|
)}
|
|
@@ -661,13 +677,14 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
661
677
|
saveLocation={saveMapLocation}
|
|
662
678
|
setSaveLocation={setSaveMapLocation}
|
|
663
679
|
handleToggleMap={handleToggleMap}
|
|
680
|
+
isIntGeoCoder
|
|
664
681
|
/>
|
|
665
682
|
</GoogleMapContainer>
|
|
666
683
|
</View>
|
|
667
684
|
)}
|
|
668
685
|
|
|
669
686
|
<View style={{ flexDirection: 'row', flexBasis: '50%' }}>
|
|
670
|
-
{
|
|
687
|
+
{((isRequiredField && isRequiredField('internal_number')) || showFieldWithTheme('internal_number')) && (
|
|
671
688
|
<Controller
|
|
672
689
|
control={control}
|
|
673
690
|
name="internal_number"
|
|
@@ -703,7 +720,7 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
703
720
|
isFocusHighlight
|
|
704
721
|
style={{
|
|
705
722
|
...styles.inputsStyle,
|
|
706
|
-
marginRight: showField('internal_number') && showField('zipcode') ? 24 : 0
|
|
723
|
+
marginRight: showField?.('internal_number') && showField?.('zipcode') ? 24 : 0
|
|
707
724
|
}}
|
|
708
725
|
forwardRef={internalNumberRef}
|
|
709
726
|
returnKeyType="next"
|
|
@@ -714,7 +731,7 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
714
731
|
/>
|
|
715
732
|
)}
|
|
716
733
|
|
|
717
|
-
{
|
|
734
|
+
{((isRequiredField && isRequiredField('zipcode')) || showFieldWithTheme('zipcode')) && (
|
|
718
735
|
<Controller
|
|
719
736
|
control={control}
|
|
720
737
|
name="zipcode"
|
|
@@ -759,7 +776,7 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
759
776
|
)}
|
|
760
777
|
</View>
|
|
761
778
|
|
|
762
|
-
{
|
|
779
|
+
{((isRequiredField && isRequiredField('address_notes')) || showFieldWithTheme('address_notes')) && (
|
|
763
780
|
<Controller
|
|
764
781
|
control={control}
|
|
765
782
|
name="address_notes"
|
|
@@ -850,8 +867,9 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
850
867
|
) : (
|
|
851
868
|
<OButton
|
|
852
869
|
text={t('CANCEL', 'Cancel')}
|
|
853
|
-
bgColor={theme.colors.
|
|
854
|
-
borderColor={theme.colors.
|
|
870
|
+
bgColor={theme.colors.secundary}
|
|
871
|
+
borderColor={theme.colors.secundary}
|
|
872
|
+
textStyle={{ color: theme.colors.black }}
|
|
855
873
|
style={{ borderRadius: 7.6, borderWidth: 1, shadowOpacity: 0 }}
|
|
856
874
|
onClick={() => navigation?.canGoBack() && navigation.goBack()}
|
|
857
875
|
/>
|
|
@@ -871,12 +889,15 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
871
889
|
saveLocation={saveMapLocation}
|
|
872
890
|
setSaveLocation={setSaveMapLocation}
|
|
873
891
|
handleToggleMap={handleToggleMap}
|
|
892
|
+
isIntGeoCoder
|
|
874
893
|
/>
|
|
875
894
|
</GoogleMapContainer>
|
|
876
895
|
)}
|
|
877
896
|
<OButton
|
|
878
897
|
text={t('SAVE', 'Save')}
|
|
879
898
|
textStyle={{ color: theme.colors.white }}
|
|
899
|
+
bgColor={theme.colors.primary}
|
|
900
|
+
borderColor={theme.colors.primary}
|
|
880
901
|
imgRightSrc={null}
|
|
881
902
|
style={{ marginHorizontal: 30, marginBottom: 10 }}
|
|
882
903
|
onClick={() => setSaveMapLocation(true)}
|
|
@@ -2,7 +2,7 @@ import styled from 'styled-components/native'
|
|
|
2
2
|
|
|
3
3
|
export const AddressFormContainer = styled.View`
|
|
4
4
|
flex: 1;
|
|
5
|
-
padding: 0px
|
|
5
|
+
padding: 0px 20px 20px;
|
|
6
6
|
background-color: ${(props: any) => props.theme.colors.backgroundPage};
|
|
7
7
|
justify-content: space-between;
|
|
8
8
|
`
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useEffect } from 'react'
|
|
2
|
-
import { AddressList as AddressListController, useLanguage, useOrder
|
|
2
|
+
import { AddressList as AddressListController, useLanguage, useOrder } from 'ordering-components/native'
|
|
3
3
|
import { AddressItem, Container } from './styles'
|
|
4
4
|
import { Platform, RefreshControl, StyleSheet, View } from 'react-native'
|
|
5
|
-
import { OButton, OText, OAlert,
|
|
5
|
+
import { OButton, OText, OAlert, OIcon } from '../shared'
|
|
6
6
|
import { AddressListParams } from '../../types'
|
|
7
7
|
import { NotFoundSource } from '../NotFoundSource'
|
|
8
8
|
import NavBar from '../NavBar'
|
|
@@ -18,12 +18,10 @@ const AddressListUI = (props: AddressListParams) => {
|
|
|
18
18
|
route,
|
|
19
19
|
addressList,
|
|
20
20
|
isFromProfile,
|
|
21
|
-
nopadding,
|
|
22
21
|
handleSetDefault,
|
|
23
22
|
handleDelete,
|
|
24
23
|
setAddressList,
|
|
25
24
|
isGoBack,
|
|
26
|
-
actionStatus,
|
|
27
25
|
isFromBusinesses,
|
|
28
26
|
isFromProductsList,
|
|
29
27
|
afterSignup,
|
|
@@ -34,7 +32,6 @@ const AddressListUI = (props: AddressListParams) => {
|
|
|
34
32
|
|
|
35
33
|
const [orderState] = useOrder()
|
|
36
34
|
const [, t] = useLanguage()
|
|
37
|
-
const [{ auth }] = useSession()
|
|
38
35
|
const [refreshing] = useState(false);
|
|
39
36
|
|
|
40
37
|
const [isProfile, setIsProfile] = useState(isFromProfile || route?.params?.isFromProfile);
|
|
@@ -155,6 +152,11 @@ const AddressListUI = (props: AddressListParams) => {
|
|
|
155
152
|
showCall={false}
|
|
156
153
|
paddingTop={10}
|
|
157
154
|
btnStyle={{ paddingLeft: 0 }}
|
|
155
|
+
buttonProps={{
|
|
156
|
+
bgColor: theme.colors.white,
|
|
157
|
+
borderColor: theme.colors.white,
|
|
158
|
+
textStyle: { color: theme.colors.btnFont }
|
|
159
|
+
}}
|
|
158
160
|
/>
|
|
159
161
|
)}
|
|
160
162
|
{
|
|
@@ -176,6 +178,11 @@ const AddressListUI = (props: AddressListParams) => {
|
|
|
176
178
|
style={{ marginTop: 0 }}
|
|
177
179
|
titleWrapStyle={{ paddingHorizontal: 0 }}
|
|
178
180
|
titleStyle={{ marginLeft: 0, marginRight: 0 }}
|
|
181
|
+
buttonProps={{
|
|
182
|
+
bgColor: theme.colors.white,
|
|
183
|
+
borderColor: theme.colors.white,
|
|
184
|
+
textStyle: { color: theme.colors.btnFont }
|
|
185
|
+
}}
|
|
179
186
|
/>
|
|
180
187
|
)}
|
|
181
188
|
{addressList.loading && addressList?.addresses?.length === 0 && (
|
|
@@ -220,7 +227,8 @@ const AddressListUI = (props: AddressListParams) => {
|
|
|
220
227
|
onSaveAddress: handleSaveAddress,
|
|
221
228
|
isSelectedAfterAdd: true,
|
|
222
229
|
isFromProductsList: isFromProductsList,
|
|
223
|
-
hasAddressDefault: !!orderState.options?.address?.location
|
|
230
|
+
hasAddressDefault: !!orderState.options?.address?.location,
|
|
231
|
+
isFromCheckout: route?.params?.isFromCheckout
|
|
224
232
|
}
|
|
225
233
|
) : onNavigationRedirect(
|
|
226
234
|
'AddressFormInitial',
|
|
@@ -231,7 +239,8 @@ const AddressListUI = (props: AddressListParams) => {
|
|
|
231
239
|
onSaveAddress: handleSaveAddress,
|
|
232
240
|
isSelectedAfterAdd: true,
|
|
233
241
|
isFromProductsList: isFromProductsList,
|
|
234
|
-
hasAddressDefault: !!orderState.options?.address?.location
|
|
242
|
+
hasAddressDefault: !!orderState.options?.address?.location,
|
|
243
|
+
isFromCheckout: route?.params?.isFromCheckout
|
|
235
244
|
})}
|
|
236
245
|
>
|
|
237
246
|
<OIcon src={theme.images.general.pencil} width={16} style={{ marginHorizontal: 4 }} />
|
|
@@ -296,8 +305,8 @@ const AddressListUI = (props: AddressListParams) => {
|
|
|
296
305
|
<OButton
|
|
297
306
|
text={t('ADD_NEW_ADDRESS', 'Add new Address')}
|
|
298
307
|
imgRightSrc=''
|
|
299
|
-
bgColor={theme.colors.
|
|
300
|
-
textStyle={{ color: theme.colors.
|
|
308
|
+
bgColor={theme.colors.primary}
|
|
309
|
+
textStyle={{ color: theme.colors.white }}
|
|
301
310
|
style={styles.button}
|
|
302
311
|
borderColor={theme.colors.primary}
|
|
303
312
|
onClick={() => !afterSignup ? onNavigationRedirect(
|
|
@@ -308,7 +317,8 @@ const AddressListUI = (props: AddressListParams) => {
|
|
|
308
317
|
addressesList: addressList?.addresses,
|
|
309
318
|
nopadding: true,
|
|
310
319
|
isSelectedAfterAdd: true,
|
|
311
|
-
hasAddressDefault: !!orderState.options?.address?.location
|
|
320
|
+
hasAddressDefault: !!orderState.options?.address?.location,
|
|
321
|
+
isFromCheckout: route?.params?.isFromCheckout
|
|
312
322
|
}) : onNavigationRedirect(
|
|
313
323
|
'AddressFormInitial',
|
|
314
324
|
{
|
|
@@ -317,7 +327,8 @@ const AddressListUI = (props: AddressListParams) => {
|
|
|
317
327
|
addressesList: addressList?.addresses,
|
|
318
328
|
nopadding: true,
|
|
319
329
|
isSelectedAfterAdd: true,
|
|
320
|
-
hasAddressDefault: !!orderState.options?.address?.location
|
|
330
|
+
hasAddressDefault: !!orderState.options?.address?.location,
|
|
331
|
+
isFormCheckout: route?.params?.isFromCheckout
|
|
321
332
|
})}
|
|
322
333
|
/>
|
|
323
334
|
</>
|
|
@@ -3,10 +3,10 @@ import styled from 'styled-components/native'
|
|
|
3
3
|
export const Container = styled.ScrollView`
|
|
4
4
|
position: relative;
|
|
5
5
|
flex: 1;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
paddingLeft: 20px;
|
|
7
|
+
paddingRight: 20px;
|
|
8
|
+
margin-bottom: 40px;
|
|
9
|
+
padding-top: 10px;
|
|
10
10
|
`
|
|
11
11
|
|
|
12
12
|
export const AddressItem = styled.TouchableOpacity`
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
createClient,
|
|
4
|
+
AnalyticsProvider
|
|
5
|
+
} from '@segment/analytics-react-native';
|
|
3
6
|
import { useEvent, useConfig, useLanguage } from 'ordering-components/native';
|
|
4
7
|
|
|
5
8
|
export const AnalyticsSegment = (props: any) => {
|
|
@@ -20,8 +23,7 @@ export const AnalyticsSegment = (props: any) => {
|
|
|
20
23
|
segmentClient.track('Product List Viewed', {
|
|
21
24
|
business_id: category?.business_id,
|
|
22
25
|
category_id: category?.id,
|
|
23
|
-
category: category?.name
|
|
24
|
-
products: category?.products
|
|
26
|
+
category: category?.name
|
|
25
27
|
})
|
|
26
28
|
}
|
|
27
29
|
|
|
@@ -59,11 +61,12 @@ export const AnalyticsSegment = (props: any) => {
|
|
|
59
61
|
})
|
|
60
62
|
}
|
|
61
63
|
|
|
62
|
-
const handleProductAdded = (product: any) => {
|
|
64
|
+
const handleProductAdded = (product: any, result: any) => {
|
|
63
65
|
segmentClient.track('Product Added', {
|
|
64
|
-
|
|
66
|
+
cart_id: result.uuid,
|
|
67
|
+
product_id: product.id,
|
|
65
68
|
name: product.name,
|
|
66
|
-
category: product.category_id,
|
|
69
|
+
category: product.category_id || product?.categoryId,
|
|
67
70
|
price: product.price,
|
|
68
71
|
quantity: product.quantity
|
|
69
72
|
})
|
|
@@ -98,7 +101,7 @@ export const AnalyticsSegment = (props: any) => {
|
|
|
98
101
|
|
|
99
102
|
const handleOrderPlaced = (order: any) => {
|
|
100
103
|
segmentClient.track('Order Placed', {
|
|
101
|
-
|
|
104
|
+
order_id: order.id,
|
|
102
105
|
affiliation: order.business?.name,
|
|
103
106
|
revenue: order.total,
|
|
104
107
|
tax: order.tax_total,
|
|
@@ -26,7 +26,6 @@ import {
|
|
|
26
26
|
SocialListWrapper
|
|
27
27
|
} from './styles';
|
|
28
28
|
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
|
|
29
|
-
const types = ['food', 'laundry', 'alcohol', 'groceries'];
|
|
30
29
|
|
|
31
30
|
let BusinessInformation: null | React.ElementType = null
|
|
32
31
|
let BusinessReviews: null | React.ElementType = null
|
|
@@ -36,6 +35,7 @@ export const BusinessBasicInformation = (
|
|
|
36
35
|
) => {
|
|
37
36
|
const { navigation, businessState, isBusinessInfoShow, logo, header, isPreOrder } = props;
|
|
38
37
|
const { business, loading } = businessState;
|
|
38
|
+
const types = business?.types && business?.types?.filter(({ enabled }) => (enabled)).map(({ name }) => (name))
|
|
39
39
|
|
|
40
40
|
const theme = useTheme();
|
|
41
41
|
const [orderState] = useOrder();
|
|
@@ -72,7 +72,7 @@ export const BusinessBasicInformation = (
|
|
|
72
72
|
alignItems: 'flex-start'
|
|
73
73
|
},
|
|
74
74
|
businessInfo: {
|
|
75
|
-
paddingHorizontal:
|
|
75
|
+
paddingHorizontal: 20,
|
|
76
76
|
paddingTop: isChewLayout ? 0 : 56,
|
|
77
77
|
},
|
|
78
78
|
bullet: {
|
|
@@ -95,7 +95,7 @@ export const BusinessBasicInformation = (
|
|
|
95
95
|
width: '100%',
|
|
96
96
|
top: 0,
|
|
97
97
|
zIndex: 100,
|
|
98
|
-
left:
|
|
98
|
+
left: 20
|
|
99
99
|
},
|
|
100
100
|
socialIcon: {
|
|
101
101
|
borderRadius: 3,
|
|
@@ -146,14 +146,11 @@ export const BusinessBasicInformation = (
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
const getBusinessType = () => {
|
|
149
|
-
if (
|
|
149
|
+
if (!types) return t('GENERAL', 'General');
|
|
150
150
|
const _types: any = [];
|
|
151
151
|
types.forEach(
|
|
152
|
-
(type) =>
|
|
153
|
-
|
|
154
|
-
_types.push(
|
|
155
|
-
t(`BUSINESS_TYPE_${type?.replace(/\s/g, '_')?.toUpperCase()}`, type),
|
|
156
|
-
),
|
|
152
|
+
(type: any) =>
|
|
153
|
+
_types.push(type)
|
|
157
154
|
);
|
|
158
155
|
return _types.join(', ');
|
|
159
156
|
};
|
|
@@ -217,7 +214,7 @@ export const BusinessBasicInformation = (
|
|
|
217
214
|
<Placeholder Animation={Fade}>
|
|
218
215
|
<View style={{ flexDirection: 'row' }}>
|
|
219
216
|
{[...Array(5).keys()].map(i => (
|
|
220
|
-
<View style={styles.socialIcon} key={i}>
|
|
217
|
+
<View style={{ ...styles.socialIcon, borderWidth: 0 }} key={i}>
|
|
221
218
|
<PlaceholderLine width={100} height={20} style={{ marginBottom: 0 }} />
|
|
222
219
|
</View>
|
|
223
220
|
))}
|
|
@@ -247,7 +244,7 @@ export const BusinessBasicInformation = (
|
|
|
247
244
|
<View style={styles.tiktokIcon}>
|
|
248
245
|
<OIcon
|
|
249
246
|
src={theme.images.general.tiktok}
|
|
250
|
-
style={{ width: 10, height: 12 }}
|
|
247
|
+
style={{ width: 10, height: 12, bottom: 1 }}
|
|
251
248
|
cover
|
|
252
249
|
/>
|
|
253
250
|
</View>
|
|
@@ -11,7 +11,7 @@ export const BusinessHeader = styled.ImageBackground`
|
|
|
11
11
|
`;
|
|
12
12
|
export const BusinessLogo = styled.View`
|
|
13
13
|
position: absolute;
|
|
14
|
-
start:
|
|
14
|
+
start: 20px;
|
|
15
15
|
top: -36px;
|
|
16
16
|
z-index: 50;
|
|
17
17
|
box-shadow: 0 0 2px ${Platform.OS == 'android' ? '#000000DD' : '#0000001A'};
|