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
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { useLanguage, GiftCardOrdersList as GiftCardOrdersListController } from 'ordering-components/native';
|
|
3
|
+
import { useTheme } from 'styled-components/native';
|
|
4
|
+
import {
|
|
5
|
+
Placeholder,
|
|
6
|
+
PlaceholderLine,
|
|
7
|
+
Fade
|
|
8
|
+
} from 'rn-placeholder';
|
|
9
|
+
import { SingleGiftCard } from '../SingleGiftCard';
|
|
10
|
+
import { OButton, OText } from '../../shared';
|
|
11
|
+
import {
|
|
12
|
+
ProductsListContainer,
|
|
13
|
+
SingleGiftCardWrapper,
|
|
14
|
+
WrappButton
|
|
15
|
+
} from './styles'
|
|
16
|
+
|
|
17
|
+
const VerticalGiftCardOrdersLayoutUI = (props: any) => {
|
|
18
|
+
const {
|
|
19
|
+
giftCards,
|
|
20
|
+
paginationProps,
|
|
21
|
+
loadMoreOrders,
|
|
22
|
+
title,
|
|
23
|
+
setIsEmpty,
|
|
24
|
+
onNavigationRedirect
|
|
25
|
+
} = props
|
|
26
|
+
|
|
27
|
+
const theme = useTheme();
|
|
28
|
+
const [, t] = useLanguage()
|
|
29
|
+
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (giftCards.loading) return
|
|
32
|
+
if (giftCards.list?.length === 0) setIsEmpty(true)
|
|
33
|
+
}, [giftCards])
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<ProductsListContainer>
|
|
37
|
+
{
|
|
38
|
+
giftCards.loading ? (
|
|
39
|
+
<Placeholder Animation={Fade} style={{ marginVertical: 16 }}>
|
|
40
|
+
<PlaceholderLine width={30} height={16} />
|
|
41
|
+
</Placeholder>
|
|
42
|
+
) : giftCards.list?.length > 0 && (
|
|
43
|
+
<OText size={16} lineHeight={24} weight={'500'} color={theme.colors.textNormal} mBottom={24} style={{ marginTop: 24 }}>{title}</OText>
|
|
44
|
+
)}
|
|
45
|
+
{giftCards.list.map(card => (
|
|
46
|
+
<SingleGiftCardWrapper key={card.id}>
|
|
47
|
+
<SingleGiftCard
|
|
48
|
+
card={card}
|
|
49
|
+
onNavigationRedirect={onNavigationRedirect}
|
|
50
|
+
/>
|
|
51
|
+
</SingleGiftCardWrapper>
|
|
52
|
+
))}
|
|
53
|
+
{giftCards.loading && (
|
|
54
|
+
[...Array(10).keys()].map(i => (
|
|
55
|
+
<SingleGiftCardWrapper key={i}>
|
|
56
|
+
<SingleGiftCard
|
|
57
|
+
isSkeleton
|
|
58
|
+
/>
|
|
59
|
+
</SingleGiftCardWrapper>
|
|
60
|
+
))
|
|
61
|
+
)}
|
|
62
|
+
{paginationProps.totalPages && paginationProps.currentPage < paginationProps.totalPages && (
|
|
63
|
+
<WrappButton>
|
|
64
|
+
<OButton
|
|
65
|
+
onClick={loadMoreOrders}
|
|
66
|
+
text={t('LOAD_MORE_ORDERS', 'Load more orders')}
|
|
67
|
+
imgRightSrc={null}
|
|
68
|
+
textStyle={{ color: theme.colors.white }}
|
|
69
|
+
style={{ borderRadius: 7.6, shadowOpacity: 0 }}
|
|
70
|
+
/>
|
|
71
|
+
</WrappButton>
|
|
72
|
+
)}
|
|
73
|
+
</ProductsListContainer>
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export const VerticalGiftCardOrdersLayout = (props: any) => {
|
|
78
|
+
const giftCardsProps = {
|
|
79
|
+
...props,
|
|
80
|
+
UIComponent: VerticalGiftCardOrdersLayoutUI
|
|
81
|
+
}
|
|
82
|
+
return <GiftCardOrdersListController {...giftCardsProps} />
|
|
83
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef } from 'react'
|
|
2
2
|
import { Dimensions, StyleSheet, View, Platform } from 'react-native';
|
|
3
|
-
import MapView, { PROVIDER_DEFAULT, PROVIDER_GOOGLE, Marker, Region, } from 'react-native-maps'
|
|
3
|
+
import MapView, { PROVIDER_DEFAULT, PROVIDER_GOOGLE, Marker, Region, Polygon, Circle } from 'react-native-maps'
|
|
4
4
|
import Geocoder from 'react-native-geocoding';
|
|
5
5
|
import { useLanguage, useConfig } from 'ordering-components/native'
|
|
6
6
|
import { GoogleMapsParams } from '../../types';
|
|
@@ -18,7 +18,10 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
18
18
|
saveLocation,
|
|
19
19
|
setSaveLocation,
|
|
20
20
|
handleToggleMap,
|
|
21
|
-
locations
|
|
21
|
+
locations,
|
|
22
|
+
isIntGeoCoder,
|
|
23
|
+
businessZones,
|
|
24
|
+
delta
|
|
22
25
|
} = props
|
|
23
26
|
|
|
24
27
|
const [, t] = useLanguage()
|
|
@@ -29,8 +32,8 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
29
32
|
const [region, setRegion] = useState({
|
|
30
33
|
latitude: location.lat,
|
|
31
34
|
longitude: location.lng,
|
|
32
|
-
latitudeDelta: 0.0010,
|
|
33
|
-
longitudeDelta: 0.0010 * ASPECT_RATIO
|
|
35
|
+
latitudeDelta: delta ?? 0.0010,
|
|
36
|
+
longitudeDelta: (delta ?? 0.0010) * ASPECT_RATIO
|
|
34
37
|
})
|
|
35
38
|
const [MARKERS, SETMARKERS] = useState(locations)
|
|
36
39
|
let mapRef = useRef<any>(null)
|
|
@@ -43,6 +46,19 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
43
46
|
ERROR_MAX_LIMIT_LOCATION: `Sorry, You can only set the position to ${maxLimitLocation}m`
|
|
44
47
|
}
|
|
45
48
|
|
|
49
|
+
const units: any = {
|
|
50
|
+
mi: 1609,
|
|
51
|
+
km: 1000
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const types: any = [1, 2, 5]
|
|
55
|
+
|
|
56
|
+
const fillStyles = {
|
|
57
|
+
fillColor: 'rgba(44, 123, 229, 0.3)',
|
|
58
|
+
strokeColor: 'rgba(44, 123, 229, 1)',
|
|
59
|
+
strokeWidth: 2
|
|
60
|
+
}
|
|
61
|
+
|
|
46
62
|
const geocodePosition = (pos: { latitude: number, longitude: number }, isMovingRegion ?: boolean) => {
|
|
47
63
|
Geocoder.from({
|
|
48
64
|
latitude: pos.latitude,
|
|
@@ -161,8 +177,9 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
161
177
|
}
|
|
162
178
|
|
|
163
179
|
useEffect(() => {
|
|
180
|
+
if (isIntGeoCoder) return
|
|
164
181
|
Geocoder.init(googleMapsApiKey)
|
|
165
|
-
}, [])
|
|
182
|
+
}, [isIntGeoCoder])
|
|
166
183
|
|
|
167
184
|
useEffect(() => {
|
|
168
185
|
mapRef.current.animateToRegion({
|
|
@@ -228,6 +245,36 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
228
245
|
title={markerTitle || t('YOUR_LOCATION', 'Your Location')}
|
|
229
246
|
/>
|
|
230
247
|
)}
|
|
248
|
+
{businessZones?.length > 0 && businessZones.filter((item: any) => types.includes(item?.type)).map((businessZone: any, i: number) => (
|
|
249
|
+
<React.Fragment key={i}>
|
|
250
|
+
{businessZone?.type === 2 && Array.isArray(businessZone?.data) && (
|
|
251
|
+
<Polygon
|
|
252
|
+
coordinates={businessZone?.data.map((item: any) => ({ latitude: item.lat, longitude: item.lng}))}
|
|
253
|
+
fillColor={fillStyles.fillColor}
|
|
254
|
+
strokeColor={fillStyles.strokeColor}
|
|
255
|
+
strokeWidth={fillStyles.strokeWidth}
|
|
256
|
+
/>
|
|
257
|
+
)}
|
|
258
|
+
{(businessZone.type === 1 && businessZone?.data?.center && businessZone?.data?.radio) && (
|
|
259
|
+
<Circle
|
|
260
|
+
center={{ latitude: businessZone?.data?.center.lat, longitude: businessZone?.data?.center.lng}}
|
|
261
|
+
radius={businessZone?.data.radio * 1000}
|
|
262
|
+
fillColor={fillStyles.fillColor}
|
|
263
|
+
strokeColor={fillStyles.strokeColor}
|
|
264
|
+
strokeWidth={fillStyles.strokeWidth}
|
|
265
|
+
/>
|
|
266
|
+
)}
|
|
267
|
+
{(businessZone.type === 5 && businessZone?.data?.distance) && (
|
|
268
|
+
<Circle
|
|
269
|
+
center={{ latitude: center.lat, longitude: center.lng}}
|
|
270
|
+
radius={businessZone?.data.distance * units[businessZone?.data?.unit]}
|
|
271
|
+
fillColor={fillStyles.fillColor}
|
|
272
|
+
strokeColor={fillStyles.strokeColor}
|
|
273
|
+
strokeWidth={fillStyles.strokeWidth}
|
|
274
|
+
/>
|
|
275
|
+
)}
|
|
276
|
+
</React.Fragment>
|
|
277
|
+
))}
|
|
231
278
|
</MapView>
|
|
232
279
|
<Alert
|
|
233
280
|
open={alertState.open}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
|
+
import { useTheme } from 'styled-components/native';
|
|
2
3
|
import { Platform, RefreshControl } from 'react-native'
|
|
3
4
|
import { HelpParams } from '../../types'
|
|
4
5
|
import { useLanguage } from 'ordering-components/native'
|
|
@@ -17,6 +18,7 @@ export const Help = (props: HelpParams) => {
|
|
|
17
18
|
navigation
|
|
18
19
|
} = props
|
|
19
20
|
const [, t] = useLanguage()
|
|
21
|
+
const theme = useTheme()
|
|
20
22
|
const [refreshing] = useState(false);
|
|
21
23
|
const [refresh, setRefresh] = useState(false)
|
|
22
24
|
|
|
@@ -46,6 +48,11 @@ export const Help = (props: HelpParams) => {
|
|
|
46
48
|
onActionLeft={goToBack}
|
|
47
49
|
showCall={false}
|
|
48
50
|
btnStyle={{ paddingLeft: 0 }}
|
|
51
|
+
buttonProps={{
|
|
52
|
+
bgColor: theme.colors.white,
|
|
53
|
+
borderColor: theme.colors.white,
|
|
54
|
+
textStyle: { color: theme.colors.btnFont }
|
|
55
|
+
}}
|
|
49
56
|
/>
|
|
50
57
|
<HelpSubItem
|
|
51
58
|
onPress={() => onRedirect('HelpOrder')}
|
|
@@ -37,6 +37,11 @@ export const HelpAccountAndPayment = (props: HelpAccountAndPaymentParams) => {
|
|
|
37
37
|
onActionLeft={goToBack}
|
|
38
38
|
btnStyle={{ paddingLeft: 0 }}
|
|
39
39
|
showCall={false}
|
|
40
|
+
buttonProps={{
|
|
41
|
+
bgColor: theme.colors.white,
|
|
42
|
+
borderColor: theme.colors.white,
|
|
43
|
+
textStyle: { color: theme.colors.btnFont }
|
|
44
|
+
}}
|
|
40
45
|
/>
|
|
41
46
|
<Content>
|
|
42
47
|
<OText mBottom={20}>
|
|
@@ -43,6 +43,11 @@ export const HelpGuide = (props: HelpGuideParams) => {
|
|
|
43
43
|
onActionLeft={goToBack}
|
|
44
44
|
btnStyle={{ paddingLeft: 0 }}
|
|
45
45
|
showCall={false}
|
|
46
|
+
buttonProps={{
|
|
47
|
+
bgColor: theme.colors.white,
|
|
48
|
+
borderColor: theme.colors.white,
|
|
49
|
+
textStyle: { color: theme.colors.btnFont }
|
|
50
|
+
}}
|
|
46
51
|
/>
|
|
47
52
|
<Content>
|
|
48
53
|
<OText mBottom={15}>
|
|
@@ -39,6 +39,11 @@ export const HelpOrder = (props: HelpOrderParams) => {
|
|
|
39
39
|
onActionLeft={goToBack}
|
|
40
40
|
btnStyle={{ paddingLeft: 0 }}
|
|
41
41
|
showCall={false}
|
|
42
|
+
buttonProps={{
|
|
43
|
+
bgColor: theme.colors.white,
|
|
44
|
+
borderColor: theme.colors.white,
|
|
45
|
+
textStyle: { color: theme.colors.btnFont }
|
|
46
|
+
}}
|
|
42
47
|
/>
|
|
43
48
|
<Content>
|
|
44
49
|
<OText mBottom={20}>
|
|
@@ -56,7 +56,7 @@ const HighestRatedBusinessesUI = (props: HighestRatedBusinessesParams) => {
|
|
|
56
56
|
showsHorizontalScrollIndicator={false}
|
|
57
57
|
nestedScrollEnabled
|
|
58
58
|
horizontal
|
|
59
|
-
style={{ height:
|
|
59
|
+
style={{ height: 325, paddingHorizontal: 20 }}
|
|
60
60
|
>
|
|
61
61
|
{[
|
|
62
62
|
...Array(10).keys()
|
|
@@ -27,7 +27,7 @@ export const Home = (props: any) => {
|
|
|
27
27
|
return (
|
|
28
28
|
<View style={styles.container}>
|
|
29
29
|
<View>
|
|
30
|
-
<View style={{paddingTop: (height <= 756 && Platform.OS !== 'ios') ? (height * 0.05) : 0 }}>
|
|
30
|
+
<View style={{ paddingTop: (height <= 756 && Platform.OS !== 'ios') ? (height * 0.05) : 0 }}>
|
|
31
31
|
<LanguageSelector />
|
|
32
32
|
</View>
|
|
33
33
|
<OIcon
|
|
@@ -62,6 +62,7 @@ export const Home = (props: any) => {
|
|
|
62
62
|
bgColor={theme.colors.primaryContrast}
|
|
63
63
|
borderColor={theme.colors.primaryContrast}
|
|
64
64
|
style={styles.buttons}
|
|
65
|
+
textStyle={{ color: 'black' }}
|
|
65
66
|
onClick={() => onNavigationRedirect('Signup')}
|
|
66
67
|
imgRightSrc={null}
|
|
67
68
|
/>
|
|
@@ -92,7 +93,7 @@ const styles = StyleSheet.create({
|
|
|
92
93
|
flex: 1,
|
|
93
94
|
alignItems: 'center',
|
|
94
95
|
justifyContent: 'space-between',
|
|
95
|
-
paddingHorizontal:
|
|
96
|
+
paddingHorizontal: 20,
|
|
96
97
|
},
|
|
97
98
|
logo: {
|
|
98
99
|
marginTop: 64,
|
|
@@ -1,22 +1,27 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react'
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react'
|
|
2
2
|
import { formatSeconds } from '../../../utils'
|
|
3
|
-
import { StyleSheet, TouchableOpacity } from 'react-native';
|
|
3
|
+
import { StyleSheet, TouchableOpacity, View, SafeAreaView } from 'react-native';
|
|
4
4
|
import { useCountdownTimer } from '../../../../../../src/hooks/useCountdownTimer';
|
|
5
5
|
import { useLanguage } from 'ordering-components/native';
|
|
6
6
|
import { OTPContainer } from './styles';
|
|
7
|
-
import { OText, OButton } from '../../shared';
|
|
8
|
-
import OtpInputs from 'react-native-otp-inputs';
|
|
7
|
+
import { OText, OButton, OIcon } from '../../shared';
|
|
8
|
+
import OtpInputs, { OtpInputsRef } from 'react-native-otp-inputs';
|
|
9
9
|
import { useTheme } from 'styled-components/native';
|
|
10
10
|
import { otpParams } from '../../../types'
|
|
11
|
+
import { ActivityIndicator } from 'react-native';
|
|
11
12
|
|
|
12
13
|
export const Otp = (props: otpParams) => {
|
|
13
14
|
const {
|
|
15
|
+
pinCount,
|
|
16
|
+
otpError,
|
|
17
|
+
setOtpError,
|
|
18
|
+
setAlertState,
|
|
14
19
|
willVerifyOtpState,
|
|
20
|
+
isCheckingCode,
|
|
21
|
+
setCheckingCode,
|
|
15
22
|
setWillVerifyOtpState,
|
|
16
|
-
onSubmit,
|
|
17
23
|
handleLoginOtp,
|
|
18
|
-
|
|
19
|
-
pinCount
|
|
24
|
+
onSubmit,
|
|
20
25
|
} = props
|
|
21
26
|
|
|
22
27
|
const theme = useTheme();
|
|
@@ -24,8 +29,7 @@ export const Otp = (props: otpParams) => {
|
|
|
24
29
|
const [otpLeftTime, _, resetOtpLeftTime]: any = useCountdownTimer(
|
|
25
30
|
600, willVerifyOtpState)
|
|
26
31
|
|
|
27
|
-
const
|
|
28
|
-
|
|
32
|
+
const inputRef = useRef<OtpInputsRef | any>(null)
|
|
29
33
|
|
|
30
34
|
const handleOnSubmit = () => {
|
|
31
35
|
setAlertState({
|
|
@@ -36,6 +40,21 @@ export const Otp = (props: otpParams) => {
|
|
|
36
40
|
onSubmit()
|
|
37
41
|
}
|
|
38
42
|
|
|
43
|
+
const handleChangeCode = (code: string) => {
|
|
44
|
+
if (code?.length === pinCount) {
|
|
45
|
+
setCheckingCode && setCheckingCode(true)
|
|
46
|
+
handleLoginOtp(code)
|
|
47
|
+
inputRef.current?.reset && inputRef.current.reset()
|
|
48
|
+
setTimeout(() => inputRef.current?.focus && inputRef.current.focus(), 100)
|
|
49
|
+
}
|
|
50
|
+
setOtpError && setOtpError(null)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const handleCloseOtp = () => {
|
|
54
|
+
setWillVerifyOtpState(false)
|
|
55
|
+
setOtpError && setOtpError(null)
|
|
56
|
+
}
|
|
57
|
+
|
|
39
58
|
useEffect(() => {
|
|
40
59
|
if (otpLeftTime === 0) {
|
|
41
60
|
setAlertState({
|
|
@@ -46,12 +65,6 @@ export const Otp = (props: otpParams) => {
|
|
|
46
65
|
}
|
|
47
66
|
}, [otpLeftTime])
|
|
48
67
|
|
|
49
|
-
useEffect(() => {
|
|
50
|
-
if (code?.length === (pinCount || 6)) {
|
|
51
|
-
handleLoginOtp(code)
|
|
52
|
-
}
|
|
53
|
-
}, [code])
|
|
54
|
-
|
|
55
68
|
const loginStyle = StyleSheet.create({
|
|
56
69
|
container: {
|
|
57
70
|
width: '100%',
|
|
@@ -73,28 +86,65 @@ export const Otp = (props: otpParams) => {
|
|
|
73
86
|
color: theme.colors.primary,
|
|
74
87
|
fontSize: 16
|
|
75
88
|
},
|
|
89
|
+
wrapperIcon: {
|
|
90
|
+
alignItems: 'center',
|
|
91
|
+
justifyContent: 'center',
|
|
92
|
+
paddingRight: 20
|
|
93
|
+
},
|
|
94
|
+
closeContainer: {
|
|
95
|
+
width: '100%',
|
|
96
|
+
flexDirection: 'row',
|
|
97
|
+
alignItems: 'center'
|
|
98
|
+
},
|
|
99
|
+
checkingCode: {
|
|
100
|
+
height: 50,
|
|
101
|
+
width: '100%',
|
|
102
|
+
marginVertical: 30,
|
|
103
|
+
justifyContent: 'center',
|
|
104
|
+
alignItems: 'center'
|
|
105
|
+
}
|
|
76
106
|
});
|
|
77
107
|
|
|
78
108
|
return (
|
|
79
|
-
|
|
109
|
+
<SafeAreaView style={{ flex: 1, backgroundColor: theme.colors.backgroundPage }}>
|
|
80
110
|
<OTPContainer>
|
|
81
111
|
<OText size={24}>
|
|
82
112
|
{formatSeconds(otpLeftTime)}
|
|
83
113
|
</OText>
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
114
|
+
{isCheckingCode && (
|
|
115
|
+
<View style={loginStyle.checkingCode}>
|
|
116
|
+
<OText size={18}>
|
|
117
|
+
<ActivityIndicator size="large" color={theme.colors.primary} />
|
|
118
|
+
</OText>
|
|
119
|
+
</View>
|
|
120
|
+
)}
|
|
121
|
+
{!isCheckingCode && (
|
|
122
|
+
<OtpInputs
|
|
123
|
+
ref={inputRef}
|
|
124
|
+
autofillFromClipboard={false}
|
|
125
|
+
numberOfInputs={pinCount}
|
|
126
|
+
style={loginStyle.container}
|
|
127
|
+
returnKeyType={'done'}
|
|
128
|
+
inputStyles={loginStyle.underlineStyleBase}
|
|
129
|
+
handleChange={handleChangeCode}
|
|
130
|
+
/>
|
|
131
|
+
)}
|
|
132
|
+
{!!otpError && (
|
|
133
|
+
<OText
|
|
134
|
+
color={theme?.colors?.error}
|
|
135
|
+
size={20}
|
|
136
|
+
mBottom={10}
|
|
137
|
+
>
|
|
138
|
+
{t(otpError, otpError)}
|
|
139
|
+
</OText>
|
|
140
|
+
)}
|
|
91
141
|
<TouchableOpacity onPress={() => handleOnSubmit()} disabled={otpLeftTime > 520}>
|
|
92
142
|
<OText size={16} mBottom={30} color={otpLeftTime > 520 ? theme.colors.disabled : theme.colors.primary}>
|
|
93
143
|
{t('RESEND_CODE', 'Resend code')}
|
|
94
144
|
</OText>
|
|
95
145
|
</TouchableOpacity>
|
|
96
146
|
<OButton
|
|
97
|
-
onClick={() =>
|
|
147
|
+
onClick={() => handleCloseOtp()}
|
|
98
148
|
bgColor={theme.colors.white}
|
|
99
149
|
borderColor={theme.colors.primary}
|
|
100
150
|
textStyle={{ color: theme.colors.primary }}
|
|
@@ -102,6 +152,10 @@ export const Otp = (props: otpParams) => {
|
|
|
102
152
|
text={t('CANCEL', 'Cancel')}
|
|
103
153
|
/>
|
|
104
154
|
</OTPContainer>
|
|
105
|
-
|
|
155
|
+
</SafeAreaView>
|
|
106
156
|
)
|
|
107
157
|
}
|
|
158
|
+
|
|
159
|
+
Otp.defaultProps = {
|
|
160
|
+
pinCount: 6
|
|
161
|
+
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React, { useEffect, useState, useRef } from 'react';
|
|
2
|
-
import { StyleSheet, View, Keyboard } from 'react-native';
|
|
2
|
+
import { StyleSheet, View, Keyboard, Modal, Platform } from 'react-native';
|
|
3
3
|
import Spinner from 'react-native-loading-spinner-overlay';
|
|
4
4
|
import { useForm, Controller } from 'react-hook-form';
|
|
5
5
|
import { PhoneInputNumber } from '../PhoneInputNumber';
|
|
6
6
|
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
|
|
7
7
|
import Recaptcha from 'react-native-recaptcha-that-works'
|
|
8
8
|
import ReCaptcha from '@fatnlazycat/react-native-recaptcha-v3'
|
|
9
|
+
import ReactNativeHapticFeedback from "react-native-haptic-feedback";
|
|
9
10
|
|
|
10
11
|
import {
|
|
11
12
|
LoginForm as LoginFormController,
|
|
@@ -45,7 +46,6 @@ import { AppleLogin } from '../AppleLogin';
|
|
|
45
46
|
import { Otp } from './Otp'
|
|
46
47
|
import { TouchableOpacity } from 'react-native-gesture-handler';
|
|
47
48
|
import Alert from '../../../../../src/providers/AlertProvider'
|
|
48
|
-
import { vibrateApp } from '../../utils';
|
|
49
49
|
|
|
50
50
|
const LoginFormUI = (props: LoginParams) => {
|
|
51
51
|
const {
|
|
@@ -97,15 +97,18 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
97
97
|
const [recaptchaVerified, setRecaptchaVerified] = useState(false)
|
|
98
98
|
const [alertState, setAlertState] = useState({ open: false, title: '', content: [] })
|
|
99
99
|
const [tabLayouts, setTabLayouts] = useState<any>({})
|
|
100
|
+
const [otpError, setOtpError] = useState(null)
|
|
100
101
|
const tabsRef = useRef<any>(null)
|
|
101
102
|
const enabledPoweredByOrdering = configs?.powered_by_ordering_module?.value
|
|
102
103
|
const theme = useTheme();
|
|
103
104
|
const isOtpEmail = loginTab === 'otp' && otpType === 'email'
|
|
104
105
|
const isOtpCellphone = loginTab === 'otp' && otpType === 'cellphone'
|
|
105
106
|
|
|
107
|
+
const [isCheckingCode, setCheckingCode] = useState(false)
|
|
108
|
+
|
|
106
109
|
const googleLoginEnabled = configs?.google_login_enabled?.value === '1' || !configs?.google_login_enabled?.enabled
|
|
107
110
|
const facebookLoginEnabled = configs?.facebook_login_enabled?.value === '1' || !configs?.facebook_login_enabled?.enabled
|
|
108
|
-
const appleLoginEnabled = configs?.apple_login_enabled?.value === '1' || !configs?.apple_login_enabled?.enabled
|
|
111
|
+
const appleLoginEnabled = Platform.OS === 'ios' && (configs?.apple_login_enabled?.value === '1' || !configs?.apple_login_enabled?.enabled)
|
|
109
112
|
|
|
110
113
|
const loginStyle = StyleSheet.create({
|
|
111
114
|
btnOutline: {
|
|
@@ -162,6 +165,14 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
162
165
|
handleCategoryScroll(otpType ? `${val}_${otpType}` : val)
|
|
163
166
|
};
|
|
164
167
|
|
|
168
|
+
const vibrateApp = (impact?: string) => {
|
|
169
|
+
const options = {
|
|
170
|
+
enableVibrateFallback: true,
|
|
171
|
+
ignoreAndroidSystemSettings: false
|
|
172
|
+
};
|
|
173
|
+
ReactNativeHapticFeedback.trigger(impact || "impactLight", options);
|
|
174
|
+
}
|
|
175
|
+
|
|
165
176
|
const onSubmit = (values?: any) => {
|
|
166
177
|
Keyboard.dismiss();
|
|
167
178
|
if (loginTab === 'otp') {
|
|
@@ -170,7 +181,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
170
181
|
vibrateApp()
|
|
171
182
|
return
|
|
172
183
|
}
|
|
173
|
-
if(
|
|
184
|
+
if (otpType === 'cellphone' && phoneInputData?.error && !phoneInputData?.phone?.cellphone) {
|
|
174
185
|
showToast(ToastType.Error, t('PHONE_NUMBER_REQUIRED', 'Phone number is required'));
|
|
175
186
|
return
|
|
176
187
|
}
|
|
@@ -256,10 +267,15 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
256
267
|
setOtpType(type)
|
|
257
268
|
}
|
|
258
269
|
|
|
259
|
-
const handleLoginOtp = (code: string) => {
|
|
270
|
+
const handleLoginOtp = async (code: string) => {
|
|
260
271
|
if (!code) return
|
|
261
|
-
handleButtonLoginClick({ code })
|
|
262
|
-
|
|
272
|
+
const logged = await handleButtonLoginClick({ code })
|
|
273
|
+
setCheckingCode(false)
|
|
274
|
+
if (logged) {
|
|
275
|
+
setWillVerifyOtpState(false)
|
|
276
|
+
} else {
|
|
277
|
+
setOtpError(t('OTP_CODE_INCORRECT', 'Otp code incorrect'))
|
|
278
|
+
}
|
|
263
279
|
}
|
|
264
280
|
|
|
265
281
|
const closeAlert = () => {
|
|
@@ -396,6 +412,11 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
396
412
|
btnStyle={{ paddingLeft: 0 }}
|
|
397
413
|
titleWrapStyle={{ paddingHorizontal: 0 }}
|
|
398
414
|
titleStyle={{ marginRight: 0, marginLeft: 0 }}
|
|
415
|
+
buttonProps={{
|
|
416
|
+
bgColor: theme.colors.white,
|
|
417
|
+
borderColor: theme.colors.white,
|
|
418
|
+
textStyle: { color: theme.colors.btnFont }
|
|
419
|
+
}}
|
|
399
420
|
/>
|
|
400
421
|
)}
|
|
401
422
|
<FormSide>
|
|
@@ -786,7 +807,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
786
807
|
handleSuccessGoogleLogin={handleSuccessFacebook}
|
|
787
808
|
/>
|
|
788
809
|
)}
|
|
789
|
-
{(configs?.apple_login_client_id?.value !== '' && configs?.
|
|
810
|
+
{(configs?.apple_login_client_id?.value !== '' && configs?.apple_login_client_id?.value !== null) && appleLoginEnabled && (
|
|
790
811
|
<AppleLogin
|
|
791
812
|
notificationState={notificationState}
|
|
792
813
|
handleErrors={(err: any) => { showToast(ToastType.Error, err), vibrateApp() }}
|
|
@@ -835,20 +856,23 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
835
856
|
onClose={() => setIsModalVisible(false)}
|
|
836
857
|
/>
|
|
837
858
|
</OModal>
|
|
838
|
-
<
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
title={t('ENTER_VERIFICATION_CODE', 'Enter verification code')}
|
|
859
|
+
<Modal
|
|
860
|
+
visible={willVerifyOtpState}
|
|
861
|
+
onDismiss={() => setWillVerifyOtpState(false)}
|
|
862
|
+
animationType='slide'
|
|
843
863
|
>
|
|
844
864
|
<Otp
|
|
865
|
+
isCheckingCode={isCheckingCode}
|
|
866
|
+
setCheckingCode={setCheckingCode}
|
|
845
867
|
willVerifyOtpState={willVerifyOtpState}
|
|
868
|
+
otpError={otpError}
|
|
869
|
+
setOtpError={setOtpError}
|
|
846
870
|
setWillVerifyOtpState={setWillVerifyOtpState}
|
|
847
871
|
handleLoginOtp={handleLoginOtp}
|
|
848
872
|
onSubmit={onSubmit}
|
|
849
873
|
setAlertState={setAlertState}
|
|
850
874
|
/>
|
|
851
|
-
</
|
|
875
|
+
</Modal>
|
|
852
876
|
<Alert
|
|
853
877
|
open={alertState.open}
|
|
854
878
|
content={alertState.content}
|
|
@@ -237,6 +237,7 @@ export const MessageListing = (props: MessageListingParams) => {
|
|
|
237
237
|
const [seletedOrder, setSeletedOrder] = useState<any>()
|
|
238
238
|
const [openMessages, setOpenMessges] = useState(false)
|
|
239
239
|
const [, t] = useLanguage()
|
|
240
|
+
const theme = useTheme()
|
|
240
241
|
|
|
241
242
|
const goToBack = () => {
|
|
242
243
|
navigation?.canGoBack() && navigation.goBack()
|
|
@@ -265,6 +266,11 @@ export const MessageListing = (props: MessageListingParams) => {
|
|
|
265
266
|
showCall={false}
|
|
266
267
|
paddingTop={Platform.OS === 'ios' ? 20 : 10}
|
|
267
268
|
btnStyle={{ paddingLeft: 0 }}
|
|
269
|
+
buttonProps={{
|
|
270
|
+
bgColor: theme.colors.white,
|
|
271
|
+
borderColor: theme.colors.white,
|
|
272
|
+
textStyle: { color: theme.colors.btnFont }
|
|
273
|
+
}}
|
|
268
274
|
/>
|
|
269
275
|
<OrderListing
|
|
270
276
|
ordersLength={{ activeOrdersLength: 0, previousOrdersLength: 0 }}
|