ordering-ui-react-native 0.17.69 → 0.17.70-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/BusinessInformation/index.tsx +10 -9
- 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 +3 -2
- 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 +270 -245
- 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 +124 -111
- package/themes/business/src/components/DriverMap/index.tsx +17 -6
- package/themes/business/src/components/DriverSchedule/index.tsx +45 -8
- package/themes/business/src/components/GoogleMap/index.tsx +58 -57
- package/themes/business/src/components/LoginForm/Otp/index.tsx +31 -3
- package/themes/business/src/components/LoginForm/index.tsx +15 -22
- package/themes/business/src/components/MapView/index.tsx +10 -10
- package/themes/business/src/components/MessagesOption/index.tsx +20 -93
- package/themes/business/src/components/NewOrderNotification/index.tsx +35 -21
- package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
- package/themes/business/src/components/OrderDetails/Delivery.tsx +191 -6
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +103 -39
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +61 -60
- 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 +19 -18
- package/themes/business/src/components/OrderSummary/index.tsx +114 -123
- package/themes/business/src/components/OrdersOption/index.tsx +21 -20
- 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 +17 -12
- package/themes/business/src/components/PreviousOrders/OrderList.tsx +88 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +2 -2
- package/themes/business/src/components/PreviousOrders/index.tsx +289 -217
- package/themes/business/src/components/PreviousOrders/styles.tsx +1 -1
- package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
- package/themes/business/src/components/ReviewCustomer/index.tsx +18 -13
- package/themes/business/src/components/StoresList/index.tsx +3 -4
- package/themes/business/src/components/UserProfileForm/index.tsx +11 -13
- package/themes/business/src/components/shared/OLink.tsx +11 -3
- package/themes/business/src/components/shared/OModal.tsx +16 -9
- package/themes/business/src/components/shared/OText.tsx +6 -1
- package/themes/business/src/types/index.tsx +30 -13
- package/themes/business/src/utils/index.tsx +29 -2
- 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/Intro/index.tsx +16 -1
- package/themes/kiosk/src/components/LoginForm/index.tsx +7 -9
- 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 +2 -2
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/original/index.tsx +1 -1
- package/themes/original/src/components/AddressDetails/index.tsx +19 -3
- package/themes/original/src/components/AddressForm/index.tsx +61 -39
- 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 +153 -96
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +10 -12
- package/themes/original/src/components/BusinessController/index.tsx +80 -66
- package/themes/original/src/components/BusinessController/styles.tsx +12 -5
- 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 +139 -85
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +15 -20
- package/themes/original/src/components/BusinessListingSearch/index.tsx +349 -339
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +0 -18
- 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 +15 -7
- 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 +684 -556
- 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 +69 -38
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +0 -1
- package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
- package/themes/original/src/components/Cart/index.tsx +77 -79
- package/themes/original/src/components/CartContent/index.tsx +117 -20
- package/themes/original/src/components/CartContent/styles.tsx +17 -7
- package/themes/original/src/components/Checkout/index.tsx +356 -124
- package/themes/original/src/components/CitiesControl/index.tsx +1 -1
- 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 +1 -35
- package/themes/original/src/components/FloatingButton/index.tsx +11 -14
- 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/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 +60 -5
- 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 +91 -25
- package/themes/original/src/components/LoginForm/index.tsx +64 -34
- 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 +14 -7
- package/themes/original/src/components/MomentOption/index.tsx +195 -90
- package/themes/original/src/components/MomentSelector/index.tsx +1 -1
- package/themes/original/src/components/MultiCart/index.tsx +41 -54
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +162 -50
- package/themes/original/src/components/MultiCheckout/index.tsx +329 -100
- 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 +54 -21
- package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
- package/themes/original/src/components/MyOrders/index.tsx +40 -29
- package/themes/original/src/components/NavBar/index.tsx +20 -17
- 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 +21 -5
- package/themes/original/src/components/OrderDetails/index.tsx +191 -363
- 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 +30 -56
- package/themes/original/src/components/OrderSummary/index.tsx +88 -59
- package/themes/original/src/components/OrderTypeSelector/index.tsx +2 -1
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +14 -14
- package/themes/original/src/components/OrdersOption/index.tsx +68 -87
- package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
- package/themes/original/src/components/PageBanner/index.tsx +98 -38
- package/themes/original/src/components/PageBanner/styles.tsx +0 -10
- 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 +78 -35
- package/themes/original/src/components/PhoneInputNumber/index.tsx +18 -4
- package/themes/original/src/components/ProductForm/index.tsx +105 -30
- package/themes/original/src/components/ProductForm/styles.tsx +5 -5
- package/themes/original/src/components/ProductItemAccordion/index.tsx +12 -9
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +20 -18
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +5 -9
- 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 +5 -4
- package/themes/original/src/components/Promotions/styles.tsx +3 -1
- package/themes/original/src/components/ReviewProducts/index.tsx +16 -7
- package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
- 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 -27
- package/themes/original/src/components/SingleOrderCard/index.tsx +101 -62
- package/themes/original/src/components/SingleOrderCard/styles.tsx +1 -1
- package/themes/original/src/components/SingleProductCard/index.tsx +72 -31
- package/themes/original/src/components/SingleProductCard/styles.tsx +20 -4
- package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
- package/themes/original/src/components/StripeCardsList/index.tsx +49 -5
- package/themes/original/src/components/StripeElementsForm/index.tsx +48 -34
- package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
- 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 +3 -1
- 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/UserVerification/index.tsx +55 -50
- 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 +66 -30
- package/themes/original/src/components/Wallets/styles.tsx +3 -4
- package/themes/original/src/components/shared/OButton.tsx +6 -2
- package/themes/original/src/components/shared/OInput.tsx +6 -1
- package/themes/original/src/components/shared/OModal.tsx +3 -3
- package/themes/original/src/types/index.tsx +42 -11
- package/themes/original/src/utils/index.tsx +273 -1
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
1
3
|
import React, { useState, useEffect, useRef } from 'react'
|
|
2
4
|
import {
|
|
3
5
|
useLanguage,
|
|
@@ -86,6 +88,18 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
|
|
|
86
88
|
marginBottom: 10,
|
|
87
89
|
backgroundColor: theme.colors.lightGray
|
|
88
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
|
+
},
|
|
89
103
|
inputTextArea: {
|
|
90
104
|
borderColor: theme.colors.lightGray,
|
|
91
105
|
borderRadius: 8,
|
|
@@ -147,7 +161,7 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
|
|
|
147
161
|
useEffect(() => {
|
|
148
162
|
if (scrollref?.current) {
|
|
149
163
|
Keyboard.addListener('keyboardDidShow', () => {
|
|
150
|
-
scrollref.current.scrollToEnd()
|
|
164
|
+
scrollref?.current?.scrollToEnd && scrollref.current.scrollToEnd()
|
|
151
165
|
})
|
|
152
166
|
}
|
|
153
167
|
}, [scrollref?.current])
|
|
@@ -177,18 +191,9 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
|
|
|
177
191
|
}}
|
|
178
192
|
>
|
|
179
193
|
<View>
|
|
180
|
-
<
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
iconStyle={{ width: 20, height: 16 }}
|
|
184
|
-
style={{
|
|
185
|
-
maxWidth: 40,
|
|
186
|
-
height: 20,
|
|
187
|
-
justifyContent: 'flex-end',
|
|
188
|
-
marginBottom: 20,
|
|
189
|
-
}}
|
|
190
|
-
onClick={() => closeModal()}
|
|
191
|
-
/>
|
|
194
|
+
<TouchableOpacity onPress={() => closeModal()} style={styles.btnBackArrow}>
|
|
195
|
+
<OIcon src={theme.images.general.arrow_left} color={theme.colors.textGray} />
|
|
196
|
+
</TouchableOpacity>
|
|
192
197
|
<OText
|
|
193
198
|
size={20}
|
|
194
199
|
weight="600"
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { View, StyleSheet, Dimensions, Linking } from 'react-native';
|
|
3
|
-
import { ScrollView, TouchableOpacity } from 'react-native-gesture-handler';
|
|
2
|
+
import { View, StyleSheet, Dimensions, Linking, ScrollView, TouchableOpacity } from 'react-native';
|
|
4
3
|
import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
|
|
5
4
|
import NetInfo from '@react-native-community/netinfo';
|
|
6
5
|
import { useTheme } from 'styled-components/native';
|
|
@@ -149,10 +148,10 @@ const StoresListUI = (props: BusinessesListingParams) => {
|
|
|
149
148
|
width={12}
|
|
150
149
|
height={12}
|
|
151
150
|
color={theme.colors.skyBlue}
|
|
152
|
-
style={{ marginRight: 5
|
|
151
|
+
style={{ marginRight: 5 }}
|
|
153
152
|
/>
|
|
154
153
|
<OText size={12}>
|
|
155
|
-
{t('MORE_SETTINGS_GO_TO', 'For more settings go to')}
|
|
154
|
+
{t('MORE_SETTINGS_GO_TO', 'For more settings go to ')}
|
|
156
155
|
</OText>
|
|
157
156
|
<TouchableOpacity onPress={() => { Linking.openURL(t('LINK_MORE_SETTINGS_GO_TO', 'https://app.ordering.co')) }}>
|
|
158
157
|
<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 = () =>
|
|
@@ -75,9 +77,11 @@ const OLink = (props: Props): React.ReactElement => {
|
|
|
75
77
|
) : (
|
|
76
78
|
<OText
|
|
77
79
|
style={TextStyle}
|
|
78
|
-
numberOfLines={1}
|
|
80
|
+
numberOfLines={numberOfLines ?? 1}
|
|
79
81
|
ellipsizeMode="tail"
|
|
80
|
-
color={color}
|
|
82
|
+
color={color}
|
|
83
|
+
onTextLayout={onTextLayout}
|
|
84
|
+
>
|
|
81
85
|
{shorcut}
|
|
82
86
|
</OText>
|
|
83
87
|
)}
|
|
@@ -85,4 +89,8 @@ const OLink = (props: Props): React.ReactElement => {
|
|
|
85
89
|
);
|
|
86
90
|
};
|
|
87
91
|
|
|
92
|
+
OLink.defaultProps = {
|
|
93
|
+
onTextLayout: (e: any) => {}
|
|
94
|
+
};
|
|
95
|
+
|
|
88
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}
|
|
@@ -42,15 +42,20 @@ interface Props {
|
|
|
42
42
|
adjustsFontSizeToFit?: boolean;
|
|
43
43
|
textDecorationLine?: string;
|
|
44
44
|
lineHeight?: number;
|
|
45
|
+
onTextLayout?: (e : any) => void;
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
const OText = (props: Props): React.ReactElement => {
|
|
48
49
|
return (
|
|
49
|
-
<SText {...props} style={[props.style, { lineHeight: props.lineHeight }]}>
|
|
50
|
+
<SText {...props} style={[props.style, { lineHeight: props.lineHeight }]} onTextLayout={props.onTextLayout}>
|
|
50
51
|
{props.children}
|
|
51
52
|
{props.space && ' '}
|
|
52
53
|
</SText>
|
|
53
54
|
);
|
|
54
55
|
};
|
|
55
56
|
|
|
57
|
+
OText.defaultProps = {
|
|
58
|
+
onTextLayout: (e: any) => {}
|
|
59
|
+
};
|
|
60
|
+
|
|
56
61
|
export default OText;
|
|
@@ -25,18 +25,19 @@ export interface LoginParams {
|
|
|
25
25
|
enableReCaptcha?: any;
|
|
26
26
|
|
|
27
27
|
otpType?: string,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
setOtpType: (type: string) => void,
|
|
29
|
+
generateOtpCode: (values?: any) => void,
|
|
30
|
+
useLoginOtpEmail?: boolean,
|
|
31
|
+
useLoginOtpCellphone?: boolean,
|
|
32
|
+
useLoginOtp?: boolean
|
|
33
33
|
}
|
|
34
34
|
export interface otpParams {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
willVerifyOtpState: boolean,
|
|
36
|
+
setWillVerifyOtpState: (val: boolean) => void,
|
|
37
|
+
onSubmit: () => void,
|
|
38
|
+
handleLoginOtp: (code: string) => void,
|
|
39
|
+
setAlertState: any,
|
|
40
|
+
formState?: any
|
|
40
41
|
}
|
|
41
42
|
export interface ProfileParams {
|
|
42
43
|
navigation?: any;
|
|
@@ -311,7 +312,7 @@ export interface OrdersOptionParams {
|
|
|
311
312
|
isLogisticActivated?: boolean;
|
|
312
313
|
isAlsea?: boolean;
|
|
313
314
|
checkNotification?: boolean;
|
|
314
|
-
|
|
315
|
+
ordersFormatted?: any;
|
|
315
316
|
handleChangeOrderStatus?: () => void;
|
|
316
317
|
handleSendCustomerReview?: () => void;
|
|
317
318
|
orderDetailsProps?: any;
|
|
@@ -364,6 +365,12 @@ export interface PreviousMessagesParams {
|
|
|
364
365
|
loadMessages?: (id: any) => {};
|
|
365
366
|
handleReorder?: (order: any) => {};
|
|
366
367
|
onNavigationRedirect?: (route: string, params?: any) => {};
|
|
368
|
+
getOrders?: any;
|
|
369
|
+
loading?: boolean;
|
|
370
|
+
reload?: boolean;
|
|
371
|
+
tabs?: any;
|
|
372
|
+
loadMore: any
|
|
373
|
+
error?: boolean
|
|
367
374
|
}
|
|
368
375
|
export interface OrderDetailsParams {
|
|
369
376
|
handleUpdateLocationDriver?: () => {};
|
|
@@ -573,14 +580,17 @@ export interface AcceptOrRejectOrderParams {
|
|
|
573
580
|
loading?: boolean;
|
|
574
581
|
action: string;
|
|
575
582
|
orderId?: number;
|
|
576
|
-
handleUpdateOrder?: () =>
|
|
583
|
+
handleUpdateOrder?: (p1: any, p2: any) => {};
|
|
577
584
|
notShowCustomerPhone?: boolean | undefined;
|
|
578
|
-
actions?:
|
|
585
|
+
actions?: any;
|
|
579
586
|
titleAccept?: textTranslate;
|
|
580
587
|
titleReject?: textTranslate;
|
|
581
588
|
titleNotReady?: textTranslate;
|
|
582
589
|
appTitle?: textTranslate;
|
|
583
590
|
orderTitle?: any
|
|
591
|
+
isPage?: boolean
|
|
592
|
+
navigation?: any
|
|
593
|
+
route?: any
|
|
584
594
|
}
|
|
585
595
|
|
|
586
596
|
export interface MapViewParams {
|
|
@@ -608,3 +618,10 @@ export interface ReviewCustomerParams {
|
|
|
608
618
|
export interface NoNetworkParams {
|
|
609
619
|
image?: any;
|
|
610
620
|
}
|
|
621
|
+
|
|
622
|
+
export interface OrderDetailsLogisticParams {
|
|
623
|
+
navigation: any,
|
|
624
|
+
handleClickLogisticOrder: any,
|
|
625
|
+
orderAssingId: number,
|
|
626
|
+
order: any
|
|
627
|
+
}
|
|
@@ -346,7 +346,7 @@ 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'
|
|
@@ -354,7 +354,7 @@ export const transformDistance = (value : number, distanceUnit?: string) => {
|
|
|
354
354
|
: (value).toFixed(2)
|
|
355
355
|
}
|
|
356
356
|
|
|
357
|
-
export const formatSeconds = (seconds
|
|
357
|
+
export const formatSeconds = (seconds: number) => {
|
|
358
358
|
// Hours, minutes and seconds
|
|
359
359
|
const hrs = Math.floor(seconds / 3600)
|
|
360
360
|
const mins = Math.floor((seconds % 3600) / 60)
|
|
@@ -369,3 +369,30 @@ export const formatSeconds = (seconds : number) => {
|
|
|
369
369
|
ret += '' + secs
|
|
370
370
|
return ret
|
|
371
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
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { StyleSheet, View,
|
|
2
|
+
import { StyleSheet, View, Pressable, TouchableOpacity } from 'react-native';
|
|
3
3
|
import { useLanguage } from 'ordering-components/native';
|
|
4
4
|
import { useTheme } from 'styled-components/native';
|
|
5
5
|
|
|
@@ -9,6 +9,7 @@ import OButton from '../../components/shared/OButton';
|
|
|
9
9
|
import { LanguageSelector } from '../../components/LanguageSelector';
|
|
10
10
|
import { LogoutPopup } from '../../components/LogoutPopup';
|
|
11
11
|
import { PORTRAIT, LANDSCAPE, useDeviceOrientation } from "../../../../../src/hooks/DeviceOrientation";
|
|
12
|
+
import { OIcon } from '../../components/shared';
|
|
12
13
|
|
|
13
14
|
const Intro = (props: any): React.ReactElement => {
|
|
14
15
|
const { navigation } = props;
|
|
@@ -41,6 +42,19 @@ const Intro = (props: any): React.ReactElement => {
|
|
|
41
42
|
// />
|
|
42
43
|
// }
|
|
43
44
|
// >
|
|
45
|
+
<>
|
|
46
|
+
<View style={{ position: 'absolute', top: 25, right: 20, zIndex: 1000 }}>
|
|
47
|
+
<TouchableOpacity
|
|
48
|
+
onPress={() => setShowLogoutPopup(true)}
|
|
49
|
+
>
|
|
50
|
+
<OIcon
|
|
51
|
+
src={theme.images.general.menulogout}
|
|
52
|
+
width={24}
|
|
53
|
+
height={24}
|
|
54
|
+
color={theme.colors.disabledContrast}
|
|
55
|
+
/>
|
|
56
|
+
</TouchableOpacity>
|
|
57
|
+
</View>
|
|
44
58
|
<Pressable onPress={goBusiness}>
|
|
45
59
|
<View style={{ height: orientationState?.dimensions?.height }}>
|
|
46
60
|
{orientationState.orientation === PORTRAIT ? (
|
|
@@ -134,6 +148,7 @@ const Intro = (props: any): React.ReactElement => {
|
|
|
134
148
|
/>
|
|
135
149
|
</View>
|
|
136
150
|
</Pressable>
|
|
151
|
+
</>
|
|
137
152
|
// </ScrollView>
|
|
138
153
|
);
|
|
139
154
|
};
|
|
@@ -116,10 +116,6 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
if (values?.project_name) {
|
|
119
|
-
setOrdering({
|
|
120
|
-
...ordering,
|
|
121
|
-
project: values?.project_name
|
|
122
|
-
})
|
|
123
119
|
_setStoreData('project_name', values?.project_name)
|
|
124
120
|
setFormsStateValues({
|
|
125
121
|
...formsStateValues,
|
|
@@ -384,12 +380,14 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
384
380
|
);
|
|
385
381
|
|
|
386
382
|
const note = (
|
|
387
|
-
|
|
388
|
-
{
|
|
389
|
-
|
|
390
|
-
{
|
|
383
|
+
useRootPoint && (
|
|
384
|
+
<OText size={24} mBottom={18}>
|
|
385
|
+
{t('IF_NOT_HAVE_ACCOUNT', 'If you don\'t have and account, please contact Ordering')}
|
|
386
|
+
<OText size={24} mBottom={18} color={theme.colors.skyBlue}>
|
|
387
|
+
{t('SUPPORT_DEPARTMENT', 'support department')}
|
|
388
|
+
</OText>
|
|
391
389
|
</OText>
|
|
392
|
-
|
|
390
|
+
)
|
|
393
391
|
)
|
|
394
392
|
|
|
395
393
|
return (
|
|
@@ -4,6 +4,7 @@ import { OIcon, OButton, OText } from '../shared'
|
|
|
4
4
|
import { ImageStyle, TextStyle, View, Platform, TouchableOpacity } from 'react-native'
|
|
5
5
|
import { useConfig, useLanguage, useOrder } from 'ordering-components/native'
|
|
6
6
|
import { useTheme } from 'styled-components/native'
|
|
7
|
+
|
|
7
8
|
const Wrapper = styled.View`
|
|
8
9
|
background-color: ${(props: any) => props.theme.colors.white};
|
|
9
10
|
padding: 10px 0px 20px 0px;
|
|
@@ -65,28 +66,27 @@ const NavBar = (props: Props) => {
|
|
|
65
66
|
|
|
66
67
|
return (
|
|
67
68
|
<Wrapper style={{ paddingTop: props.paddingTop, ...props.style }}>
|
|
68
|
-
{(props?.onActionLeft) && (
|
|
69
|
+
{(props?.onActionLeft || props?.leftImg) && (
|
|
69
70
|
<OButton
|
|
70
|
-
imgLeftSrc={props.leftImg}
|
|
71
|
+
imgLeftSrc={props.leftImg || theme.images.general.arrow_left}
|
|
71
72
|
imgRightSrc={null}
|
|
72
73
|
style={{ ...btnBackArrow, ...props.btnStyle }}
|
|
73
74
|
onClick={props.onActionLeft}
|
|
74
|
-
imgLeftStyle={props.imgLeftStyle}
|
|
75
|
-
{...(!props.leftImg && { iconProps: { name: 'arrowleft', size: 28, color: props.btnStyle?.color } })}
|
|
75
|
+
imgLeftStyle= {props.imgLeftStyle}
|
|
76
76
|
/>)
|
|
77
77
|
}
|
|
78
78
|
<TitleTopWrapper>
|
|
79
79
|
{props.withIcon
|
|
80
80
|
? (
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
81
|
+
<OIcon
|
|
82
|
+
url={props.icon}
|
|
83
|
+
style={{
|
|
84
|
+
borderColor: theme.colors.lightGray,
|
|
85
|
+
borderRadius: 20,
|
|
86
|
+
}}
|
|
87
|
+
width={60}
|
|
88
|
+
height={60}
|
|
89
|
+
/>
|
|
90
90
|
)
|
|
91
91
|
: null
|
|
92
92
|
}
|
|
@@ -134,7 +134,7 @@ const NavBar = (props: Props) => {
|
|
|
134
134
|
</View>
|
|
135
135
|
)}
|
|
136
136
|
|
|
137
|
-
{props.rightComponent}
|
|
137
|
+
{ props.rightComponent }
|
|
138
138
|
</Wrapper>
|
|
139
139
|
)
|
|
140
140
|
}
|
|
@@ -15,8 +15,6 @@ import { Container } from '../../layouts/Container'
|
|
|
15
15
|
import NavBar from '../NavBar'
|
|
16
16
|
import { LANDSCAPE, PORTRAIT, useDeviceOrientation } from '../../../../../src/hooks/DeviceOrientation'
|
|
17
17
|
import GridContainer from '../../layouts/GridContainer'
|
|
18
|
-
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
19
|
-
import MaterialIcon from 'react-native-vector-icons/MaterialCommunityIcons'
|
|
20
18
|
|
|
21
19
|
const OrderTypeSelectorCardUI = (props: OrderTypeSelectParams) => {
|
|
22
20
|
const {
|
|
@@ -29,7 +27,7 @@ const OrderTypeSelectorCardUI = (props: OrderTypeSelectParams) => {
|
|
|
29
27
|
callback
|
|
30
28
|
} = props
|
|
31
29
|
|
|
32
|
-
|
|
30
|
+
const theme = useTheme();
|
|
33
31
|
const [, t] = useLanguage();
|
|
34
32
|
const [orientationState] = useDeviceOrientation();
|
|
35
33
|
const [orderState] = useOrder()
|
|
@@ -47,7 +45,7 @@ const OrderTypeSelectorCardUI = (props: OrderTypeSelectParams) => {
|
|
|
47
45
|
}
|
|
48
46
|
|
|
49
47
|
useEffect(() => {
|
|
50
|
-
if
|
|
48
|
+
if(isCardCliked){
|
|
51
49
|
callback?.()
|
|
52
50
|
setIsCardClicked(false)
|
|
53
51
|
setIsLoadingCard(null)
|
|
@@ -85,13 +83,13 @@ const OrderTypeSelectorCardUI = (props: OrderTypeSelectParams) => {
|
|
|
85
83
|
style={cardStyle}
|
|
86
84
|
isDisabled={isCardCliked}
|
|
87
85
|
isLoading={isLoadingCard === 'Eat In'}
|
|
88
|
-
title={t('EAT_IN',
|
|
86
|
+
title={t('EAT_IN','Eat In')}
|
|
89
87
|
description={t('EAT_IN_DESCRIPTION', 'We are very glad to have you here. Bon appetit!')}
|
|
90
88
|
bgImage={theme.images.general.eatIn}
|
|
91
|
-
|
|
89
|
+
icon={theme.images.general.pushPin}
|
|
92
90
|
callToActionText={t('START_MY_ORDER', 'Start my order')}
|
|
93
91
|
onClick={() => {
|
|
94
|
-
if
|
|
92
|
+
if(_eatIn?.value !== orderState?.options?.type){
|
|
95
93
|
handleChangeOrderType(_eatIn?.value);
|
|
96
94
|
setIsCardClicked(true)
|
|
97
95
|
setIsLoadingCard('Eat In')
|
|
@@ -108,15 +106,15 @@ const OrderTypeSelectorCardUI = (props: OrderTypeSelectParams) => {
|
|
|
108
106
|
|
|
109
107
|
<OptionCard
|
|
110
108
|
style={cardStyle}
|
|
111
|
-
title={t('TAKE_OUT',
|
|
109
|
+
title={t('TAKE_OUT','Take out')}
|
|
112
110
|
isDisabled={isCardCliked}
|
|
113
111
|
isLoading={isLoadingCard === 'Take out'}
|
|
114
112
|
description={t('TAKE_OUT_DESCRIPTION', 'You are very welcome anytime you visit us!')}
|
|
115
113
|
bgImage={theme.images.general.takeOut}
|
|
116
|
-
|
|
114
|
+
icon={theme.images.general.shoppingCart}
|
|
117
115
|
callToActionText={t('START_MY_ORDER', 'Start my order')}
|
|
118
116
|
onClick={() => {
|
|
119
|
-
if
|
|
117
|
+
if(_takeOut?.value !== orderState?.options?.type){
|
|
120
118
|
handleChangeOrderType(_takeOut?.value);
|
|
121
119
|
setIsCardClicked(true)
|
|
122
120
|
setIsLoadingCard('Take out')
|
|
@@ -7,7 +7,7 @@ import { Wrapper } from './styles'
|
|
|
7
7
|
|
|
8
8
|
import { PhoneInputParams } from '../../../../../src/types';
|
|
9
9
|
import { OText } from '../shared';
|
|
10
|
-
import {transformCountryCode} from '../../../../../src/utils'
|
|
10
|
+
import { transformCountryCode, verifyCountryCode } from '../../../../../src/utils'
|
|
11
11
|
import {I18nManager} from 'react-native'
|
|
12
12
|
import { useTheme } from 'styled-components/native';
|
|
13
13
|
|
|
@@ -89,7 +89,7 @@ export const PhoneInputNumber = (props: PhoneInputParams) => {
|
|
|
89
89
|
containerStyle={{ width: '100%' }}
|
|
90
90
|
ref={phoneInput}
|
|
91
91
|
defaultValue={userphoneNumber || defaultValue}
|
|
92
|
-
defaultCode={defaultCode ? transformCountryCode(defaultCode) : configs?.default_country_code?.value}
|
|
92
|
+
defaultCode={defaultCode ? transformCountryCode(defaultCode) : verifyCountryCode(configs?.default_country_code?.value)}
|
|
93
93
|
onChangeFormattedText={(text : string) => handleChangeNumber(text)}
|
|
94
94
|
withDarkTheme
|
|
95
95
|
textInputStyle={{textAlign: I18nManager.isRTL ? 'right' : 'left'}}
|
|
@@ -10,8 +10,6 @@ import {
|
|
|
10
10
|
|
|
11
11
|
import * as React from 'react';
|
|
12
12
|
import styled from 'styled-components/native';
|
|
13
|
-
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
14
|
-
import { Icon, IconProps } from 'react-native-vector-icons/Icon';
|
|
15
13
|
|
|
16
14
|
const StyledButton = styled.View<Props>`
|
|
17
15
|
background-color: ${(props: any) => props.theme.colors.primary};
|
|
@@ -79,19 +77,17 @@ interface Props {
|
|
|
79
77
|
isCircle?: boolean;
|
|
80
78
|
bgColor?: string;
|
|
81
79
|
borderColor?: string;
|
|
82
|
-
iconProps?: IconProps;
|
|
83
|
-
IconCustom?: React.FunctionComponent
|
|
84
80
|
}
|
|
85
81
|
|
|
86
82
|
const OButton = (props: Props): React.ReactElement => {
|
|
87
83
|
if (props.isDisabled) {
|
|
88
84
|
return (
|
|
89
85
|
<View style={props.parentStyle}>
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
86
|
+
<StyledButtonDisabled style={props.style}>
|
|
87
|
+
<StyledTextDisabled style={props.disabledTextStyle ? props.disabledTextStyle : props.textStyle}>
|
|
88
|
+
{props.text}
|
|
89
|
+
</StyledTextDisabled>
|
|
90
|
+
</StyledButtonDisabled>
|
|
95
91
|
</View>
|
|
96
92
|
);
|
|
97
93
|
}
|
|
@@ -115,15 +111,6 @@ const OButton = (props: Props): React.ReactElement => {
|
|
|
115
111
|
{props.imgLeftSrc ? (
|
|
116
112
|
<StyledImage style={props.imgLeftStyle} source={props.imgLeftSrc} />
|
|
117
113
|
) : null}
|
|
118
|
-
{props.iconProps ? (
|
|
119
|
-
<>
|
|
120
|
-
{props?.IconCustom ? (
|
|
121
|
-
<props.IconCustom {...props.iconProps} />
|
|
122
|
-
) : (
|
|
123
|
-
<AntDesignIcon {...props.iconProps} />
|
|
124
|
-
)}
|
|
125
|
-
</>
|
|
126
|
-
) : null}
|
|
127
114
|
{props.text ? (
|
|
128
115
|
<StyledText style={props.textStyle}>{props.text}</StyledText>
|
|
129
116
|
) : null}
|