ordering-ui-react-native 0.18.55-test1 → 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 -5
- 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
|
@@ -30,7 +30,6 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
30
30
|
isBusinessMarker,
|
|
31
31
|
isToFollow,
|
|
32
32
|
handleViewActionOrder,
|
|
33
|
-
updateDriverPosition,
|
|
34
33
|
driverUpdateLocation,
|
|
35
34
|
setDriverUpdateLocation,
|
|
36
35
|
} = props;
|
|
@@ -59,6 +58,7 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
59
58
|
key?: string | null;
|
|
60
59
|
}>({ open: false, content: [], key: null });
|
|
61
60
|
const distanceUnit = configState?.configs?.distance_unit?.value
|
|
61
|
+
const isHideRejectButtons = configState?.configs?.reject_orders_enabled && configState?.configs?.reject_orders_enabled?.value !== '1'
|
|
62
62
|
|
|
63
63
|
const {
|
|
64
64
|
hasLocation,
|
|
@@ -69,11 +69,20 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
69
69
|
stopFollowUserLocation,
|
|
70
70
|
} = useLocation();
|
|
71
71
|
|
|
72
|
-
const
|
|
73
|
-
latitude:
|
|
74
|
-
longitude:
|
|
72
|
+
const destination = {
|
|
73
|
+
latitude: typeof location?.lat === 'string' ? parseFloat(location?.lat) || 0 : location?.lat || 0,
|
|
74
|
+
longitude: typeof location?.lng === 'string' ? parseFloat(location?.lng) || 0 : location?.lng || 0
|
|
75
75
|
};
|
|
76
|
-
|
|
76
|
+
|
|
77
|
+
const parsedInitialPosition = {
|
|
78
|
+
latitude: typeof initialPosition.latitude === 'string' ? parseFloat(initialPosition.latitude) || 0 : initialPosition.latitude || 0,
|
|
79
|
+
longitude: typeof initialPosition.longitude === 'string' ? parseFloat(initialPosition.longitude) || 0 : initialPosition.longitude || 0,
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const parsedUserLocation = {
|
|
83
|
+
latitude: typeof userLocation?.latitude === 'string' ? parseFloat(userLocation?.latitude) || 0 : userLocation?.latitude || 0,
|
|
84
|
+
longitude: typeof userLocation?.longitude === 'string' ? parseFloat(userLocation?.longitude) || 0 : userLocation?.longitude || 0
|
|
85
|
+
}
|
|
77
86
|
|
|
78
87
|
useEffect(() => {
|
|
79
88
|
if (isToFollow) {
|
|
@@ -161,7 +170,7 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
161
170
|
if (driverUpdateLocation.error) return;
|
|
162
171
|
|
|
163
172
|
calculateDistance(
|
|
164
|
-
{ lat:
|
|
173
|
+
{ lat: parsedUserLocation.latitude, lng: parsedUserLocation.longitude },
|
|
165
174
|
destination,
|
|
166
175
|
);
|
|
167
176
|
// geocodePosition(userLocation);
|
|
@@ -169,13 +178,13 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
169
178
|
if (!following.current) return;
|
|
170
179
|
fitCoordinates();
|
|
171
180
|
|
|
172
|
-
const { latitude, longitude } =
|
|
181
|
+
const { latitude, longitude } = parsedUserLocation;
|
|
173
182
|
|
|
174
183
|
mapRef.current?.animateCamera({
|
|
175
184
|
center: { latitude, longitude },
|
|
176
185
|
});
|
|
177
186
|
|
|
178
|
-
}, [
|
|
187
|
+
}, [parsedUserLocation]);
|
|
179
188
|
|
|
180
189
|
const handleArrowBack: any = () => {
|
|
181
190
|
setDriverUpdateLocation?.({
|
|
@@ -241,8 +250,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
241
250
|
[
|
|
242
251
|
{ latitude: location.lat, longitude: location.lng },
|
|
243
252
|
{
|
|
244
|
-
latitude:
|
|
245
|
-
longitude:
|
|
253
|
+
latitude: parsedInitialPosition.latitude,
|
|
254
|
+
longitude: parsedInitialPosition.longitude,
|
|
246
255
|
},
|
|
247
256
|
],
|
|
248
257
|
{
|
|
@@ -255,7 +264,7 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
255
264
|
|
|
256
265
|
useEffect(() => {
|
|
257
266
|
const interval = setInterval(() => {
|
|
258
|
-
if (
|
|
267
|
+
if (parsedInitialPosition.latitude !== 0 && autoFit.current) {
|
|
259
268
|
if (mapRef.current) {
|
|
260
269
|
fitCoordinates();
|
|
261
270
|
autoFit.current = false;
|
|
@@ -263,7 +272,7 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
263
272
|
}
|
|
264
273
|
}, 1000);
|
|
265
274
|
return () => clearInterval(interval);
|
|
266
|
-
}, [
|
|
275
|
+
}, [parsedInitialPosition]);
|
|
267
276
|
|
|
268
277
|
const fitCoordinatesZoom = () => {
|
|
269
278
|
following.current = false;
|
|
@@ -346,8 +355,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
346
355
|
ref={mapRef}
|
|
347
356
|
provider={PROVIDER_GOOGLE}
|
|
348
357
|
initialRegion={{
|
|
349
|
-
latitude:
|
|
350
|
-
longitude:
|
|
358
|
+
latitude: parsedInitialPosition.latitude,
|
|
359
|
+
longitude: parsedInitialPosition.longitude,
|
|
351
360
|
latitudeDelta: 0.001,
|
|
352
361
|
longitudeDelta: 0.001 * ASPECT_RATIO,
|
|
353
362
|
}}
|
|
@@ -369,8 +378,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
369
378
|
<>
|
|
370
379
|
<Marker
|
|
371
380
|
coordinate={{
|
|
372
|
-
latitude:
|
|
373
|
-
longitude:
|
|
381
|
+
latitude: destination.latitude,
|
|
382
|
+
longitude: destination.longitude
|
|
374
383
|
}}
|
|
375
384
|
title={location.title}>
|
|
376
385
|
<Icon
|
|
@@ -381,13 +390,16 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
381
390
|
<View style={styles.view}>
|
|
382
391
|
<OIcon
|
|
383
392
|
style={styles.image}
|
|
384
|
-
|
|
393
|
+
src={typeof location.icon === 'number' ? location.icon : { uri: location.icon }}
|
|
385
394
|
width={25}
|
|
386
395
|
height={25}
|
|
387
396
|
/>
|
|
388
397
|
</View>
|
|
389
398
|
</Marker>
|
|
390
|
-
<Marker coordinate={
|
|
399
|
+
<Marker coordinate={{
|
|
400
|
+
latitude: parsedUserLocation.latitude,
|
|
401
|
+
longitude: parsedUserLocation.longitude
|
|
402
|
+
}}>
|
|
391
403
|
<View style={styles.driverIcon}>
|
|
392
404
|
<OIcon
|
|
393
405
|
style={styles.image}
|
|
@@ -401,8 +413,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
401
413
|
) : (
|
|
402
414
|
<Marker
|
|
403
415
|
coordinate={{
|
|
404
|
-
latitude:
|
|
405
|
-
longitude:
|
|
416
|
+
latitude: parsedUserLocation.latitude,
|
|
417
|
+
longitude: parsedUserLocation.longitude
|
|
406
418
|
}}
|
|
407
419
|
title={markerTitle || t('YOUR_LOCATION', 'Your Location')}
|
|
408
420
|
/>
|
|
@@ -516,8 +528,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
516
528
|
options={{
|
|
517
529
|
latitude: destination.latitude,
|
|
518
530
|
longitude: destination.longitude,
|
|
519
|
-
sourceLatitude:
|
|
520
|
-
sourceLongitude:
|
|
531
|
+
sourceLatitude: parsedUserLocation.latitude,
|
|
532
|
+
sourceLongitude: parsedUserLocation.longitude,
|
|
521
533
|
naverCallerName: 'com.deliveryapp',
|
|
522
534
|
dialogTitle: t('SHOW_IN_OTHER_MAPS', 'Show in other maps'),
|
|
523
535
|
dialogMessage: t('WHAT_APP_WOULD_YOU_USE', 'What app would you like to use?'),
|
|
@@ -539,8 +551,9 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
539
551
|
secondButton={true}
|
|
540
552
|
firstColorCustom={theme.colors.red}
|
|
541
553
|
secondColorCustom={theme.colors.green}
|
|
542
|
-
widthButton={'45%'}
|
|
554
|
+
widthButton={isHideRejectButtons ? '100%' : '45%'}
|
|
543
555
|
isPadding
|
|
556
|
+
isHideRejectButtons={isHideRejectButtons}
|
|
544
557
|
/>
|
|
545
558
|
)}
|
|
546
559
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
2
|
import { RefreshControl, ScrollView, View } from 'react-native'
|
|
3
3
|
import { OText } from '../shared'
|
|
4
|
-
import { useLanguage, useSession } from 'ordering-components/native'
|
|
4
|
+
import { useLanguage, useSession, useUtils } from 'ordering-components/native'
|
|
5
5
|
import { DayContainer } from './styles'
|
|
6
6
|
import { useTheme } from 'styled-components/native'
|
|
7
7
|
export const DriverSchedule = (props: any) => {
|
|
@@ -9,7 +9,9 @@ export const DriverSchedule = (props: any) => {
|
|
|
9
9
|
const [, t] = useLanguage()
|
|
10
10
|
const theme = useTheme()
|
|
11
11
|
const [, { refreshUserInfo }] = useSession()
|
|
12
|
+
const [{ parseDate }] = useUtils()
|
|
12
13
|
const [refreshing] = useState(false);
|
|
14
|
+
const [driverSchedule, setDriverSchedule] = useState([]);
|
|
13
15
|
|
|
14
16
|
const daysOfWeek = [
|
|
15
17
|
t('SUNDAY_ABBREVIATION', 'Sun'),
|
|
@@ -21,11 +23,43 @@ export const DriverSchedule = (props: any) => {
|
|
|
21
23
|
t('SATURDAY_ABBREVIATION', 'Sat')
|
|
22
24
|
]
|
|
23
25
|
|
|
26
|
+
const getNextDate = (day) => {
|
|
27
|
+
const now = new Date()
|
|
28
|
+
now.setDate(now.getDate() + (day + (7 - now.getDay())) % 7)
|
|
29
|
+
return now
|
|
30
|
+
}
|
|
31
|
+
|
|
24
32
|
const scheduleFormatted = ({ hour, minute }: any) => {
|
|
25
33
|
const checkTime = (val: number) => val < 10 ? `0${val}` : val
|
|
26
34
|
return `${checkTime(hour)}:${checkTime(minute)}`
|
|
27
35
|
}
|
|
28
36
|
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (schedule) {
|
|
39
|
+
setDriverSchedule(schedule)
|
|
40
|
+
} else {
|
|
41
|
+
const _schedule: any = []
|
|
42
|
+
for (let i = 0; i < 7; i++) {
|
|
43
|
+
_schedule.push({
|
|
44
|
+
enabled: true,
|
|
45
|
+
lapses: [
|
|
46
|
+
{
|
|
47
|
+
open: {
|
|
48
|
+
hour: 0,
|
|
49
|
+
minute: 0
|
|
50
|
+
},
|
|
51
|
+
close: {
|
|
52
|
+
hour: 23,
|
|
53
|
+
minute: 59
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
})
|
|
58
|
+
}
|
|
59
|
+
setDriverSchedule(_schedule)
|
|
60
|
+
}
|
|
61
|
+
}, [schedule])
|
|
62
|
+
|
|
29
63
|
return (
|
|
30
64
|
<ScrollView
|
|
31
65
|
refreshControl={<RefreshControl
|
|
@@ -37,22 +71,25 @@ export const DriverSchedule = (props: any) => {
|
|
|
37
71
|
{t('SCHEDULE', 'Schedule')}
|
|
38
72
|
</OText>
|
|
39
73
|
<View style={{ padding: 30 }}>
|
|
40
|
-
{
|
|
74
|
+
{driverSchedule.map((item: any, i: number) => (
|
|
41
75
|
<DayContainer key={daysOfWeek[i]}>
|
|
42
|
-
<
|
|
43
|
-
|
|
76
|
+
<View style={{ flex: 1 }}>
|
|
77
|
+
<OText size={22} weight={700}>{daysOfWeek[i]}</OText>
|
|
78
|
+
<OText size={14}>{parseDate(getNextDate(i), { outputFormat: 'YYYY-MM-DD' })}</OText>
|
|
79
|
+
</View>
|
|
80
|
+
<View style={{ flex: 1 }}>
|
|
44
81
|
<>
|
|
45
82
|
{item?.enabled ? (
|
|
46
|
-
<View>
|
|
83
|
+
<View style={{ width: '100%' }}>
|
|
47
84
|
{item?.lapses.map((lapse: any, i: number) => (
|
|
48
85
|
<View key={`${daysOfWeek[i]}_${i}`} style={{ marginTop: 3, marginBottom: 20, flexDirection: 'row', justifyContent: 'space-between' }}>
|
|
49
|
-
<OText size={18} style={{
|
|
86
|
+
<OText size={18} style={{ flex: 1 }}>
|
|
50
87
|
{scheduleFormatted(lapse.open)}
|
|
51
88
|
</OText>
|
|
52
89
|
<OText size={18} style={{ width: 15 }}>
|
|
53
90
|
-
|
|
54
91
|
</OText>
|
|
55
|
-
<OText size={18} style={{
|
|
92
|
+
<OText size={18} style={{ flex: 1, textAlign: 'right' }}>
|
|
56
93
|
{scheduleFormatted(lapse.close)}
|
|
57
94
|
</OText>
|
|
58
95
|
</View>
|
|
@@ -25,6 +25,7 @@ const FloatingButtonUI = (props: FloatingButtonParams) => {
|
|
|
25
25
|
secondButton,
|
|
26
26
|
widthButton,
|
|
27
27
|
isPadding,
|
|
28
|
+
isHideRejectButtons
|
|
28
29
|
} = props;
|
|
29
30
|
|
|
30
31
|
const theme = useTheme();
|
|
@@ -61,39 +62,41 @@ const FloatingButtonUI = (props: FloatingButtonParams) => {
|
|
|
61
62
|
width: '100%',
|
|
62
63
|
justifyContent: 'space-between',
|
|
63
64
|
}}>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
{
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
{
|
|
83
|
-
|
|
65
|
+
{!isHideRejectButtons && (
|
|
66
|
+
<Button
|
|
67
|
+
secondButton={secondButton}
|
|
68
|
+
style={[
|
|
69
|
+
{
|
|
70
|
+
borderWidth: colorTxt1 ? 1 : 0,
|
|
71
|
+
borderColor: colorTxt1 ? colorTxt1 : null,
|
|
72
|
+
},
|
|
73
|
+
secondButton
|
|
74
|
+
? { backgroundColor: firstColorCustom || styles.primaryBtn }
|
|
75
|
+
: color
|
|
76
|
+
? { backgroundColor: color }
|
|
77
|
+
: styles.primaryBtn,
|
|
78
|
+
,
|
|
79
|
+
{ width: widthButton },
|
|
80
|
+
]}
|
|
81
|
+
onPress={firstButtonClick}
|
|
82
|
+
disabled={disabled}>
|
|
83
|
+
<OText color={theme.colors.white} size={16} mLeft={20}>
|
|
84
|
+
{btnLeftValueShow ? btnLeftValue : ''}
|
|
85
|
+
</OText>
|
|
84
86
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
<OText
|
|
88
|
+
style={styles.btnTextStyle}
|
|
89
|
+
color={colorTxt1 ? colorTxt1 : theme.colors.white}
|
|
90
|
+
numberOfLines={2}
|
|
91
|
+
adjustsFontSizeToFit>
|
|
92
|
+
{btnText}
|
|
93
|
+
</OText>
|
|
92
94
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
<OText color={theme.colors.white} size={16} mRight={20}>
|
|
96
|
+
{btnRightValueShow ? btnRightValue : ''}
|
|
97
|
+
</OText>
|
|
98
|
+
</Button>
|
|
99
|
+
)}
|
|
97
100
|
|
|
98
101
|
{secondButton && (
|
|
99
102
|
<Button
|
|
@@ -50,12 +50,16 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
50
50
|
const ASPECT_RATIO = width / height;
|
|
51
51
|
const [isMapReady, setIsMapReady] = useState(false);
|
|
52
52
|
const [markerPosition, setMarkerPosition] = useState({
|
|
53
|
-
latitude: locations
|
|
54
|
-
|
|
53
|
+
latitude: locations
|
|
54
|
+
? typeof locations[locations.length - 1].lat === 'string' ? parseFloat(locations[locations.length - 1].lat) || 0 : locations[locations.length - 1].lat || 0
|
|
55
|
+
: typeof location?.lat === 'string' ? parseFloat(location?.lat) || 0 : location?.lat || 0,
|
|
56
|
+
longitude: locations
|
|
57
|
+
? typeof locations[locations.length - 1].lng === 'string' ? parseFloat(locations[locations.length - 1].lng) || 0 : locations[locations.length - 1].lng || 0
|
|
58
|
+
: typeof location?.lng === 'string' ? parseFloat(location?.lng) || 0 : location?.lng || 0,
|
|
55
59
|
});
|
|
56
60
|
const [region, setRegion] = useState({
|
|
57
|
-
latitude: location
|
|
58
|
-
longitude: location
|
|
61
|
+
latitude: typeof location?.lat === 'string' ? parseFloat(location?.lat) || 0 : location?.lat || 0,
|
|
62
|
+
longitude: typeof location?.lng === 'string' ? parseFloat(location?.lng) || 0 : location?.lng || 0,
|
|
59
63
|
latitudeDelta: 0.001,
|
|
60
64
|
longitudeDelta: 0.001 * ASPECT_RATIO,
|
|
61
65
|
});
|
|
@@ -78,12 +82,15 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
78
82
|
let MARKERS =
|
|
79
83
|
locations &&
|
|
80
84
|
locations.map((location: { lat: number; lng: number; level: number }) => {
|
|
81
|
-
return location.level === 4 && driverLocation?.lat
|
|
85
|
+
return location.level === 4 && driverLocation?.lat && driverLocation?.lng
|
|
82
86
|
? {
|
|
83
|
-
latitude: driverLocation?.lat,
|
|
84
|
-
longitude: driverLocation?.lng,
|
|
87
|
+
latitude: typeof driverLocation?.lat === 'string' ? parseFloat(driverLocation?.lat) || 0 : driverLocation?.lat,
|
|
88
|
+
longitude: typeof driverLocation?.lng === 'string' ? parseFloat(driverLocation?.lng) || 0 : driverLocation?.lng,
|
|
85
89
|
}
|
|
86
|
-
: {
|
|
90
|
+
: {
|
|
91
|
+
latitude: typeof location?.lat === 'string' ? parseFloat(location?.lat) || 0 : location?.lat,
|
|
92
|
+
longitude: typeof location?.lng === 'string' ? parseFloat(location?.lng) || 0 : location?.lng
|
|
93
|
+
};
|
|
87
94
|
});
|
|
88
95
|
|
|
89
96
|
const handleArrowBack: any = () => {
|
|
@@ -138,7 +138,10 @@ export const Home = (props: any) => {
|
|
|
138
138
|
placeholder={t('PROJECT_NAME', 'Project Name')}
|
|
139
139
|
icon={theme.images.general.project}
|
|
140
140
|
iconColor={theme.colors.arrowColor}
|
|
141
|
-
onChange={(e: any) =>
|
|
141
|
+
onChange={(e: any) => {
|
|
142
|
+
const project = e?.target?.value?.replace(/\s/g, '')
|
|
143
|
+
onChange(project)
|
|
144
|
+
}}
|
|
142
145
|
selectionColor={theme.colors.primary}
|
|
143
146
|
color={theme.colors.white}
|
|
144
147
|
value={value}
|
|
@@ -148,6 +151,7 @@ export const Home = (props: any) => {
|
|
|
148
151
|
autoCapitalize='none'
|
|
149
152
|
blurOnSubmit={false}
|
|
150
153
|
onSubmitEditing={() => handleSubmit(onSubmit)()}
|
|
154
|
+
isValueSync
|
|
151
155
|
/>
|
|
152
156
|
)}
|
|
153
157
|
/>
|
|
@@ -25,8 +25,7 @@ const LanguageSelectorUI = (props: LanguageSelectorParams) => {
|
|
|
25
25
|
value: language?.code,
|
|
26
26
|
label: language?.name,
|
|
27
27
|
inputLabel: language?.code.toUpperCase(),
|
|
28
|
-
countryCode: langCountries.find(item => item.value == language?.code)
|
|
29
|
-
?.countryCode,
|
|
28
|
+
countryCode: langCountries.find(item => item.value == language?.code)?.countryCode,
|
|
30
29
|
};
|
|
31
30
|
});
|
|
32
31
|
|