ordering-ui-react-native 0.17.51 → 0.17.52-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 +8 -7
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/OrderCreating/index.tsx +1 -21
- package/src/components/PaymentOptionsWebView/index.tsx +29 -8
- package/src/components/PhoneInputNumber/index.tsx +6 -2
- package/src/components/StripeMethodForm/index.tsx +136 -102
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +4 -4
- package/src/types/index.tsx +5 -0
- package/src/utils/index.tsx +5 -0
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
- package/themes/business/src/components/BusinessController/index.tsx +0 -1
- package/themes/business/src/components/Chat/index.tsx +125 -113
- package/themes/business/src/components/DriverMap/index.tsx +17 -6
- package/themes/business/src/components/DriverSchedule/index.tsx +29 -2
- package/themes/business/src/components/GoogleMap/index.tsx +58 -57
- package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
- package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/business/src/components/LoginForm/index.tsx +238 -80
- package/themes/business/src/components/LoginForm/styles.tsx +10 -0
- package/themes/business/src/components/MapView/index.tsx +10 -10
- package/themes/business/src/components/NewOrderNotification/index.tsx +35 -21
- package/themes/business/src/components/OrderDetails/Delivery.tsx +31 -5
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +93 -50
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +59 -62
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
- package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
- package/themes/business/src/components/OrderMessage/index.tsx +18 -17
- package/themes/business/src/components/OrderSummary/index.tsx +113 -121
- package/themes/business/src/components/OrdersOption/index.tsx +32 -75
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +249 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
- package/themes/business/src/components/PreviousOrders/index.tsx +445 -243
- package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
- package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
- package/themes/business/src/components/ReviewCustomer/index.tsx +29 -14
- package/themes/business/src/components/StoresList/index.tsx +2 -2
- package/themes/business/src/components/UserProfileForm/index.tsx +11 -13
- package/themes/business/src/components/shared/OLink.tsx +33 -13
- package/themes/business/src/components/shared/OModal.tsx +16 -9
- package/themes/business/src/components/shared/OText.tsx +8 -2
- package/themes/business/src/types/index.tsx +32 -2
- package/themes/business/src/utils/index.tsx +44 -1
- 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/Otp/index.tsx +92 -0
- package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/kiosk/src/components/LoginForm/index.tsx +480 -156
- package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
- 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/PhoneInputNumber/index.tsx +3 -2
- package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
- package/themes/kiosk/src/layouts/Container.tsx +7 -1
- package/themes/kiosk/src/types/index.d.ts +13 -0
- package/themes/kiosk/src/utils/index.tsx +15 -0
- package/themes/original/index.tsx +4 -0
- package/themes/original/src/components/AddressDetails/index.tsx +29 -11
- package/themes/original/src/components/AddressForm/index.tsx +79 -44
- package/themes/original/src/components/AddressList/index.tsx +27 -22
- package/themes/original/src/components/AddressList/styles.tsx +4 -2
- package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +160 -91
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +9 -7
- package/themes/original/src/components/BusinessController/index.tsx +122 -68
- package/themes/original/src/components/BusinessController/styles.tsx +23 -4
- package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
- package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
- package/themes/original/src/components/BusinessInformation/index.tsx +110 -108
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +23 -22
- package/themes/original/src/components/BusinessListingSearch/index.tsx +352 -326
- package/themes/original/src/components/BusinessPreorder/index.tsx +103 -19
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -2
- package/themes/original/src/components/BusinessProductsList/index.tsx +23 -14
- package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
- package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
- package/themes/original/src/components/BusinessProductsListing/index.tsx +668 -514
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
- package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +95 -80
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -11
- package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
- package/themes/original/src/components/Cart/index.tsx +100 -67
- package/themes/original/src/components/CartContent/index.tsx +115 -19
- package/themes/original/src/components/CartContent/styles.tsx +17 -7
- package/themes/original/src/components/Checkout/index.tsx +367 -174
- package/themes/original/src/components/Checkout/styles.tsx +4 -2
- package/themes/original/src/components/CitiesControl/index.tsx +89 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
- package/themes/original/src/components/CouponControl/index.tsx +10 -3
- package/themes/original/src/components/DriverTips/index.tsx +52 -34
- package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
- package/themes/original/src/components/Favorite/index.tsx +8 -9
- package/themes/original/src/components/Favorite/styles.tsx +1 -1
- package/themes/original/src/components/FavoriteList/index.tsx +51 -80
- package/themes/original/src/components/FloatingButton/index.tsx +1 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/index.tsx +6 -4
- package/themes/original/src/components/GPSButton/styles.ts +3 -3
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +96 -0
- package/themes/original/src/components/GiftCard/GiftCardUI/styles.tsx +5 -0
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +100 -0
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +8 -0
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +191 -0
- package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +8 -0
- package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +165 -0
- package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +9 -0
- package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
- package/themes/original/src/components/GoogleMap/index.tsx +15 -4
- package/themes/original/src/components/Help/index.tsx +8 -8
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +10 -31
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +5 -3
- package/themes/original/src/components/HelpGuide/index.tsx +6 -6
- package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
- package/themes/original/src/components/HelpOrder/index.tsx +6 -15
- package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
- package/themes/original/src/components/Home/index.tsx +13 -4
- package/themes/original/src/components/LastOrder/index.tsx +1 -34
- package/themes/original/src/components/LoginForm/Otp/index.tsx +55 -13
- package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
- package/themes/original/src/components/LoginForm/index.tsx +64 -26
- package/themes/original/src/components/LottieAnimation/index.tsx +89 -55
- package/themes/original/src/components/MessageListing/index.tsx +16 -42
- package/themes/original/src/components/Messages/index.tsx +32 -10
- package/themes/original/src/components/MomentOption/index.tsx +195 -88
- package/themes/original/src/components/MultiCart/index.tsx +50 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +151 -49
- package/themes/original/src/components/MultiCheckout/index.tsx +308 -88
- package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
- package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +68 -21
- package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
- package/themes/original/src/components/MyOrders/index.tsx +77 -52
- package/themes/original/src/components/NavBar/index.tsx +18 -18
- package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
- package/themes/original/src/components/Notifications/index.tsx +46 -50
- package/themes/original/src/components/Notifications/styles.tsx +6 -3
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +15 -3
- package/themes/original/src/components/OrderDetails/index.tsx +190 -358
- package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
- package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
- package/themes/original/src/components/OrderProgress/index.tsx +93 -114
- package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
- package/themes/original/src/components/OrderSummary/index.tsx +85 -57
- package/themes/original/src/components/OrderTypeSelector/index.tsx +1 -1
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +24 -19
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +14 -14
- package/themes/original/src/components/OrdersOption/index.tsx +76 -66
- package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
- package/themes/original/src/components/PageBanner/index.tsx +107 -40
- package/themes/original/src/components/PageBanner/styles.tsx +4 -1
- package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +64 -7
- package/themes/original/src/components/PhoneInputNumber/index.tsx +3 -3
- package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
- package/themes/original/src/components/ProductForm/index.tsx +114 -36
- package/themes/original/src/components/ProductForm/styles.tsx +5 -7
- package/themes/original/src/components/ProductItemAccordion/index.tsx +22 -19
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +24 -14
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +3 -4
- package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
- package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
- package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
- package/themes/original/src/components/Promotions/index.tsx +234 -220
- package/themes/original/src/components/Promotions/styles.tsx +10 -3
- package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
- package/themes/original/src/components/ReviewOrder/index.tsx +26 -9
- package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
- package/themes/original/src/components/ReviewProducts/index.tsx +23 -11
- package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
- package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
- package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
- package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
- package/themes/original/src/components/ServiceForm/index.tsx +66 -17
- package/themes/original/src/components/Sessions/index.tsx +11 -8
- package/themes/original/src/components/Sessions/styles.tsx +5 -0
- package/themes/original/src/components/SignupForm/index.tsx +43 -20
- package/themes/original/src/components/SingleOrderCard/index.tsx +130 -52
- package/themes/original/src/components/SingleOrderCard/styles.tsx +11 -2
- package/themes/original/src/components/SingleProductCard/index.tsx +72 -34
- package/themes/original/src/components/SingleProductCard/styles.tsx +22 -4
- package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
- package/themes/original/src/components/StripeCardsList/index.tsx +13 -3
- package/themes/original/src/components/StripeElementsForm/index.tsx +51 -34
- package/themes/original/src/components/UpsellingProducts/index.tsx +238 -224
- package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
- package/themes/original/src/components/UserDetails/index.tsx +8 -4
- package/themes/original/src/components/UserFormDetails/index.tsx +76 -7
- package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
- package/themes/original/src/components/UserProfile/index.tsx +88 -79
- package/themes/original/src/components/UserProfileForm/index.tsx +27 -29
- package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
- package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
- package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
- package/themes/original/src/components/Wallets/index.tsx +67 -24
- package/themes/original/src/components/Wallets/styles.tsx +3 -4
- package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
- package/themes/original/src/components/shared/OButton.tsx +6 -2
- package/themes/original/src/components/shared/OInput.tsx +16 -2
- package/themes/original/src/components/shared/OModal.tsx +3 -3
- package/themes/original/src/layouts/Container.tsx +1 -1
- package/themes/original/src/types/index.tsx +40 -11
- package/themes/original/src/utils/index.tsx +375 -58
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -33,8 +33,7 @@ export const NotificationIcon = styled.View`
|
|
|
33
33
|
export const AcceptOrRejectOrder = styled.View`
|
|
34
34
|
flex-direction: row;
|
|
35
35
|
justify-content: space-between;
|
|
36
|
-
|
|
37
|
-
margin: 10px;
|
|
36
|
+
margin: ${(props: any) => props.m ?? 10}px;
|
|
38
37
|
`
|
|
39
38
|
export const Timestatus = styled.View`
|
|
40
39
|
position: relative;;
|
|
@@ -42,4 +41,33 @@ export const Timestatus = styled.View`
|
|
|
42
41
|
height: 55px;
|
|
43
42
|
border-radius: 20px;
|
|
44
43
|
top: 5px;
|
|
45
|
-
`
|
|
44
|
+
`
|
|
45
|
+
|
|
46
|
+
export const AccordionSection = styled.View`
|
|
47
|
+
background: #FFF;
|
|
48
|
+
padding-vertical: 10px;
|
|
49
|
+
`
|
|
50
|
+
|
|
51
|
+
export const Accordion = styled.TouchableOpacity`
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
justify-content: space-between;
|
|
54
|
+
align-items: center;
|
|
55
|
+
paddingVertical: 0;
|
|
56
|
+
marginLeft: 3px;
|
|
57
|
+
`
|
|
58
|
+
|
|
59
|
+
export const ContentInfo = styled.View`
|
|
60
|
+
flex-direction: row;
|
|
61
|
+
justify-content: space-between;
|
|
62
|
+
align-items: flex-start;
|
|
63
|
+
overflow: hidden;
|
|
64
|
+
`
|
|
65
|
+
|
|
66
|
+
export const AccordionContent = styled.View`
|
|
67
|
+
overflow: hidden;
|
|
68
|
+
`
|
|
69
|
+
|
|
70
|
+
export const ProductOptionsList = styled.View`
|
|
71
|
+
margin-top: 20px;
|
|
72
|
+
margin-left: 20px;
|
|
73
|
+
`
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { View, Animated } from 'react-native';
|
|
1
|
+
import React, { useEffect, useState, useCallback } from 'react';
|
|
2
|
+
import { View, Animated, TouchableOpacity } from 'react-native';
|
|
3
3
|
import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons';
|
|
4
4
|
import { useUtils, useLanguage } from 'ordering-components/native';
|
|
5
5
|
import { useTheme } from 'styled-components/native';
|
|
6
|
+
import { DeviceOrientationMethods } from '../../../../../src/hooks/DeviceOrientation'
|
|
7
|
+
|
|
8
|
+
const { useDeviceOrientation } = DeviceOrientationMethods
|
|
9
|
+
|
|
6
10
|
import {
|
|
7
11
|
Accordion,
|
|
8
12
|
AccordionSection,
|
|
@@ -34,8 +38,12 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
34
38
|
const [, t] = useLanguage();
|
|
35
39
|
const theme = useTheme();
|
|
36
40
|
const [{ parsePrice }] = useUtils();
|
|
41
|
+
const [orientationState] = useDeviceOrientation();
|
|
42
|
+
const WIDTH_SCREEN = orientationState?.dimensions?.width
|
|
37
43
|
|
|
38
44
|
const [isActive, setActiveState] = useState(false);
|
|
45
|
+
const [isReadMore, setIsReadMore] = useState(false);
|
|
46
|
+
const [lengthMore, setLengthMore] = useState(false);
|
|
39
47
|
|
|
40
48
|
const productInfo = () => {
|
|
41
49
|
if (isCartProduct) {
|
|
@@ -108,6 +116,10 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
108
116
|
}
|
|
109
117
|
}, []);
|
|
110
118
|
|
|
119
|
+
const onTextLayout = useCallback((e: any) => {
|
|
120
|
+
setLengthMore((e.nativeEvent.lines.length == 2 && e.nativeEvent.lines[1].width > WIDTH_SCREEN * .76) || e.nativeEvent.lines.length > 2); //to check the text is more than 2 lines or not
|
|
121
|
+
},[]);
|
|
122
|
+
|
|
111
123
|
return (
|
|
112
124
|
<AccordionSection>
|
|
113
125
|
<Accordion
|
|
@@ -288,9 +300,21 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
288
300
|
color={theme.colors.unselectText}>
|
|
289
301
|
{t('COMMENT', 'Comment')}
|
|
290
302
|
</OText>
|
|
291
|
-
<OText
|
|
303
|
+
<OText
|
|
304
|
+
size={12}
|
|
305
|
+
style={{ width: '100%', paddingLeft: 10 }}
|
|
306
|
+
color={theme.colors.unselectText}
|
|
307
|
+
onTextLayout={onTextLayout}
|
|
308
|
+
numberOfLines={isReadMore ? 15 : 2}
|
|
309
|
+
ellipsizeMode="tail"
|
|
310
|
+
>
|
|
292
311
|
{product.comment}
|
|
293
312
|
</OText>
|
|
313
|
+
{lengthMore && (
|
|
314
|
+
<TouchableOpacity onPress={() => setIsReadMore(!isReadMore)} style={{ marginLeft: 10 }}>
|
|
315
|
+
<OText size={10} color={theme.colors.statusOrderBlue}>{isReadMore ? t('SHOW_LESS', 'Show less') : t('READ_MORE', 'Read more')}</OText>
|
|
316
|
+
</TouchableOpacity>
|
|
317
|
+
)}
|
|
294
318
|
</ProductComment>
|
|
295
319
|
)}
|
|
296
320
|
</AccordionContent>
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
1
3
|
import React, { useState, useEffect, useRef } from 'react'
|
|
2
4
|
import {
|
|
3
5
|
useLanguage,
|
|
@@ -39,7 +41,8 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
|
|
|
39
41
|
reviewState,
|
|
40
42
|
setReviewState,
|
|
41
43
|
actionState,
|
|
42
|
-
handleSendCustomerReview
|
|
44
|
+
handleSendCustomerReview,
|
|
45
|
+
handleCustomCustomerReview
|
|
43
46
|
} = props
|
|
44
47
|
|
|
45
48
|
const theme = useTheme()
|
|
@@ -85,6 +88,18 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
|
|
|
85
88
|
marginBottom: 10,
|
|
86
89
|
backgroundColor: theme.colors.lightGray
|
|
87
90
|
},
|
|
91
|
+
btnBackArrow: {
|
|
92
|
+
borderWidth: 0,
|
|
93
|
+
width: 32,
|
|
94
|
+
height: 32,
|
|
95
|
+
tintColor: theme.colors.textGray,
|
|
96
|
+
backgroundColor: theme.colors.clear,
|
|
97
|
+
borderColor: theme.colors.clear,
|
|
98
|
+
shadowColor: theme.colors.clear,
|
|
99
|
+
paddingLeft: 0,
|
|
100
|
+
paddingRight: 0,
|
|
101
|
+
marginBottom: 20
|
|
102
|
+
},
|
|
88
103
|
inputTextArea: {
|
|
89
104
|
borderColor: theme.colors.lightGray,
|
|
90
105
|
borderRadius: 8,
|
|
@@ -153,6 +168,15 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
|
|
|
153
168
|
|
|
154
169
|
const customerName = `${order?.customer?.name ?? ''} ${order?.customer?.middle_name ?? ''} ${order?.customer?.lastname ?? ''} ${order?.customer?.second_lastname ?? ''}`?.replace(' ', ' ')?.trim() ?? ''
|
|
155
170
|
|
|
171
|
+
const handleReviewClick = () => {
|
|
172
|
+
handleCustomCustomerReview
|
|
173
|
+
? handleCustomCustomerReview({
|
|
174
|
+
qualification: reviewState?.qualification,
|
|
175
|
+
comment: reviewState?.comment
|
|
176
|
+
})
|
|
177
|
+
: handleSendCustomerReview()
|
|
178
|
+
}
|
|
179
|
+
|
|
156
180
|
return (
|
|
157
181
|
<KeyboardAvoidingView
|
|
158
182
|
enabled
|
|
@@ -167,18 +191,9 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
|
|
|
167
191
|
}}
|
|
168
192
|
>
|
|
169
193
|
<View>
|
|
170
|
-
<
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
iconStyle={{ width: 20, height: 16 }}
|
|
174
|
-
style={{
|
|
175
|
-
maxWidth: 40,
|
|
176
|
-
height: 20,
|
|
177
|
-
justifyContent: 'flex-end',
|
|
178
|
-
marginBottom: 20,
|
|
179
|
-
}}
|
|
180
|
-
onClick={() => closeModal()}
|
|
181
|
-
/>
|
|
194
|
+
<TouchableOpacity onPress={() => closeModal()} style={styles.btnBackArrow}>
|
|
195
|
+
<OIcon src={theme.images.general.arrow_left} color={theme.colors.textGray} />
|
|
196
|
+
</TouchableOpacity>
|
|
182
197
|
<OText
|
|
183
198
|
size={20}
|
|
184
199
|
weight="600"
|
|
@@ -303,7 +318,7 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
|
|
|
303
318
|
|
|
304
319
|
<ActionButtonWrapper>
|
|
305
320
|
<FloatingButton
|
|
306
|
-
firstButtonClick={() =>
|
|
321
|
+
firstButtonClick={() => handleReviewClick()}
|
|
307
322
|
btnText={actionState.loading ? t('LOADING', 'Loading') : t('SEND_REVIEW', 'Send Review')}
|
|
308
323
|
color={theme.colors.primary}
|
|
309
324
|
widthButton={'100%'}
|
|
@@ -149,10 +149,10 @@ const StoresListUI = (props: BusinessesListingParams) => {
|
|
|
149
149
|
width={12}
|
|
150
150
|
height={12}
|
|
151
151
|
color={theme.colors.skyBlue}
|
|
152
|
-
style={{ marginRight: 5
|
|
152
|
+
style={{ marginRight: 5 }}
|
|
153
153
|
/>
|
|
154
154
|
<OText size={12}>
|
|
155
|
-
{t('MORE_SETTINGS_GO_TO', 'For more settings go to')}
|
|
155
|
+
{t('MORE_SETTINGS_GO_TO', 'For more settings go to ')}
|
|
156
156
|
</OText>
|
|
157
157
|
<TouchableOpacity onPress={() => { Linking.openURL(t('LINK_MORE_SETTINGS_GO_TO', 'https://app.ordering.co')) }}>
|
|
158
158
|
<OText size={12} color={theme.colors.skyBlue}>
|
|
@@ -478,19 +478,17 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
478
478
|
/>
|
|
479
479
|
</EditButton>
|
|
480
480
|
)}
|
|
481
|
-
{
|
|
482
|
-
<
|
|
483
|
-
<
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
</Pressable>
|
|
493
|
-
)}
|
|
481
|
+
<Pressable style={{ marginBottom: 10 }} onPress={() => setOpenModal(true)}>
|
|
482
|
+
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
|
|
483
|
+
<OText size={16}>{t('SCHEDULE', 'Schedule')}</OText>
|
|
484
|
+
<AntDesignIcon size={18} name='right' />
|
|
485
|
+
</View>
|
|
486
|
+
<View style={{
|
|
487
|
+
borderBottomColor: theme.colors.tabBar,
|
|
488
|
+
borderBottomWidth: 1,
|
|
489
|
+
marginTop: 10
|
|
490
|
+
}} />
|
|
491
|
+
</Pressable>
|
|
494
492
|
<Actions>
|
|
495
493
|
<LanguageSelector />
|
|
496
494
|
|
|
@@ -12,10 +12,12 @@ interface Props {
|
|
|
12
12
|
TextStyle?: TextStyle;
|
|
13
13
|
type?: string;
|
|
14
14
|
hasButton?: boolean;
|
|
15
|
+
numberOfLines?: number;
|
|
16
|
+
onTextLayout?: (e : any) => void;
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
const OLink = (props: Props): React.ReactElement => {
|
|
18
|
-
const { url, shorcut, color, PressStyle, TextStyle, type, hasButton } = props;
|
|
20
|
+
const { url, shorcut, color, PressStyle, TextStyle, type, hasButton, numberOfLines, onTextLayout } = props;
|
|
19
21
|
const [, t] = useLanguage();
|
|
20
22
|
|
|
21
23
|
const handleAlert = () =>
|
|
@@ -29,8 +31,19 @@ const OLink = (props: Props): React.ReactElement => {
|
|
|
29
31
|
],
|
|
30
32
|
);
|
|
31
33
|
|
|
34
|
+
const handleInvalidNumberAlert = () =>
|
|
35
|
+
Alert.alert(
|
|
36
|
+
t('ERROR_OPENING_THE_LINK', 'Error opening the link'),
|
|
37
|
+
t('INVALID_NUMBER', 'Invalid number'),
|
|
38
|
+
[
|
|
39
|
+
{
|
|
40
|
+
text: t('OK', 'Ok'),
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
);
|
|
44
|
+
|
|
32
45
|
const handleOpenUrl = async (breakFunction = false) => {
|
|
33
|
-
if(breakFunction) {
|
|
46
|
+
if (breakFunction) {
|
|
34
47
|
return
|
|
35
48
|
}
|
|
36
49
|
if (!url) {
|
|
@@ -40,8 +53,9 @@ const OLink = (props: Props): React.ReactElement => {
|
|
|
40
53
|
|
|
41
54
|
try {
|
|
42
55
|
const supported = await Linking.canOpenURL(url);
|
|
43
|
-
|
|
44
|
-
|
|
56
|
+
if (url && url?.includes('tel:')) {
|
|
57
|
+
url?.includes('invalid') ? handleInvalidNumberAlert() : await Linking.openURL(url)
|
|
58
|
+
} else if (supported) {
|
|
45
59
|
await Linking.openURL(url);
|
|
46
60
|
} else {
|
|
47
61
|
handleAlert();
|
|
@@ -57,20 +71,26 @@ const OLink = (props: Props): React.ReactElement => {
|
|
|
57
71
|
<OButton
|
|
58
72
|
onClick={() => handleOpenUrl()}
|
|
59
73
|
text={shorcut} imgRightSrc=''
|
|
60
|
-
textStyle={{color: 'white'}}
|
|
61
|
-
style={{width: '100%', alignSelf: 'center', borderRadius: 10}}
|
|
74
|
+
textStyle={{ color: 'white' }}
|
|
75
|
+
style={{ width: '100%', alignSelf: 'center', borderRadius: 10 }}
|
|
62
76
|
/>
|
|
63
77
|
) : (
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
78
|
+
<OText
|
|
79
|
+
style={TextStyle}
|
|
80
|
+
numberOfLines={numberOfLines ?? 1}
|
|
81
|
+
ellipsizeMode="tail"
|
|
82
|
+
color={color}
|
|
83
|
+
onTextLayout={onTextLayout}
|
|
84
|
+
>
|
|
85
|
+
{shorcut}
|
|
86
|
+
</OText>
|
|
71
87
|
)}
|
|
72
88
|
</Pressable>
|
|
73
89
|
);
|
|
74
90
|
};
|
|
75
91
|
|
|
92
|
+
OLink.defaultProps = {
|
|
93
|
+
onTextLayout: (e: any) => {}
|
|
94
|
+
};
|
|
95
|
+
|
|
76
96
|
export default OLink;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Modal, StyleSheet, SafeAreaView, View } from 'react-native';
|
|
2
|
+
import { Modal, StyleSheet, SafeAreaView, View, TouchableOpacity } from 'react-native';
|
|
3
3
|
import Icon from 'react-native-vector-icons/Feather';
|
|
4
4
|
import OIcon from './OIcon';
|
|
5
5
|
import OText from './OText';
|
|
@@ -158,6 +158,18 @@ const OModal = (props: Props): React.ReactElement => {
|
|
|
158
158
|
fontWeight: '600',
|
|
159
159
|
textAlign: 'center',
|
|
160
160
|
},
|
|
161
|
+
btnBackArrow: {
|
|
162
|
+
borderWidth: 0,
|
|
163
|
+
width: 32,
|
|
164
|
+
height: 32,
|
|
165
|
+
tintColor: theme.colors.textGray,
|
|
166
|
+
backgroundColor: theme.colors.clear,
|
|
167
|
+
borderColor: theme.colors.clear,
|
|
168
|
+
shadowColor: theme.colors.clear,
|
|
169
|
+
paddingLeft: 0,
|
|
170
|
+
paddingRight: 0,
|
|
171
|
+
marginTop: 10
|
|
172
|
+
},
|
|
161
173
|
});
|
|
162
174
|
|
|
163
175
|
return (
|
|
@@ -205,14 +217,9 @@ const OModal = (props: Props): React.ReactElement => {
|
|
|
205
217
|
{!customClose && (
|
|
206
218
|
<View style={styles.titleSection}>
|
|
207
219
|
<View style={styles.titleGroups}>
|
|
208
|
-
<
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
borderColor={theme.colors.clear}
|
|
212
|
-
style={styleCloseButton || styles.cancelBtn}
|
|
213
|
-
onClick={onClose}
|
|
214
|
-
/>
|
|
215
|
-
|
|
220
|
+
<TouchableOpacity onPress={() => onClose()} style={styles.btnBackArrow}>
|
|
221
|
+
<OIcon src={theme.images.general.arrow_left} color={theme.colors.textGray} />
|
|
222
|
+
</TouchableOpacity>
|
|
216
223
|
<OText
|
|
217
224
|
size={16}
|
|
218
225
|
style={styles.modalText}
|
|
@@ -40,16 +40,22 @@ interface Props {
|
|
|
40
40
|
numberOfLines?: number;
|
|
41
41
|
ellipsizeMode?: string;
|
|
42
42
|
adjustsFontSizeToFit?: boolean;
|
|
43
|
-
textDecorationLine?: string
|
|
43
|
+
textDecorationLine?: string;
|
|
44
|
+
lineHeight?: number;
|
|
45
|
+
onTextLayout?: (e : any) => void;
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
const OText = (props: Props): React.ReactElement => {
|
|
47
49
|
return (
|
|
48
|
-
<SText {...props} style={props.style}>
|
|
50
|
+
<SText {...props} style={[props.style, { lineHeight: props.lineHeight }]} onTextLayout={props.onTextLayout}>
|
|
49
51
|
{props.children}
|
|
50
52
|
{props.space && ' '}
|
|
51
53
|
</SText>
|
|
52
54
|
);
|
|
53
55
|
};
|
|
54
56
|
|
|
57
|
+
OText.defaultProps = {
|
|
58
|
+
onTextLayout: (e: any) => {}
|
|
59
|
+
};
|
|
60
|
+
|
|
55
61
|
export default OText;
|
|
@@ -23,6 +23,21 @@ export interface LoginParams {
|
|
|
23
23
|
notificationState?: any;
|
|
24
24
|
handleReCaptcha?: any;
|
|
25
25
|
enableReCaptcha?: any;
|
|
26
|
+
|
|
27
|
+
otpType?: string,
|
|
28
|
+
setOtpType: (type: string) => void,
|
|
29
|
+
generateOtpCode: (values?: any) => void,
|
|
30
|
+
useLoginOtpEmail?: boolean,
|
|
31
|
+
useLoginOtpCellphone?: boolean,
|
|
32
|
+
useLoginOtp?: boolean
|
|
33
|
+
}
|
|
34
|
+
export interface otpParams {
|
|
35
|
+
willVerifyOtpState: boolean,
|
|
36
|
+
setWillVerifyOtpState: (val: boolean) => void,
|
|
37
|
+
onSubmit: () => void,
|
|
38
|
+
handleLoginOtp: (code: string) => void,
|
|
39
|
+
setAlertState: any,
|
|
40
|
+
formState?: any
|
|
26
41
|
}
|
|
27
42
|
export interface ProfileParams {
|
|
28
43
|
navigation?: any;
|
|
@@ -297,6 +312,10 @@ export interface OrdersOptionParams {
|
|
|
297
312
|
isLogisticActivated?: boolean;
|
|
298
313
|
isAlsea?: boolean;
|
|
299
314
|
checkNotification?: boolean;
|
|
315
|
+
ordersFormatted?: any;
|
|
316
|
+
handleChangeOrderStatus?: () => void;
|
|
317
|
+
handleSendCustomerReview?: () => void;
|
|
318
|
+
orderDetailsProps?: any;
|
|
300
319
|
}
|
|
301
320
|
export interface ActiveOrdersParams {
|
|
302
321
|
orders?: any;
|
|
@@ -555,14 +574,17 @@ export interface AcceptOrRejectOrderParams {
|
|
|
555
574
|
loading?: boolean;
|
|
556
575
|
action: string;
|
|
557
576
|
orderId?: number;
|
|
558
|
-
handleUpdateOrder?: (
|
|
577
|
+
handleUpdateOrder?: (p1: any, p2: any) => {};
|
|
559
578
|
notShowCustomerPhone?: boolean | undefined;
|
|
560
|
-
actions?:
|
|
579
|
+
actions?: any;
|
|
561
580
|
titleAccept?: textTranslate;
|
|
562
581
|
titleReject?: textTranslate;
|
|
563
582
|
titleNotReady?: textTranslate;
|
|
564
583
|
appTitle?: textTranslate;
|
|
565
584
|
orderTitle?: any
|
|
585
|
+
isPage?: boolean
|
|
586
|
+
navigation?: any
|
|
587
|
+
route?: any
|
|
566
588
|
}
|
|
567
589
|
|
|
568
590
|
export interface MapViewParams {
|
|
@@ -584,8 +606,16 @@ export interface ReviewCustomerParams {
|
|
|
584
606
|
actionState?: any,
|
|
585
607
|
handleChangeQualification?: any,
|
|
586
608
|
handleSendCustomerReview?: any,
|
|
609
|
+
handleCustomCustomerReview?: any,
|
|
587
610
|
}
|
|
588
611
|
|
|
589
612
|
export interface NoNetworkParams {
|
|
590
613
|
image?: any;
|
|
591
614
|
}
|
|
615
|
+
|
|
616
|
+
export interface OrderDetailsLogisticParams {
|
|
617
|
+
navigation: any,
|
|
618
|
+
handleClickLogisticOrder: any,
|
|
619
|
+
orderAssingId: number,
|
|
620
|
+
order: any
|
|
621
|
+
}
|
|
@@ -346,10 +346,53 @@ export const getOrderStatus = (s: string, t: any) => {
|
|
|
346
346
|
return objectStatus && objectStatus;
|
|
347
347
|
};
|
|
348
348
|
|
|
349
|
-
export const transformDistance = (value
|
|
349
|
+
export const transformDistance = (value: number, distanceUnit?: string) => {
|
|
350
350
|
return distanceUnit === 'mi'
|
|
351
351
|
? (value / 1.609).toFixed(2)
|
|
352
352
|
: distanceUnit === 'ft'
|
|
353
353
|
? (value * 3280.84).toFixed(0)
|
|
354
354
|
: (value).toFixed(2)
|
|
355
355
|
}
|
|
356
|
+
|
|
357
|
+
export const formatSeconds = (seconds: number) => {
|
|
358
|
+
// Hours, minutes and seconds
|
|
359
|
+
const hrs = Math.floor(seconds / 3600)
|
|
360
|
+
const mins = Math.floor((seconds % 3600) / 60)
|
|
361
|
+
const secs = Math.floor(seconds % 60)
|
|
362
|
+
|
|
363
|
+
// Output like '1:01' or '4:03:59' or '123:03:59'
|
|
364
|
+
let ret = ''
|
|
365
|
+
if (hrs > 0) {
|
|
366
|
+
ret += '' + hrs + ':' + (mins < 10 ? '0' : '')
|
|
367
|
+
}
|
|
368
|
+
ret += '' + mins + ':' + (secs < 10 ? '0' : '')
|
|
369
|
+
ret += '' + secs
|
|
370
|
+
return ret
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
export const calculateDistance = (
|
|
374
|
+
pointA: { lat: number; lng: number },
|
|
375
|
+
pointB: { latitude: number; longitude: number },
|
|
376
|
+
) => {
|
|
377
|
+
const lat1 = pointA.lat;
|
|
378
|
+
const lon1 = pointA.lng;
|
|
379
|
+
|
|
380
|
+
const lat2 = pointB?.latitude;
|
|
381
|
+
const lon2 = pointB?.longitude;
|
|
382
|
+
|
|
383
|
+
const R = 6371e3;
|
|
384
|
+
const φ1 = lat1 * (Math.PI / 180);
|
|
385
|
+
const φ2 = lat2 * (Math.PI / 180);
|
|
386
|
+
const Δφ = (lat2 - lat1) * (Math.PI / 180);
|
|
387
|
+
const Δλ = (lon2 - lon1) * (Math.PI / 180);
|
|
388
|
+
|
|
389
|
+
const a =
|
|
390
|
+
Math.sin(Δφ / 2) * Math.sin(Δφ / 2) +
|
|
391
|
+
Math.cos(φ1) * Math.cos(φ2) * (Math.sin(Δλ / 2) * Math.sin(Δλ / 2));
|
|
392
|
+
|
|
393
|
+
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
|
394
|
+
|
|
395
|
+
const distance = R * c;
|
|
396
|
+
const distanceInKm = distance / 1000;
|
|
397
|
+
return distanceInKm;
|
|
398
|
+
};
|
|
@@ -197,7 +197,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
197
197
|
{isFarAway && (
|
|
198
198
|
<FarAwayMessage style={styles.farAwayMsg}>
|
|
199
199
|
<Ionicons name='md-warning-outline' style={styles.iconStyle} />
|
|
200
|
-
<OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', '
|
|
200
|
+
<OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
|
|
201
201
|
</FarAwayMessage>
|
|
202
202
|
)}
|
|
203
203
|
{!auth && (
|
|
@@ -410,8 +410,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
410
410
|
textInputProps={{
|
|
411
411
|
returnKeyType: 'next',
|
|
412
412
|
onSubmitEditing: () => inputRef?.current?.focus?.(),
|
|
413
|
-
style: { borderWidth: 0, fontSize: 12 }
|
|
414
|
-
maxLength: 10
|
|
413
|
+
style: { borderWidth: 0, fontSize: 12 }
|
|
415
414
|
}}
|
|
416
415
|
textWrapStyle={{ borderColor: theme.colors.clear, borderWidth: 0, height: 40, paddingStart: 0 }}
|
|
417
416
|
/>
|
|
@@ -155,7 +155,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
155
155
|
{isFarAway && (
|
|
156
156
|
<FarAwayMessage style={styles.farAwayMsg}>
|
|
157
157
|
<Ionicons name='md-warning-outline' style={styles.iconStyle} />
|
|
158
|
-
<OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', '
|
|
158
|
+
<OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
|
|
159
159
|
</FarAwayMessage>
|
|
160
160
|
)}
|
|
161
161
|
<View style={styles.wrapperOrderOptions}>
|
|
@@ -50,6 +50,12 @@ const CheckoutUI = (props: any) => {
|
|
|
50
50
|
}
|
|
51
51
|
}, [cart])
|
|
52
52
|
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (!cartState.loading && cart && !cart?.valid && cart?.status === 2) {
|
|
55
|
+
navigation?.canGoBack() && navigation.goBack()
|
|
56
|
+
}
|
|
57
|
+
}, [cart])
|
|
58
|
+
|
|
53
59
|
return (
|
|
54
60
|
<>
|
|
55
61
|
<PaymentOptions
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React, { useEffect } from 'react'
|
|
2
|
+
import { formatSeconds } from '../../../utils'
|
|
3
|
+
import { StyleSheet, TouchableOpacity } from 'react-native';
|
|
4
|
+
import { useCountdownTimer } from '../../../../../../src/hooks/useCountdownTimer';
|
|
5
|
+
import { useLanguage } from 'ordering-components/native';
|
|
6
|
+
import { OTPContainer } from './styles';
|
|
7
|
+
import { OText, OButton } from '../../shared';
|
|
8
|
+
import OTPInputView from '@twotalltotems/react-native-otp-input'
|
|
9
|
+
import { useTheme } from 'styled-components/native';
|
|
10
|
+
import { otpParams } from '../../../types'
|
|
11
|
+
|
|
12
|
+
export const Otp = (props: otpParams) => {
|
|
13
|
+
const {
|
|
14
|
+
willVerifyOtpState,
|
|
15
|
+
setWillVerifyOtpState,
|
|
16
|
+
onSubmit,
|
|
17
|
+
handleLoginOtp,
|
|
18
|
+
setAlertState,
|
|
19
|
+
pinCount
|
|
20
|
+
} = props
|
|
21
|
+
|
|
22
|
+
const theme = useTheme();
|
|
23
|
+
const [, t] = useLanguage();
|
|
24
|
+
const [otpLeftTime, _, resetOtpLeftTime]: any = useCountdownTimer(
|
|
25
|
+
600, willVerifyOtpState)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
const handleOnSubmit = () => {
|
|
29
|
+
setAlertState({
|
|
30
|
+
open: true,
|
|
31
|
+
title: t('CODE_SENT', 'The code has been sent'),
|
|
32
|
+
})
|
|
33
|
+
resetOtpLeftTime()
|
|
34
|
+
onSubmit()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (otpLeftTime === 0) {
|
|
39
|
+
setAlertState({
|
|
40
|
+
open: true,
|
|
41
|
+
title: t('TIME_IS_UP', 'Time is up'),
|
|
42
|
+
content: t('PLEASE_RESEND_CODE', 'Please resend code again')
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
}, [otpLeftTime])
|
|
46
|
+
|
|
47
|
+
const loginStyle = StyleSheet.create({
|
|
48
|
+
underlineStyleBase: {
|
|
49
|
+
width: 45,
|
|
50
|
+
height: 60,
|
|
51
|
+
borderWidth: 1,
|
|
52
|
+
fontSize: 16
|
|
53
|
+
},
|
|
54
|
+
underlineStyleHighLighted: {
|
|
55
|
+
borderColor: theme.colors.primary,
|
|
56
|
+
color: theme.colors.primary,
|
|
57
|
+
fontSize: 16
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<>
|
|
63
|
+
<OTPContainer>
|
|
64
|
+
<OText size={24}>
|
|
65
|
+
{formatSeconds(otpLeftTime)}
|
|
66
|
+
</OText>
|
|
67
|
+
<OTPInputView
|
|
68
|
+
style={{ width: '100%', height: 150 }}
|
|
69
|
+
pinCount={pinCount || 6}
|
|
70
|
+
codeInputFieldStyle={loginStyle.underlineStyleBase}
|
|
71
|
+
codeInputHighlightStyle={loginStyle.underlineStyleHighLighted}
|
|
72
|
+
onCodeFilled={(code: string) => handleLoginOtp(code)}
|
|
73
|
+
selectionColor={theme.colors.primary}
|
|
74
|
+
editable
|
|
75
|
+
/>
|
|
76
|
+
<TouchableOpacity onPress={() => handleOnSubmit()} disabled={otpLeftTime > 520}>
|
|
77
|
+
<OText size={16} mBottom={30} color={otpLeftTime > 520 ? theme.colors.disabled : theme.colors.primary}>
|
|
78
|
+
{t('RESEND_CODE', 'Resend code')}
|
|
79
|
+
</OText>
|
|
80
|
+
</TouchableOpacity>
|
|
81
|
+
<OButton
|
|
82
|
+
onClick={() => setWillVerifyOtpState(false)}
|
|
83
|
+
bgColor={theme.colors.white}
|
|
84
|
+
borderColor={theme.colors.primary}
|
|
85
|
+
textStyle={{ color: theme.colors.primary }}
|
|
86
|
+
style={{ borderRadius: 8, width: '100%' }}
|
|
87
|
+
text={t('CANCEL', 'Cancel')}
|
|
88
|
+
/>
|
|
89
|
+
</OTPContainer>
|
|
90
|
+
</>
|
|
91
|
+
)
|
|
92
|
+
}
|