ordering-ui-react-native 0.21.1 → 0.21.2-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 +6 -5
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessInformation/index.tsx +10 -9
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/PaymentOptionsWebView/index.tsx +1 -0
- package/src/components/StripeMethodForm/index.tsx +3 -3
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +3 -2
- package/src/types/index.tsx +2 -1
- package/src/utils/index.tsx +2 -2
- package/themes/business/index.tsx +4 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -2
- 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 +41 -13
- package/themes/business/src/components/DriverMap/index.tsx +4 -2
- package/themes/business/src/components/DriverSchedule/index.tsx +5 -5
- package/themes/business/src/components/FloatingButton/index.tsx +34 -31
- package/themes/business/src/components/Home/index.tsx +5 -1
- package/themes/business/src/components/MapView/index.tsx +11 -7
- package/themes/business/src/components/MessagesOption/index.tsx +22 -94
- package/themes/business/src/components/NewOrderNotification/index.tsx +161 -106
- package/themes/business/src/components/OrderDetails/Delivery.tsx +21 -12
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +90 -55
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +36 -16
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +6 -1
- package/themes/business/src/components/OrderSummary/index.tsx +42 -23
- 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/PreviousMessages/FooterMessageComponent.tsx +103 -0
- package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +27 -35
- 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 +192 -220
- package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
- package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
- package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
- 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 +5 -3
- package/themes/business/src/components/UserProfileForm/index.tsx +76 -41
- 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 +19 -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/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/LoginForm/index.tsx +124 -96
- 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/original/index.tsx +9 -4
- package/themes/original/src/components/AddressDetails/index.tsx +20 -10
- package/themes/original/src/components/AddressForm/index.tsx +2 -2
- package/themes/original/src/components/AddressForm/styles.tsx +1 -1
- package/themes/original/src/components/AddressList/index.tsx +4 -7
- package/themes/original/src/components/AddressList/styles.tsx +4 -4
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
- package/themes/original/src/components/BusinessController/index.tsx +18 -10
- package/themes/original/src/components/BusinessController/styles.tsx +8 -7
- package/themes/original/src/components/BusinessInformation/index.tsx +35 -3
- 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 +56 -361
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
- package/themes/original/src/components/BusinessPreorder/index.tsx +3 -4
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
- package/themes/original/src/components/BusinessProductsList/index.tsx +3 -3
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +45 -21
- 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 +29 -402
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
- package/themes/original/src/components/Cart/index.tsx +32 -9
- package/themes/original/src/components/CartContent/index.tsx +96 -58
- package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +219 -66
- 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 +17 -0
- package/themes/original/src/components/DatePicker/styles.tsx +20 -0
- package/themes/original/src/components/Favorite/index.tsx +4 -9
- 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/GPSButton/index.tsx +1 -1
- 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 +67 -4
- 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/GoogleMap/index.tsx +50 -5
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +2 -2
- package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
- package/themes/original/src/components/Home/index.tsx +1 -1
- 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 +53 -47
- package/themes/original/src/components/LoginForm/index.tsx +6 -1
- package/themes/original/src/components/Messages/index.tsx +9 -4
- package/themes/original/src/components/Messages/styles.tsx +1 -1
- package/themes/original/src/components/MomentOption/index.tsx +4 -4
- 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 +3 -1
- package/themes/original/src/components/MultiCheckout/index.tsx +251 -53
- package/themes/original/src/components/MultiCheckout/styles.tsx +17 -0
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -15
- package/themes/original/src/components/MyOrders/index.tsx +24 -29
- package/themes/original/src/components/NavBar/index.tsx +3 -1
- 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 +4 -8
- package/themes/original/src/components/Notifications/styles.tsx +0 -1
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +7 -3
- package/themes/original/src/components/OrderDetails/index.tsx +716 -667
- package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
- package/themes/original/src/components/OrderProgress/index.tsx +28 -9
- package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
- package/themes/original/src/components/OrderSummary/index.tsx +3 -1
- package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -6
- 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 +2 -1
- 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 +4 -2
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +69 -5
- package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -1
- package/themes/original/src/components/ProductForm/ActionButton.tsx +120 -0
- package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
- package/themes/original/src/components/ProductForm/index.tsx +75 -166
- package/themes/original/src/components/ProductForm/styles.tsx +1 -1
- package/themes/original/src/components/ProductItemAccordion/index.tsx +12 -8
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +120 -79
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +7 -4
- package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
- package/themes/original/src/components/Promotions/index.tsx +4 -4
- package/themes/original/src/components/Promotions/styles.tsx +0 -2
- package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
- package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
- package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
- 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/SingleOrderCard/index.tsx +5 -4
- package/themes/original/src/components/SingleProductCard/index.tsx +2 -2
- package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
- package/themes/original/src/components/StripeCardsList/index.tsx +16 -35
- package/themes/original/src/components/StripeElementsForm/index.tsx +9 -4
- package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
- package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +86 -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 +53 -7
- package/themes/original/src/components/UserProfile/index.tsx +3 -2
- package/themes/original/src/components/UserProfileForm/index.tsx +30 -36
- package/themes/original/src/components/UserVerification/index.tsx +55 -50
- package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
- package/themes/original/src/components/Wallets/index.tsx +8 -9
- package/themes/original/src/components/Wallets/styles.tsx +1 -1
- 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 +1 -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 +8 -2
- package/themes/original/src/utils/index.tsx +124 -0
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
- 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,8 +1,12 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import { View, StyleSheet, TouchableOpacity, Platform, I18nManager, ScrollView } from 'react-native';
|
|
1
|
+
import React, { useState, useEffect, useCallback, useRef } from 'react';
|
|
2
|
+
import { View, StyleSheet, TouchableOpacity, Platform, I18nManager, ScrollView, Keyboard, BackHandler, SafeAreaView } from 'react-native';
|
|
3
3
|
import { initStripe, useConfirmPayment } from '@stripe/stripe-react-native';
|
|
4
|
+
import NativeStripeSdk from '@stripe/stripe-react-native/src/NativeStripeSdk'
|
|
4
5
|
import Picker from 'react-native-country-picker-modal';
|
|
5
6
|
import MaterialIcons from 'react-native-vector-icons/MaterialIcons'
|
|
7
|
+
import IconAntDesign from 'react-native-vector-icons/AntDesign';
|
|
8
|
+
import { useIsFocused } from '@react-navigation/native';
|
|
9
|
+
|
|
6
10
|
import ReactNativeHapticFeedback from "react-native-haptic-feedback";
|
|
7
11
|
import {
|
|
8
12
|
Checkout as CheckoutController,
|
|
@@ -45,10 +49,11 @@ import {
|
|
|
45
49
|
DeliveryOptionsContainer,
|
|
46
50
|
DeliveryOptionItem,
|
|
47
51
|
WalletPaymentOptionContainer,
|
|
48
|
-
CartHeader
|
|
52
|
+
CartHeader,
|
|
53
|
+
TopHeader,
|
|
54
|
+
TopActions
|
|
49
55
|
} from './styles';
|
|
50
56
|
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
|
|
51
|
-
|
|
52
57
|
import { FloatingButton } from '../FloatingButton';
|
|
53
58
|
import { Container } from '../../layouts/Container';
|
|
54
59
|
import NavBar from '../NavBar';
|
|
@@ -56,6 +61,8 @@ import { OrderSummary } from '../OrderSummary';
|
|
|
56
61
|
import { getTypesText } from '../../utils';
|
|
57
62
|
import { CartStoresListing } from '../CartStoresListing';
|
|
58
63
|
import { PaymentOptionsWebView } from '../../../../../src/components/PaymentOptionsWebView';
|
|
64
|
+
import { DeviceOrientationMethods } from '../../../../../src/hooks/DeviceOrientation'
|
|
65
|
+
const { useDeviceOrientation } = DeviceOrientationMethods
|
|
59
66
|
|
|
60
67
|
const mapConfigs = {
|
|
61
68
|
mapZoom: 16,
|
|
@@ -94,10 +101,13 @@ const CheckoutUI = (props: any) => {
|
|
|
94
101
|
currency,
|
|
95
102
|
merchantId,
|
|
96
103
|
setPlaceSpotNumber,
|
|
97
|
-
maxDate
|
|
104
|
+
maxDate,
|
|
105
|
+
androidAppId,
|
|
106
|
+
urlscheme
|
|
98
107
|
} = props
|
|
99
108
|
|
|
100
109
|
const theme = useTheme();
|
|
110
|
+
const isFocused = useIsFocused();
|
|
101
111
|
|
|
102
112
|
const styles = StyleSheet.create({
|
|
103
113
|
btnBackArrow: {
|
|
@@ -113,7 +123,7 @@ const CheckoutUI = (props: any) => {
|
|
|
113
123
|
padding: 20
|
|
114
124
|
},
|
|
115
125
|
pagePadding: {
|
|
116
|
-
paddingHorizontal:
|
|
126
|
+
paddingHorizontal: 20
|
|
117
127
|
},
|
|
118
128
|
icon: {
|
|
119
129
|
top: 15,
|
|
@@ -122,13 +132,14 @@ const CheckoutUI = (props: any) => {
|
|
|
122
132
|
fontSize: 20
|
|
123
133
|
},
|
|
124
134
|
detailWrapper: {
|
|
125
|
-
paddingHorizontal:
|
|
135
|
+
paddingHorizontal: 20,
|
|
126
136
|
width: '100%'
|
|
127
137
|
},
|
|
128
138
|
wrapperNavbar: {
|
|
129
|
-
paddingVertical:
|
|
130
|
-
paddingHorizontal:
|
|
131
|
-
|
|
139
|
+
paddingVertical: 2,
|
|
140
|
+
paddingHorizontal: 20,
|
|
141
|
+
backgroundColor: theme?.colors?.white,
|
|
142
|
+
borderWidth: 0
|
|
132
143
|
}
|
|
133
144
|
})
|
|
134
145
|
|
|
@@ -141,6 +152,10 @@ const CheckoutUI = (props: any) => {
|
|
|
141
152
|
const [{ options, carts, loading }, { confirmCart }] = useOrder();
|
|
142
153
|
const [validationFields] = useValidationFields();
|
|
143
154
|
const [events] = useEvent()
|
|
155
|
+
const [orientationState] = useDeviceOrientation();
|
|
156
|
+
const [isReadMore, setIsReadMore] = useState(false)
|
|
157
|
+
const [lengthMore, setLengthMore] = useState(false)
|
|
158
|
+
const WIDTH_SCREEN = orientationState?.dimensions?.width
|
|
144
159
|
|
|
145
160
|
const [errorCash, setErrorCash] = useState(false);
|
|
146
161
|
const [userErrors, setUserErrors] = useState<any>([]);
|
|
@@ -148,19 +163,23 @@ const CheckoutUI = (props: any) => {
|
|
|
148
163
|
const [phoneUpdate, setPhoneUpdate] = useState(false);
|
|
149
164
|
const [openChangeStore, setOpenChangeStore] = useState(false)
|
|
150
165
|
const [isDeliveryOptionModalVisible, setIsDeliveryOptionModalVisible] = useState(false)
|
|
151
|
-
const [showGateway, setShowGateway] = useState<any>({
|
|
166
|
+
const [showGateway, setShowGateway] = useState<any>({ closedByUser: false, open: false });
|
|
152
167
|
const [webviewPaymethod, setWebviewPaymethod] = useState<any>(null)
|
|
153
168
|
const [isOpen, setIsOpen] = useState(false)
|
|
154
169
|
const [requiredFields, setRequiredFields] = useState<any>([])
|
|
155
|
-
const [openModal, setOpenModal] = useState({ login: false, signup: false })
|
|
170
|
+
const [openModal, setOpenModal] = useState({ login: false, signup: false, isGuest: false })
|
|
156
171
|
const [allowedGuest, setAllowedGuest] = useState(false)
|
|
157
172
|
const [placeByMethodPay, setPlaceByMethodPay] = useState(false)
|
|
158
173
|
const [methodPaySupported, setMethodPaySupported] = useState({ enabled: false, message: null, loading: true })
|
|
174
|
+
const [paymethodClicked, setPaymethodClicked] = useState<any>(null)
|
|
175
|
+
const [showTitle, setShowTitle] = useState(false)
|
|
159
176
|
const [cardList, setCardList] = useState<any>({ cards: [], loading: false, error: null })
|
|
177
|
+
const [isGiftCardCart, setIsGiftCardCart] = useState(!cart?.business_id)
|
|
178
|
+
const containerRef = useRef<any>()
|
|
160
179
|
const cardsMethods = ['credomatic']
|
|
180
|
+
const stripePaymethods: any = ['stripe', 'stripe_direct', 'stripe_connect', 'stripe_redirect']
|
|
161
181
|
const placeSpotTypes = [3, 4, 5]
|
|
162
182
|
const placeSpotsEnabled = placeSpotTypes.includes(options?.type)
|
|
163
|
-
const isGiftCardCart = !cart?.business_id
|
|
164
183
|
const businessConfigs = businessDetails?.business?.configs ?? []
|
|
165
184
|
const isWalletCashEnabled = businessConfigs.find((config: any) => config.key === 'wallet_cash_enabled')?.value === '1'
|
|
166
185
|
const isWalletCreditPointsEnabled = businessConfigs.find((config: any) => config.key === 'wallet_credit_point_enabled')?.value === '1'
|
|
@@ -184,15 +203,21 @@ const CheckoutUI = (props: any) => {
|
|
|
184
203
|
}, cart?.subtotal)
|
|
185
204
|
|
|
186
205
|
const validateCommentsCartField = validationFields?.fields?.checkout?.comments?.enabled && validationFields?.fields?.checkout?.comments?.required && (cart?.comment === null || cart?.comment?.trim().length === 0)
|
|
206
|
+
const validateZipcodeCard = validationFields?.fields?.card?.zipcode?.enabled &&
|
|
207
|
+
validationFields?.fields?.card?.zipcode?.required &&
|
|
208
|
+
paymethodSelected?.data?.card &&
|
|
209
|
+
!paymethodSelected?.data?.card?.zipcode &&
|
|
210
|
+
paymethodSelected?.gateway === 'stripe'
|
|
187
211
|
|
|
188
212
|
const isDisabledButtonPlace = loading || !cart?.valid || (!paymethodSelected && cart?.balance > 0) ||
|
|
189
213
|
placing || errorCash || subtotalWithTaxes < cart?.minimum ||
|
|
190
214
|
(cardsMethods.includes(paymethodSelected?.gateway) && cardList?.cards?.length === 0) ||
|
|
191
|
-
(options.type === 1 &&
|
|
215
|
+
(options.type === 1 && !isGiftCardCart &&
|
|
192
216
|
validationFields?.fields?.checkout?.driver_tip?.enabled &&
|
|
193
217
|
validationFields?.fields?.checkout?.driver_tip?.required &&
|
|
194
218
|
(Number(cart?.driver_tip) <= 0)) ||
|
|
195
|
-
(validateCommentsCartField)
|
|
219
|
+
(validateCommentsCartField) ||
|
|
220
|
+
(validateZipcodeCard)
|
|
196
221
|
|| (methodsPay.includes(paymethodSelected?.gateway) && (!methodPaySupported.enabled || methodPaySupported.loading))
|
|
197
222
|
|
|
198
223
|
const driverTipsOptions = typeof configs?.driver_tip_options?.value === 'string'
|
|
@@ -231,7 +256,8 @@ const CheckoutUI = (props: any) => {
|
|
|
231
256
|
user,
|
|
232
257
|
token: user?.session?.access_token
|
|
233
258
|
})
|
|
234
|
-
|
|
259
|
+
openModal?.isGuest && handlePlaceOrderAsGuest()
|
|
260
|
+
setOpenModal({ ...openModal, signup: false, isGuest: false })
|
|
235
261
|
}
|
|
236
262
|
|
|
237
263
|
const handleSuccessLogin = (user: any) => {
|
|
@@ -239,9 +265,14 @@ const CheckoutUI = (props: any) => {
|
|
|
239
265
|
}
|
|
240
266
|
|
|
241
267
|
const handlePlaceOrder = (confirmPayment: any, forcePlace: boolean = false) => {
|
|
268
|
+
if (stripePaymethods.includes(paymethodSelected?.gateway) && user?.guest_id) {
|
|
269
|
+
setOpenModal({ ...openModal, signup: true, isGuest: true })
|
|
270
|
+
return
|
|
271
|
+
}
|
|
272
|
+
|
|
242
273
|
if (!userErrors.length && (!requiredFields?.length || allowedGuest) || forcePlace) {
|
|
243
274
|
vibrateApp()
|
|
244
|
-
handlerClickPlaceOrder && handlerClickPlaceOrder(null, { isNative: true }, confirmPayment)
|
|
275
|
+
handlerClickPlaceOrder && handlerClickPlaceOrder(null, { isNative: true }, confirmPayment, NativeStripeSdk?.dismissPlatformPay)
|
|
245
276
|
return
|
|
246
277
|
}
|
|
247
278
|
if (requiredFields?.length) {
|
|
@@ -311,6 +342,10 @@ const CheckoutUI = (props: any) => {
|
|
|
311
342
|
setPhoneUpdate(val)
|
|
312
343
|
}
|
|
313
344
|
|
|
345
|
+
const handleScroll = ({ nativeEvent: { contentOffset } }: any) => {
|
|
346
|
+
setShowTitle(contentOffset.y > 30)
|
|
347
|
+
}
|
|
348
|
+
|
|
314
349
|
useEffect(() => {
|
|
315
350
|
if (validationFields && validationFields?.fields?.checkout) {
|
|
316
351
|
checkValidationFields()
|
|
@@ -326,13 +361,23 @@ const CheckoutUI = (props: any) => {
|
|
|
326
361
|
|
|
327
362
|
useEffect(() => {
|
|
328
363
|
if (cart?.products?.length === 0) {
|
|
329
|
-
if (cart?.
|
|
364
|
+
if (cart?.business_id !== null) {
|
|
330
365
|
onNavigationRedirect('Business', { store: cart?.business?.slug, header: null, logo: null, fromMulti: props.fromMulti })
|
|
331
|
-
} else {
|
|
366
|
+
} else if (isGiftCardCart) {
|
|
332
367
|
onNavigationRedirect('Wallets')
|
|
333
368
|
}
|
|
334
369
|
}
|
|
335
|
-
}, [cart?.products])
|
|
370
|
+
}, [cart?.products?.length])
|
|
371
|
+
|
|
372
|
+
useEffect(() => {
|
|
373
|
+
if (cart?.products?.length > 0) {
|
|
374
|
+
if (cart?.uuid && cart?.business_id === null) {
|
|
375
|
+
setIsGiftCardCart(true)
|
|
376
|
+
} else {
|
|
377
|
+
setIsGiftCardCart(false)
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}, [cart?.uuid, cart?.products?.length])
|
|
336
381
|
|
|
337
382
|
useEffect(() => {
|
|
338
383
|
onFailPaypal()
|
|
@@ -367,11 +412,74 @@ const CheckoutUI = (props: any) => {
|
|
|
367
412
|
}
|
|
368
413
|
}, [cart?.paymethod_data])
|
|
369
414
|
|
|
415
|
+
const onTextLayout = useCallback((e: any) => {
|
|
416
|
+
setLengthMore((e.nativeEvent.lines.length == 3 && e.nativeEvent.lines[2].width > WIDTH_SCREEN * .76) || e.nativeEvent.lines.length > 3)
|
|
417
|
+
}, [])
|
|
418
|
+
|
|
419
|
+
useEffect(() => {
|
|
420
|
+
if (!isFocused) return
|
|
421
|
+
if (!cartState?.loading && (cartState?.error || typeof cartState?.cart === 'string')) {
|
|
422
|
+
const error = cartState?.error || typeof cartState.cart === 'string' && cartState.cart
|
|
423
|
+
if (error) {
|
|
424
|
+
showToast(ToastType.Error, cartState?.error || cartState.cart)
|
|
425
|
+
navigation.navigate('BusinessList')
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}, [cartState?.error, cartState?.cart, cartState?.loading, isFocused])
|
|
429
|
+
|
|
430
|
+
useEffect(() => {
|
|
431
|
+
const keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', () => {
|
|
432
|
+
containerRef?.current?.scrollToEnd && containerRef.current.scrollToEnd({ animated: true })
|
|
433
|
+
})
|
|
434
|
+
return () => {
|
|
435
|
+
keyboardDidShowListener.remove()
|
|
436
|
+
}
|
|
437
|
+
}, [])
|
|
438
|
+
|
|
439
|
+
useEffect(() => {
|
|
440
|
+
const onBackFunction = () => {
|
|
441
|
+
if (webviewPaymethod?.gateway === 'paypal' && showGateway.open) {
|
|
442
|
+
setShowGateway({ open: false, closedByUser: true })
|
|
443
|
+
return true
|
|
444
|
+
} else {
|
|
445
|
+
return false
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
BackHandler.addEventListener('hardwareBackPress', onBackFunction)
|
|
449
|
+
return () => {
|
|
450
|
+
BackHandler.removeEventListener('hardwareBackPress', onBackFunction)
|
|
451
|
+
}
|
|
452
|
+
}, [BackHandler, webviewPaymethod?.gateway, showGateway.open])
|
|
453
|
+
|
|
370
454
|
return (
|
|
371
455
|
<>
|
|
372
|
-
<
|
|
456
|
+
<SafeAreaView style={{ backgroundColor: theme.colors.backgroundPage }}>
|
|
457
|
+
<View style={styles.wrapperNavbar}>
|
|
458
|
+
<TopHeader>
|
|
459
|
+
<TopActions onPress={() => onNavigationRedirect('BottomTab', { screen: 'Cart' }, !props.fromMulti)}>
|
|
460
|
+
<IconAntDesign
|
|
461
|
+
name='arrowleft'
|
|
462
|
+
size={26}
|
|
463
|
+
/>
|
|
464
|
+
</TopActions>
|
|
465
|
+
{showTitle && (
|
|
466
|
+
<OText
|
|
467
|
+
size={16}
|
|
468
|
+
style={{ flex: 1, textAlign: 'center', right: 15 }}
|
|
469
|
+
weight={Platform.OS === 'ios' ? '600' : 'bold'}
|
|
470
|
+
numberOfLines={2}
|
|
471
|
+
ellipsizeMode='tail'
|
|
472
|
+
>
|
|
473
|
+
{t('CHECKOUT', 'Checkout')}
|
|
474
|
+
</OText>
|
|
475
|
+
)}
|
|
476
|
+
</TopHeader>
|
|
477
|
+
</View>
|
|
478
|
+
</SafeAreaView>
|
|
479
|
+
<Container pt={0} forwardRef={containerRef} showsVerticalScrollIndicator={false} noPadding onScroll={handleScroll}>
|
|
373
480
|
<View style={styles.wrapperNavbar}>
|
|
374
481
|
<NavBar
|
|
482
|
+
hideArrowLeft
|
|
375
483
|
title={t('CHECKOUT', 'Checkout')}
|
|
376
484
|
titleAlign={'center'}
|
|
377
485
|
onActionLeft={() => onNavigationRedirect('BottomTab', { screen: 'Cart' }, !props.fromMulti)}
|
|
@@ -383,44 +491,46 @@ const CheckoutUI = (props: any) => {
|
|
|
383
491
|
/>
|
|
384
492
|
</View>
|
|
385
493
|
<ChContainer style={styles.pagePadding}>
|
|
386
|
-
|
|
387
|
-
<
|
|
388
|
-
<
|
|
389
|
-
<
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
src={theme.images.general.arrow_down}
|
|
399
|
-
width={10}
|
|
400
|
-
style={{ marginStart: 8 }}
|
|
401
|
-
{...(isChewLayout && { color: 'white' })}
|
|
402
|
-
/>
|
|
403
|
-
</CHMomentWrapper>
|
|
404
|
-
<CHMomentWrapper
|
|
405
|
-
onPress={() => handleMomentClick()}
|
|
406
|
-
disabled={loading}
|
|
407
|
-
>
|
|
408
|
-
<OText size={12} numberOfLines={1} ellipsizeMode='tail' color={theme.colors.textSecondary}>
|
|
409
|
-
{options?.moment
|
|
410
|
-
? parseDate(options?.moment, { outputFormat: configs?.dates_moment_format?.value })
|
|
411
|
-
: t('ASAP_ABBREVIATION', 'ASAP')}
|
|
412
|
-
</OText>
|
|
413
|
-
{isPreOrder && (
|
|
494
|
+
{!isGiftCardCart && (
|
|
495
|
+
<ChSection style={{ paddingTop: 0 }}>
|
|
496
|
+
<ChHeader>
|
|
497
|
+
<CHMomentWrapper isCustomColor={isChewLayout} onPress={() => navigation.navigate('OrderTypes', { configTypes: configTypes })}>
|
|
498
|
+
<OText
|
|
499
|
+
size={12}
|
|
500
|
+
numberOfLines={1}
|
|
501
|
+
ellipsizeMode={'tail'}
|
|
502
|
+
color={theme.colors?.[isChewLayout ? 'white' : 'textSecondary']}
|
|
503
|
+
>
|
|
504
|
+
{t(getTypesText(options?.type || 1), 'Delivery')}
|
|
505
|
+
</OText>
|
|
414
506
|
<OIcon
|
|
415
507
|
src={theme.images.general.arrow_down}
|
|
416
508
|
width={10}
|
|
417
509
|
style={{ marginStart: 8 }}
|
|
510
|
+
{...(isChewLayout && { color: 'white' })}
|
|
418
511
|
/>
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
512
|
+
</CHMomentWrapper>
|
|
513
|
+
<CHMomentWrapper
|
|
514
|
+
onPress={() => handleMomentClick()}
|
|
515
|
+
disabled={loading}
|
|
516
|
+
>
|
|
517
|
+
<OText size={12} numberOfLines={1} ellipsizeMode='tail' color={theme.colors.textSecondary}>
|
|
518
|
+
{options?.moment
|
|
519
|
+
? parseDate(options?.moment, { outputFormat: configs?.dates_moment_format?.value })
|
|
520
|
+
: t('ASAP_ABBREVIATION', 'ASAP')}
|
|
521
|
+
</OText>
|
|
522
|
+
{isPreOrder && (
|
|
523
|
+
<OIcon
|
|
524
|
+
src={theme.images.general.arrow_down}
|
|
525
|
+
width={10}
|
|
526
|
+
style={{ marginStart: 8 }}
|
|
527
|
+
/>
|
|
528
|
+
)}
|
|
529
|
+
</CHMomentWrapper>
|
|
530
|
+
</ChHeader>
|
|
531
|
+
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginTop: 18, marginHorizontal: -40 }} />
|
|
532
|
+
</ChSection>
|
|
533
|
+
)}
|
|
424
534
|
|
|
425
535
|
{!isGiftCardCart && !hideBusinessDetails && (
|
|
426
536
|
<ChSection>
|
|
@@ -458,6 +568,25 @@ const CheckoutUI = (props: any) => {
|
|
|
458
568
|
{businessDetails?.business?.address}
|
|
459
569
|
</OText>
|
|
460
570
|
)}
|
|
571
|
+
{businessDetails?.business?.address_notes && (
|
|
572
|
+
<>
|
|
573
|
+
<OText
|
|
574
|
+
size={12}
|
|
575
|
+
lineHeight={18}
|
|
576
|
+
numberOfLines={isReadMore ? 20 : 3}
|
|
577
|
+
onTextLayout={onTextLayout}
|
|
578
|
+
>
|
|
579
|
+
{businessDetails?.business?.address_notes}
|
|
580
|
+
</OText>
|
|
581
|
+
{lengthMore && (
|
|
582
|
+
<TouchableOpacity
|
|
583
|
+
onPress={() => setIsReadMore(!isReadMore)}
|
|
584
|
+
>
|
|
585
|
+
<OText size={12} color={theme.colors.primary}>{isReadMore ? t('SHOW_LESS', 'Show less') : t('READ_MORE', 'Read more')}</OText>
|
|
586
|
+
</TouchableOpacity>
|
|
587
|
+
)}
|
|
588
|
+
</>
|
|
589
|
+
)}
|
|
461
590
|
</View>
|
|
462
591
|
</>
|
|
463
592
|
)}
|
|
@@ -642,7 +771,7 @@ const CheckoutUI = (props: any) => {
|
|
|
642
771
|
cart?.status !== 2 &&
|
|
643
772
|
validationFields?.fields?.checkout?.driver_tip?.enabled &&
|
|
644
773
|
driverTipsOptions && driverTipsOptions?.length > 0 &&
|
|
645
|
-
|
|
774
|
+
cart?.business_id &&
|
|
646
775
|
(
|
|
647
776
|
<ChSection>
|
|
648
777
|
<ChDriverTips>
|
|
@@ -690,12 +819,18 @@ const CheckoutUI = (props: any) => {
|
|
|
690
819
|
handlePaymentMethodClickCustom={handlePaymentMethodClick}
|
|
691
820
|
handlePlaceOrder={handlePlaceOrder}
|
|
692
821
|
merchantId={merchantId}
|
|
822
|
+
urlscheme={urlscheme}
|
|
823
|
+
androidAppId={androidAppId}
|
|
693
824
|
setMethodPaySupported={setMethodPaySupported}
|
|
694
825
|
methodPaySupported={methodPaySupported}
|
|
695
826
|
placeByMethodPay={placeByMethodPay}
|
|
696
827
|
setPlaceByMethodPay={setPlaceByMethodPay}
|
|
697
828
|
cardList={cardList}
|
|
698
829
|
setCardList={setCardList}
|
|
830
|
+
requiredFields={requiredFields}
|
|
831
|
+
openUserModal={setIsOpen}
|
|
832
|
+
paymethodClicked={paymethodClicked}
|
|
833
|
+
setPaymethodClicked={setPaymethodClicked}
|
|
699
834
|
/>
|
|
700
835
|
</ChPaymethods>
|
|
701
836
|
</ChSection>
|
|
@@ -731,7 +866,7 @@ const CheckoutUI = (props: any) => {
|
|
|
731
866
|
{!cartState.loading && cart && (
|
|
732
867
|
<ChSection>
|
|
733
868
|
<ChCart>
|
|
734
|
-
{cartsWithProducts && cart?.products?.length === 0 ? (
|
|
869
|
+
{cartsWithProducts?.length > 0 && cart?.products?.length === 0 ? (
|
|
735
870
|
<NotFoundSource
|
|
736
871
|
content={t('NOT_FOUND_CARTS', 'Sorry, You don\'t seem to have any carts.')}
|
|
737
872
|
btnTitle={t('SEARCH_REDIRECT', 'Go to Businesses')}
|
|
@@ -809,13 +944,15 @@ const CheckoutUI = (props: any) => {
|
|
|
809
944
|
</OText>
|
|
810
945
|
)}
|
|
811
946
|
|
|
812
|
-
{!cart?.valid_products && cart?.status !== 2 && (
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
947
|
+
{!cart?.valid_products && cart?.status !== 2 && cart?.total !== 0 && (
|
|
948
|
+
<>
|
|
949
|
+
<OText
|
|
950
|
+
color={theme.colors.error}
|
|
951
|
+
size={12}
|
|
952
|
+
>
|
|
953
|
+
{t('WARNING_INVALID_PRODUCTS_CHECKOUT', 'To continue with your checkout, please remove from your cart the products that are not available.')}
|
|
954
|
+
</OText>
|
|
955
|
+
</>
|
|
819
956
|
)}
|
|
820
957
|
{cart?.valid_preorder !== undefined && !cart?.valid_preorder && (
|
|
821
958
|
<OText
|
|
@@ -825,7 +962,7 @@ const CheckoutUI = (props: any) => {
|
|
|
825
962
|
{t('INVALID_CART_MOMENT', 'Selected schedule time is invalid, please select a schedule into the business schedule interval.')}
|
|
826
963
|
</OText>
|
|
827
964
|
)}
|
|
828
|
-
{options.type === 1 &&
|
|
965
|
+
{options.type === 1 && !isGiftCardCart &&
|
|
829
966
|
validationFields?.fields?.checkout?.driver_tip?.enabled &&
|
|
830
967
|
validationFields?.fields?.checkout?.driver_tip?.required &&
|
|
831
968
|
(Number(cart?.driver_tip) <= 0) && (
|
|
@@ -845,6 +982,15 @@ const CheckoutUI = (props: any) => {
|
|
|
845
982
|
{t('WARNING_INVALID_CART_COMMENTS', 'Cart comments is required.')}
|
|
846
983
|
</OText>
|
|
847
984
|
)}
|
|
985
|
+
|
|
986
|
+
{validateZipcodeCard && (
|
|
987
|
+
<OText
|
|
988
|
+
color={theme.colors.error}
|
|
989
|
+
size={12}
|
|
990
|
+
>
|
|
991
|
+
{t('WARNING_CARD_ZIPCODE_REQUIRED', 'Your card selected has not zipcode')}
|
|
992
|
+
</OText>
|
|
993
|
+
)}
|
|
848
994
|
</ChErrors>
|
|
849
995
|
</View>
|
|
850
996
|
)}
|
|
@@ -880,7 +1026,14 @@ const CheckoutUI = (props: any) => {
|
|
|
880
1026
|
handlePlaceOrderAsGuest={handlePlaceOrderAsGuest}
|
|
881
1027
|
onClose={() => {
|
|
882
1028
|
setIsOpen(false)
|
|
883
|
-
|
|
1029
|
+
if (paymethodClicked) {
|
|
1030
|
+
setPaymethodClicked({
|
|
1031
|
+
...paymethodClicked,
|
|
1032
|
+
confirmed: true
|
|
1033
|
+
})
|
|
1034
|
+
} else {
|
|
1035
|
+
handlePlaceOrder(null, true)
|
|
1036
|
+
}
|
|
884
1037
|
}}
|
|
885
1038
|
setIsOpen={setIsOpen}
|
|
886
1039
|
/>
|
|
@@ -888,7 +1041,7 @@ const CheckoutUI = (props: any) => {
|
|
|
888
1041
|
</OModal>
|
|
889
1042
|
<OModal
|
|
890
1043
|
open={openModal.signup}
|
|
891
|
-
onClose={() => setOpenModal({ ...openModal, signup: false })}
|
|
1044
|
+
onClose={() => setOpenModal({ ...openModal, signup: false, isGuest: false })}
|
|
892
1045
|
>
|
|
893
1046
|
<ScrollView style={{ paddingHorizontal: 20, width: '100%' }}>
|
|
894
1047
|
<SignupForm
|
|
@@ -113,3 +113,20 @@ export const CartHeader = styled.View`
|
|
|
113
113
|
justify-content: space-between;
|
|
114
114
|
margin-bottom: 10px;
|
|
115
115
|
`
|
|
116
|
+
|
|
117
|
+
export const TopActions = styled.TouchableOpacity`
|
|
118
|
+
height: 60px;
|
|
119
|
+
justify-content: center;
|
|
120
|
+
min-width: 30px;
|
|
121
|
+
padding-right: 15px;
|
|
122
|
+
`;
|
|
123
|
+
|
|
124
|
+
export const TopHeader = styled.View`
|
|
125
|
+
width: 100%;
|
|
126
|
+
flex-direction: row;
|
|
127
|
+
align-items: center;
|
|
128
|
+
justify-content: space-between;
|
|
129
|
+
z-index: 1;
|
|
130
|
+
height: 60px;
|
|
131
|
+
min-height: 60px;
|
|
132
|
+
`
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import DatePicker from 'react-native-date-picker'
|
|
3
|
+
import { DateContainer } from './styles';
|
|
4
|
+
|
|
5
|
+
export const DatePickerUI = (props: any) => {
|
|
6
|
+
const {
|
|
7
|
+
birthdate,
|
|
8
|
+
handleChangeDate
|
|
9
|
+
} = props;
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<DateContainer>
|
|
13
|
+
<DatePicker mode="date" date={birthdate ? new Date(birthdate) : new Date()} onDateChange={handleChangeDate} />
|
|
14
|
+
</DateContainer>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import styled from 'styled-components/native';
|
|
2
|
+
|
|
3
|
+
export const DateContainer = styled.View`
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
margin-bottom: 20px;
|
|
7
|
+
|
|
8
|
+
input {
|
|
9
|
+
border-radius: 20px;
|
|
10
|
+
width: 140px;
|
|
11
|
+
outline: none;
|
|
12
|
+
padding: 10px 15px;
|
|
13
|
+
border: 1px solid #E9ECEF;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.react-datepicker__triangle {
|
|
17
|
+
transform: translate(40px, 0px) !important;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
`
|
|
@@ -14,8 +14,7 @@ import {
|
|
|
14
14
|
|
|
15
15
|
export const Favorite = (props: any) => {
|
|
16
16
|
const {
|
|
17
|
-
navigation
|
|
18
|
-
franchiseId
|
|
17
|
+
navigation
|
|
19
18
|
} = props
|
|
20
19
|
const [, t] = useLanguage()
|
|
21
20
|
const theme = useTheme()
|
|
@@ -35,15 +34,14 @@ export const Favorite = (props: any) => {
|
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
return (
|
|
38
|
-
<Container
|
|
39
|
-
pdng={Platform.OS === 'ios' ? '10px' : '20px'}
|
|
40
|
-
>
|
|
37
|
+
<Container>
|
|
41
38
|
<NavBar
|
|
42
39
|
title={t('FAVORITE', 'Favorite')}
|
|
43
40
|
titleAlign={'center'}
|
|
44
41
|
onActionLeft={goToBack}
|
|
45
42
|
showCall={false}
|
|
46
|
-
paddingTop={10}
|
|
43
|
+
paddingTop={Platform.OS === 'ios' ? 20 : 10}
|
|
44
|
+
style={{ paddingVertical: 0 }}
|
|
47
45
|
btnStyle={{ paddingLeft: 0 }}
|
|
48
46
|
/>
|
|
49
47
|
<TabContainer>
|
|
@@ -73,7 +71,6 @@ export const Favorite = (props: any) => {
|
|
|
73
71
|
originalURL='business'
|
|
74
72
|
location={`${orderState.options?.address?.location?.lat},${orderState.options?.address?.location?.lng}`}
|
|
75
73
|
propsToFetch={['id', 'name', 'header', 'logo', 'location', 'address', 'ribbon', 'timezone', 'schedule', 'open', 'delivery_price', 'distance', 'delivery_time', 'pickup_time', 'reviews', 'featured', 'offers', 'food', 'laundry', 'alcohol', 'groceries', 'slug']}
|
|
76
|
-
franchiseId={franchiseId}
|
|
77
74
|
/>
|
|
78
75
|
)}
|
|
79
76
|
{tabSelected === 'products' && (
|
|
@@ -82,7 +79,6 @@ export const Favorite = (props: any) => {
|
|
|
82
79
|
originalURL='products'
|
|
83
80
|
onNavigationRedirect={onRedirect}
|
|
84
81
|
isProduct
|
|
85
|
-
franchiseId={franchiseId}
|
|
86
82
|
/>
|
|
87
83
|
)}
|
|
88
84
|
{tabSelected === 'orders' && (
|
|
@@ -91,7 +87,6 @@ export const Favorite = (props: any) => {
|
|
|
91
87
|
favoriteURL='favorite_orders'
|
|
92
88
|
originalURL='orders'
|
|
93
89
|
isOrder
|
|
94
|
-
franchiseId={franchiseId}
|
|
95
90
|
/>
|
|
96
91
|
)}
|
|
97
92
|
</Container>
|
|
@@ -61,7 +61,7 @@ export const GPSButton = (props: any) => {
|
|
|
61
61
|
if (trackingStatus === 'not-determined') {
|
|
62
62
|
trackingStatus = await requestTrackingPermission()
|
|
63
63
|
}
|
|
64
|
-
if (trackingStatus === 'authorized' || trackingStatus === 'unavailable') {
|
|
64
|
+
if ( trackingStatus === 'authorized' || trackingStatus === 'denied' || trackingStatus === 'unavailable') {
|
|
65
65
|
setLoading(true)
|
|
66
66
|
Geolocation.getCurrentPosition((pos) => {
|
|
67
67
|
geoCodePosition(pos.coords)
|