ordering-ui-react-native 0.19.0-testing → 0.19.1-release
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -5
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessInformation/index.tsx +10 -9
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +3 -2
- package/src/utils/index.tsx +2 -2
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +14 -7
- package/themes/business/src/components/BusinessController/index.tsx +19 -17
- package/themes/business/src/components/BusinessProductList/AccordionDropdown.tsx +63 -0
- package/themes/business/src/components/BusinessProductList/IterateCategories.tsx +108 -0
- package/themes/business/src/components/BusinessProductList/ProductList.tsx +196 -0
- package/themes/business/src/components/BusinessProductList/index.tsx +196 -0
- package/themes/business/src/components/BusinessProductList/styles.tsx +10 -0
- package/themes/business/src/components/Chat/index.tsx +41 -13
- package/themes/business/src/components/DriverMap/index.tsx +4 -2
- package/themes/business/src/components/DriverSchedule/index.tsx +16 -6
- package/themes/business/src/components/FloatingButton/index.tsx +34 -31
- package/themes/business/src/components/MapView/index.tsx +11 -7
- package/themes/business/src/components/MessagesOption/index.tsx +22 -94
- package/themes/business/src/components/NewOrderNotification/index.tsx +121 -104
- package/themes/business/src/components/OrderDetails/Delivery.tsx +19 -10
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +88 -51
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +26 -6
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +6 -1
- package/themes/business/src/components/OrderSummary/index.tsx +7 -8
- 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 +43 -32
- 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 +21 -28
- package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
- package/themes/business/src/components/PreviousOrders/index.tsx +192 -220
- package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
- package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
- package/themes/business/src/components/SearchBar/index.tsx +2 -1
- package/themes/business/src/components/StoresList/index.tsx +5 -3
- package/themes/business/src/components/UserProfileForm/index.tsx +9 -8
- package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
- package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
- package/themes/business/src/types/index.tsx +9 -0
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/original/index.tsx +7 -3
- package/themes/original/src/components/AddressForm/index.tsx +2 -2
- package/themes/original/src/components/AddressForm/styles.tsx +1 -1
- package/themes/original/src/components/AddressList/index.tsx +4 -7
- package/themes/original/src/components/AddressList/styles.tsx +4 -4
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +3 -3
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
- package/themes/original/src/components/BusinessController/index.tsx +9 -6
- package/themes/original/src/components/BusinessController/styles.tsx +8 -7
- package/themes/original/src/components/BusinessInformation/index.tsx +35 -3
- package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
- package/themes/original/src/components/BusinessListingSearch/index.tsx +56 -361
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
- package/themes/original/src/components/BusinessPreorder/index.tsx +3 -4
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
- package/themes/original/src/components/BusinessProductsList/index.tsx +2 -2
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +35 -15
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +3 -4
- package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +29 -402
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
- package/themes/original/src/components/Cart/index.tsx +25 -6
- package/themes/original/src/components/CartContent/index.tsx +61 -39
- package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +136 -19
- package/themes/original/src/components/Checkout/styles.tsx +17 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
- package/themes/original/src/components/DatePicker/index.tsx +17 -0
- package/themes/original/src/components/DatePicker/styles.tsx +20 -0
- package/themes/original/src/components/Favorite/index.tsx +4 -9
- package/themes/original/src/components/Favorite/styles.tsx +0 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/index.tsx +1 -1
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +67 -4
- package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GoogleMap/index.tsx +50 -5
- 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 +1 -1
- package/themes/original/src/components/LastOrder/index.tsx +2 -1
- package/themes/original/src/components/LastOrders/index.tsx +2 -1
- package/themes/original/src/components/LoginForm/Otp/index.tsx +53 -47
- package/themes/original/src/components/LoginForm/index.tsx +6 -1
- package/themes/original/src/components/Messages/index.tsx +9 -4
- package/themes/original/src/components/Messages/styles.tsx +1 -1
- package/themes/original/src/components/MomentOption/index.tsx +4 -4
- package/themes/original/src/components/MomentSelector/index.tsx +1 -1
- package/themes/original/src/components/MultiCart/index.tsx +1 -1
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +13 -4
- package/themes/original/src/components/MultiCheckout/index.tsx +184 -51
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +1 -1
- package/themes/original/src/components/MyOrders/index.tsx +5 -5
- package/themes/original/src/components/NavBar/index.tsx +3 -1
- package/themes/original/src/components/NetworkError/index.tsx +2 -3
- package/themes/original/src/components/NetworkError/styles.tsx +2 -2
- package/themes/original/src/components/Notifications/index.tsx +4 -8
- package/themes/original/src/components/Notifications/styles.tsx +0 -1
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +7 -3
- package/themes/original/src/components/OrderDetails/index.tsx +717 -667
- package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
- package/themes/original/src/components/OrderProgress/index.tsx +7 -7
- package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
- package/themes/original/src/components/OrderSummary/index.tsx +5 -3
- package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -6
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/index.tsx +4 -3
- 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/PaymentOptionStripe/styles.tsx +3 -0
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +41 -32
- package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -1
- package/themes/original/src/components/ProductForm/ActionButton.tsx +120 -0
- package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
- package/themes/original/src/components/ProductForm/index.tsx +81 -167
- package/themes/original/src/components/ProductForm/styles.tsx +1 -1
- package/themes/original/src/components/ProductItemAccordion/index.tsx +5 -0
- 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 +4 -4
- package/themes/original/src/components/Promotions/styles.tsx +0 -2
- package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
- package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
- package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
- package/themes/original/src/components/ServiceForm/index.tsx +2 -2
- package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
- package/themes/original/src/components/SingleOrderCard/index.tsx +4 -3
- package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
- package/themes/original/src/components/StripeCardsList/index.tsx +53 -7
- package/themes/original/src/components/StripeElementsForm/index.tsx +1 -1
- package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
- package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
- package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +86 -0
- package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
- package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
- package/themes/original/src/components/UserFormDetails/index.tsx +53 -7
- package/themes/original/src/components/UserProfile/index.tsx +1 -1
- package/themes/original/src/components/UserProfileForm/index.tsx +30 -36
- package/themes/original/src/components/UserVerification/index.tsx +55 -50
- package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
- package/themes/original/src/components/Wallets/index.tsx +8 -9
- package/themes/original/src/components/Wallets/styles.tsx +1 -1
- package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
- package/themes/original/src/components/shared/OInput.tsx +1 -4
- package/themes/original/src/components/shared/OModal.tsx +12 -14
- package/themes/original/src/layouts/Container.tsx +5 -3
- package/themes/original/src/types/index.tsx +10 -2
- package/themes/original/src/utils/index.tsx +124 -0
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
- package/src/navigators/BottomNavigator.tsx +0 -117
- package/src/navigators/CheckoutNavigator.tsx +0 -66
- package/src/navigators/HomeNavigator.tsx +0 -202
- package/src/navigators/NavigationRef.tsx +0 -7
- package/src/navigators/RootNavigator.tsx +0 -269
- package/src/pages/Account.tsx +0 -34
- package/src/pages/AddressForm.tsx +0 -62
- package/src/pages/AddressList.tsx +0 -24
- package/src/pages/BusinessProductsList.tsx +0 -81
- package/src/pages/BusinessesListing.tsx +0 -43
- package/src/pages/CartList.tsx +0 -49
- package/src/pages/Checkout.tsx +0 -101
- package/src/pages/ForgotPassword.tsx +0 -24
- package/src/pages/Help.tsx +0 -23
- package/src/pages/HelpAccountAndPayment.tsx +0 -23
- package/src/pages/HelpGuide.tsx +0 -23
- package/src/pages/HelpOrder.tsx +0 -23
- package/src/pages/Home.tsx +0 -36
- package/src/pages/IntroductoryTutorial.tsx +0 -170
- package/src/pages/Login.tsx +0 -47
- package/src/pages/MomentOption.tsx +0 -30
- package/src/pages/MultiCheckout.tsx +0 -31
- package/src/pages/MultiOrdersDetails.tsx +0 -27
- package/src/pages/MyOrders.tsx +0 -40
- package/src/pages/NetworkError.tsx +0 -24
- package/src/pages/NotFound.tsx +0 -22
- package/src/pages/OrderDetails.tsx +0 -25
- package/src/pages/ProductDetails.tsx +0 -55
- package/src/pages/Profile.tsx +0 -36
- package/src/pages/ReviewDriver.tsx +0 -30
- package/src/pages/ReviewOrder.tsx +0 -32
- package/src/pages/ReviewProducts.tsx +0 -30
- package/src/pages/Sessions.tsx +0 -22
- package/src/pages/Signup.tsx +0 -53
- package/src/pages/SpinnerLoader.tsx +0 -10
- package/src/pages/Splash.tsx +0 -21
|
@@ -3,10 +3,11 @@ import {
|
|
|
3
3
|
useLanguage,
|
|
4
4
|
PurchaseGiftCard as PurchaseGiftCardController
|
|
5
5
|
} from 'ordering-components/native'
|
|
6
|
-
import { StyleSheet, View, TouchableOpacity, ScrollView } from 'react-native'
|
|
6
|
+
import { StyleSheet, View, TouchableOpacity, ScrollView, Platform } from 'react-native'
|
|
7
7
|
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
|
|
8
8
|
import { useTheme } from 'styled-components/native';
|
|
9
9
|
import { OText, OButton, OIcon } from '../../shared';
|
|
10
|
+
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
10
11
|
|
|
11
12
|
import {
|
|
12
13
|
Container
|
|
@@ -17,7 +18,8 @@ const PurchaseGiftCardUI = (props: any) => {
|
|
|
17
18
|
productsListState,
|
|
18
19
|
selectedProduct,
|
|
19
20
|
setSelectedProduct,
|
|
20
|
-
handleAccept
|
|
21
|
+
handleAccept,
|
|
22
|
+
onClose
|
|
21
23
|
} = props
|
|
22
24
|
|
|
23
25
|
const theme = useTheme()
|
|
@@ -42,7 +44,38 @@ const PurchaseGiftCardUI = (props: any) => {
|
|
|
42
44
|
|
|
43
45
|
return (
|
|
44
46
|
<Container>
|
|
45
|
-
<
|
|
47
|
+
<View style={{
|
|
48
|
+
marginBottom: 40,
|
|
49
|
+
marginTop: Platform.OS === 'ios' ? 30 : 50,
|
|
50
|
+
display: 'flex',
|
|
51
|
+
flexDirection: 'row',
|
|
52
|
+
alignItems: 'center',
|
|
53
|
+
}}>
|
|
54
|
+
<OButton
|
|
55
|
+
imgLeftStyle={{ width: 18 }}
|
|
56
|
+
imgRightSrc={null}
|
|
57
|
+
style={{
|
|
58
|
+
borderWidth: 0,
|
|
59
|
+
width: 26,
|
|
60
|
+
height: 26,
|
|
61
|
+
backgroundColor: '#FFF',
|
|
62
|
+
borderColor: '#FFF',
|
|
63
|
+
shadowColor: '#FFF',
|
|
64
|
+
paddingLeft: 0,
|
|
65
|
+
paddingRight: 0,
|
|
66
|
+
}}
|
|
67
|
+
onClick={onClose}
|
|
68
|
+
icon={AntDesignIcon}
|
|
69
|
+
iconProps={{
|
|
70
|
+
name: 'arrowleft',
|
|
71
|
+
size: 26,
|
|
72
|
+
style: {
|
|
73
|
+
color: theme.colors.textNormal
|
|
74
|
+
}
|
|
75
|
+
}}
|
|
76
|
+
/>
|
|
77
|
+
<OText color={theme.colors.textNormal} weight='bold' size={20} mLeft={10}>{t('PURCHASE_GIFT_CARD', 'Purchase gift card')}</OText>
|
|
78
|
+
</View>
|
|
46
79
|
<OText color={theme.colors.textNormal} size={14}>{t('SELECT_ONE_OPTION', 'Select one option')}</OText>
|
|
47
80
|
<ScrollView
|
|
48
81
|
contentContainerStyle={{
|
|
@@ -3,9 +3,10 @@ import {
|
|
|
3
3
|
useLanguage, useUtils, RedeemGiftCard as RedeemGiftCardController
|
|
4
4
|
} from 'ordering-components/native'
|
|
5
5
|
import { useForm, Controller } from 'react-hook-form'
|
|
6
|
-
import { StyleSheet, View, Alert } from 'react-native';
|
|
6
|
+
import { StyleSheet, View, Alert, Platform } from 'react-native';
|
|
7
7
|
import { useTheme } from 'styled-components/native';
|
|
8
8
|
import { OText, OButton, OInput } from '../../shared';
|
|
9
|
+
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
9
10
|
|
|
10
11
|
import {
|
|
11
12
|
Container,
|
|
@@ -93,7 +94,38 @@ const RedeemGiftCardUI = (props: any) => {
|
|
|
93
94
|
<Container>
|
|
94
95
|
{!redeemedGiftCard ? (
|
|
95
96
|
<View>
|
|
96
|
-
<
|
|
97
|
+
<View style={{
|
|
98
|
+
marginBottom: 40,
|
|
99
|
+
marginTop: Platform.OS === 'ios' ? 30 : 50,
|
|
100
|
+
display: 'flex',
|
|
101
|
+
flexDirection: 'row',
|
|
102
|
+
alignItems: 'center',
|
|
103
|
+
}}>
|
|
104
|
+
<OButton
|
|
105
|
+
imgLeftStyle={{ width: 18 }}
|
|
106
|
+
imgRightSrc={null}
|
|
107
|
+
style={{
|
|
108
|
+
borderWidth: 0,
|
|
109
|
+
width: 26,
|
|
110
|
+
height: 26,
|
|
111
|
+
backgroundColor: '#FFF',
|
|
112
|
+
borderColor: '#FFF',
|
|
113
|
+
shadowColor: '#FFF',
|
|
114
|
+
paddingLeft: 0,
|
|
115
|
+
paddingRight: 0,
|
|
116
|
+
}}
|
|
117
|
+
onClick={onClose}
|
|
118
|
+
icon={AntDesignIcon}
|
|
119
|
+
iconProps={{
|
|
120
|
+
name: 'arrowleft',
|
|
121
|
+
size: 26,
|
|
122
|
+
style: {
|
|
123
|
+
color: theme.colors.textNormal
|
|
124
|
+
}
|
|
125
|
+
}}
|
|
126
|
+
/>
|
|
127
|
+
<OText color={theme.colors.textNormal} weight='bold' size={20} mLeft={10}>{t('REDEEM_GIFT_CARD', 'Redeem a gift card')}</OText>
|
|
128
|
+
</View>
|
|
97
129
|
<FormController>
|
|
98
130
|
<OText color={theme.colors.textNormal} size={14} mBottom={10}>{t('GIFT_CARD_CODE', 'Gift card code')}</OText>
|
|
99
131
|
<Controller
|
|
@@ -106,7 +138,7 @@ const RedeemGiftCardUI = (props: any) => {
|
|
|
106
138
|
onChange(val)
|
|
107
139
|
handleChangeCode(val)
|
|
108
140
|
}}
|
|
109
|
-
autoCapitalize='
|
|
141
|
+
autoCapitalize='characters'
|
|
110
142
|
autoCorrect={false}
|
|
111
143
|
blurOnSubmit={false}
|
|
112
144
|
style={style.inputStyle}
|
|
@@ -156,7 +188,38 @@ const RedeemGiftCardUI = (props: any) => {
|
|
|
156
188
|
</View>
|
|
157
189
|
) : (
|
|
158
190
|
<>
|
|
159
|
-
<
|
|
191
|
+
<View style={{
|
|
192
|
+
marginBottom: 40,
|
|
193
|
+
marginTop: Platform.OS === 'ios' ? 30 : 50,
|
|
194
|
+
display: 'flex',
|
|
195
|
+
flexDirection: 'row',
|
|
196
|
+
alignItems: 'center',
|
|
197
|
+
}}>
|
|
198
|
+
<OButton
|
|
199
|
+
imgLeftStyle={{ width: 18 }}
|
|
200
|
+
imgRightSrc={null}
|
|
201
|
+
style={{
|
|
202
|
+
borderWidth: 0,
|
|
203
|
+
width: 26,
|
|
204
|
+
height: 26,
|
|
205
|
+
backgroundColor: '#FFF',
|
|
206
|
+
borderColor: '#FFF',
|
|
207
|
+
shadowColor: '#FFF',
|
|
208
|
+
paddingLeft: 0,
|
|
209
|
+
paddingRight: 0,
|
|
210
|
+
}}
|
|
211
|
+
onClick={onClose}
|
|
212
|
+
icon={AntDesignIcon}
|
|
213
|
+
iconProps={{
|
|
214
|
+
name: 'arrowleft',
|
|
215
|
+
size: 26,
|
|
216
|
+
style: {
|
|
217
|
+
color: theme.colors.textNormal
|
|
218
|
+
}
|
|
219
|
+
}}
|
|
220
|
+
/>
|
|
221
|
+
<OText color={theme.colors.textNormal} weight='bold' size={20} mLeft={10}>{t('GIFT_CARD', 'Gift card')}</OText>
|
|
222
|
+
</View>
|
|
160
223
|
<View>
|
|
161
224
|
<OText color={theme.colors.textNormal} size={14} mBottom={6}>{t('TYPE', 'Type')}: {redeemedGiftCard?.type}</OText>
|
|
162
225
|
<OText color={theme.colors.textNormal} size={14} mBottom={6}>{t('AMOUNT', 'Amount')}: {parsePrice(redeemedGiftCard?.amount)}</OText>
|
|
@@ -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';
|
|
@@ -19,7 +19,9 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
19
19
|
setSaveLocation,
|
|
20
20
|
handleToggleMap,
|
|
21
21
|
locations,
|
|
22
|
-
isIntGeoCoder
|
|
22
|
+
isIntGeoCoder,
|
|
23
|
+
businessZones,
|
|
24
|
+
delta
|
|
23
25
|
} = props
|
|
24
26
|
|
|
25
27
|
const [, t] = useLanguage()
|
|
@@ -30,8 +32,8 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
30
32
|
const [region, setRegion] = useState({
|
|
31
33
|
latitude: location.lat,
|
|
32
34
|
longitude: location.lng,
|
|
33
|
-
latitudeDelta: 0.0010,
|
|
34
|
-
longitudeDelta: 0.0010 * ASPECT_RATIO
|
|
35
|
+
latitudeDelta: delta ?? 0.0010,
|
|
36
|
+
longitudeDelta: (delta ?? 0.0010) * ASPECT_RATIO
|
|
35
37
|
})
|
|
36
38
|
const [MARKERS, SETMARKERS] = useState(locations)
|
|
37
39
|
let mapRef = useRef<any>(null)
|
|
@@ -44,6 +46,19 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
44
46
|
ERROR_MAX_LIMIT_LOCATION: `Sorry, You can only set the position to ${maxLimitLocation}m`
|
|
45
47
|
}
|
|
46
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
|
+
|
|
47
62
|
const geocodePosition = (pos: { latitude: number, longitude: number }, isMovingRegion ?: boolean) => {
|
|
48
63
|
Geocoder.from({
|
|
49
64
|
latitude: pos.latitude,
|
|
@@ -69,7 +84,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
69
84
|
}
|
|
70
85
|
handleChangeAddressMap && handleChangeAddressMap(address, details)
|
|
71
86
|
setSaveLocation && setSaveLocation(false)
|
|
72
|
-
if(!isMovingRegion){
|
|
87
|
+
if(!isMovingRegion){
|
|
73
88
|
handleToggleMap && handleToggleMap()
|
|
74
89
|
}
|
|
75
90
|
} else {
|
|
@@ -230,6 +245,36 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
230
245
|
title={markerTitle || t('YOUR_LOCATION', 'Your Location')}
|
|
231
246
|
/>
|
|
232
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
|
+
))}
|
|
233
278
|
</MapView>
|
|
234
279
|
<Alert
|
|
235
280
|
open={alertState.open}
|
|
@@ -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()
|
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useState } from 'react'
|
|
2
2
|
import { formatSeconds } from '../../../utils'
|
|
3
|
-
import { StyleSheet, TouchableOpacity, View,
|
|
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
7
|
import { OText, OButton, OIcon } from '../../shared';
|
|
8
|
-
import OtpInputs from 'react-native-otp-inputs';
|
|
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,
|
|
20
|
-
otpError,
|
|
21
|
-
setOtpError
|
|
24
|
+
onSubmit,
|
|
22
25
|
} = props
|
|
23
26
|
|
|
24
27
|
const theme = useTheme();
|
|
@@ -26,8 +29,7 @@ export const Otp = (props: otpParams) => {
|
|
|
26
29
|
const [otpLeftTime, _, resetOtpLeftTime]: any = useCountdownTimer(
|
|
27
30
|
600, willVerifyOtpState)
|
|
28
31
|
|
|
29
|
-
const
|
|
30
|
-
const inputRef = useRef<any>()
|
|
32
|
+
const inputRef = useRef<OtpInputsRef | any>(null)
|
|
31
33
|
|
|
32
34
|
const handleOnSubmit = () => {
|
|
33
35
|
setAlertState({
|
|
@@ -38,14 +40,19 @@ export const Otp = (props: otpParams) => {
|
|
|
38
40
|
onSubmit()
|
|
39
41
|
}
|
|
40
42
|
|
|
41
|
-
const handleChangeCode = (code
|
|
42
|
-
|
|
43
|
-
|
|
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)
|
|
44
51
|
}
|
|
45
52
|
|
|
46
53
|
const handleCloseOtp = () => {
|
|
47
54
|
setWillVerifyOtpState(false)
|
|
48
|
-
setOtpError(null)
|
|
55
|
+
setOtpError && setOtpError(null)
|
|
49
56
|
}
|
|
50
57
|
|
|
51
58
|
useEffect(() => {
|
|
@@ -58,13 +65,6 @@ export const Otp = (props: otpParams) => {
|
|
|
58
65
|
}
|
|
59
66
|
}, [otpLeftTime])
|
|
60
67
|
|
|
61
|
-
useEffect(() => {
|
|
62
|
-
if (code?.length === (pinCount || 6)) {
|
|
63
|
-
handleLoginOtp(code)
|
|
64
|
-
inputRef?.current?.reset()
|
|
65
|
-
}
|
|
66
|
-
}, [code])
|
|
67
|
-
|
|
68
68
|
const loginStyle = StyleSheet.create({
|
|
69
69
|
container: {
|
|
70
70
|
width: '100%',
|
|
@@ -87,46 +87,48 @@ export const Otp = (props: otpParams) => {
|
|
|
87
87
|
fontSize: 16
|
|
88
88
|
},
|
|
89
89
|
wrapperIcon: {
|
|
90
|
-
marginTop: Platform.OS === 'ios' ? 40 : 12,
|
|
91
|
-
marginBottom: 20,
|
|
92
90
|
alignItems: 'center',
|
|
93
91
|
justifyContent: 'center',
|
|
94
|
-
paddingRight:
|
|
92
|
+
paddingRight: 20
|
|
95
93
|
},
|
|
96
94
|
closeContainer: {
|
|
97
95
|
width: '100%',
|
|
98
96
|
flexDirection: 'row',
|
|
97
|
+
alignItems: 'center'
|
|
98
|
+
},
|
|
99
|
+
checkingCode: {
|
|
100
|
+
height: 50,
|
|
101
|
+
width: '100%',
|
|
102
|
+
marginVertical: 30,
|
|
103
|
+
justifyContent: 'center',
|
|
104
|
+
alignItems: 'center'
|
|
99
105
|
}
|
|
100
106
|
});
|
|
101
107
|
|
|
102
108
|
return (
|
|
103
|
-
|
|
109
|
+
<SafeAreaView style={{ flex: 1, backgroundColor: theme.colors.backgroundPage }}>
|
|
104
110
|
<OTPContainer>
|
|
105
|
-
<View
|
|
106
|
-
style={loginStyle.closeContainer}>
|
|
107
|
-
<TouchableOpacity onPress={() => handleCloseOtp()} style={loginStyle.wrapperIcon}>
|
|
108
|
-
<OIcon
|
|
109
|
-
src={theme.images.general.close}
|
|
110
|
-
width={22}
|
|
111
|
-
/>
|
|
112
|
-
</TouchableOpacity>
|
|
113
|
-
<OText size={22} style={{
|
|
114
|
-
marginTop: 5
|
|
115
|
-
}}>
|
|
116
|
-
{t('ENTER_VERIFICATION_CODE', 'Enter verification code')}
|
|
117
|
-
</OText>
|
|
118
|
-
</View>
|
|
119
111
|
<OText size={24}>
|
|
120
112
|
{formatSeconds(otpLeftTime)}
|
|
121
113
|
</OText>
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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
|
+
)}
|
|
130
132
|
{!!otpError && (
|
|
131
133
|
<OText
|
|
132
134
|
color={theme?.colors?.error}
|
|
@@ -150,6 +152,10 @@ export const Otp = (props: otpParams) => {
|
|
|
150
152
|
text={t('CANCEL', 'Cancel')}
|
|
151
153
|
/>
|
|
152
154
|
</OTPContainer>
|
|
153
|
-
|
|
155
|
+
</SafeAreaView>
|
|
154
156
|
)
|
|
155
157
|
}
|
|
158
|
+
|
|
159
|
+
Otp.defaultProps = {
|
|
160
|
+
pinCount: 6
|
|
161
|
+
}
|
|
@@ -104,6 +104,8 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
104
104
|
const isOtpEmail = loginTab === 'otp' && otpType === 'email'
|
|
105
105
|
const isOtpCellphone = loginTab === 'otp' && otpType === 'cellphone'
|
|
106
106
|
|
|
107
|
+
const [isCheckingCode, setCheckingCode] = useState(false)
|
|
108
|
+
|
|
107
109
|
const googleLoginEnabled = configs?.google_login_enabled?.value === '1' || !configs?.google_login_enabled?.enabled
|
|
108
110
|
const facebookLoginEnabled = configs?.facebook_login_enabled?.value === '1' || !configs?.facebook_login_enabled?.enabled
|
|
109
111
|
const appleLoginEnabled = configs?.apple_login_enabled?.value === '1' || !configs?.apple_login_enabled?.enabled
|
|
@@ -179,7 +181,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
179
181
|
vibrateApp()
|
|
180
182
|
return
|
|
181
183
|
}
|
|
182
|
-
if (
|
|
184
|
+
if (otpType === 'cellphone' && phoneInputData?.error && !phoneInputData?.phone?.cellphone) {
|
|
183
185
|
showToast(ToastType.Error, t('PHONE_NUMBER_REQUIRED', 'Phone number is required'));
|
|
184
186
|
return
|
|
185
187
|
}
|
|
@@ -268,6 +270,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
268
270
|
const handleLoginOtp = async (code: string) => {
|
|
269
271
|
if (!code) return
|
|
270
272
|
const logged = await handleButtonLoginClick({ code })
|
|
273
|
+
setCheckingCode(false)
|
|
271
274
|
if (logged) {
|
|
272
275
|
setWillVerifyOtpState(false)
|
|
273
276
|
} else {
|
|
@@ -854,6 +857,8 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
854
857
|
animationType='slide'
|
|
855
858
|
>
|
|
856
859
|
<Otp
|
|
860
|
+
isCheckingCode={isCheckingCode}
|
|
861
|
+
setCheckingCode={setCheckingCode}
|
|
857
862
|
willVerifyOtpState={willVerifyOtpState}
|
|
858
863
|
otpError={otpError}
|
|
859
864
|
setOtpError={setOtpError}
|
|
@@ -126,9 +126,13 @@ const MessagesUI = (props: MessagesParams) => {
|
|
|
126
126
|
const messageConsole = (message: any) => {
|
|
127
127
|
return message.change?.attribute !== 'driver_id'
|
|
128
128
|
?
|
|
129
|
-
`${t('ORDER', 'Order')} ${t(message.change.attribute.toUpperCase(), message.change.attribute.replace('_', ' '))} ${t('CHANGED_FROM', 'Changed from')} ${filterSpecialStatus.includes(message.change.attribute)
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
`${t('ORDER', 'Order')} ${t(message.change.attribute.toUpperCase(), message.change.attribute.replace('_', ' '))} ${t('CHANGED_FROM', 'Changed from')} ${filterSpecialStatus.includes(message.change.attribute)
|
|
130
|
+
? `${message.change.old === null ? '0' : message.change.old} ${t('TO', 'to')} ${message.change.new} ${t('MINUTES', 'Minutes')}`
|
|
131
|
+
: `${message.change?.attribute !== 'logistic_status'
|
|
132
|
+
? message.change.old !== null && t(ORDER_STATUS[parseInt(message.change.old, 10)])
|
|
133
|
+
: message.change.old !== null && getLogisticTag(message.change.old)} ${t('TO', 'to')} ${message.change?.attribute !== 'logistic_status'
|
|
134
|
+
? t(ORDER_STATUS[parseInt(message.change.new, 10)])
|
|
135
|
+
: getLogisticTag(message.change.new)}`
|
|
132
136
|
}`
|
|
133
137
|
: message.change.new
|
|
134
138
|
?
|
|
@@ -148,6 +152,7 @@ const MessagesUI = (props: MessagesParams) => {
|
|
|
148
152
|
}
|
|
149
153
|
const newMessage: any = [];
|
|
150
154
|
messages.messages.map((message: any) => {
|
|
155
|
+
if (message.change?.attribute === 'driver_group_id') return
|
|
151
156
|
if (business && message.type !== 0 && (messagesToShow?.messages?.length || message?.can_see?.includes('2'))) {
|
|
152
157
|
newMessage.push({
|
|
153
158
|
_id: message?.id,
|
|
@@ -456,7 +461,7 @@ const MessagesUI = (props: MessagesParams) => {
|
|
|
456
461
|
active={business}
|
|
457
462
|
>
|
|
458
463
|
<OIcon
|
|
459
|
-
url={order?.business?.logo
|
|
464
|
+
url={order?.business?.logo}
|
|
460
465
|
width={32}
|
|
461
466
|
height={32}
|
|
462
467
|
style={{ borderRadius: 32 }}
|
|
@@ -10,7 +10,7 @@ export const Header = styled.View`
|
|
|
10
10
|
background-color: ${(props: any) => props.theme.colors.white};
|
|
11
11
|
box-shadow: 0 2px 2px #0000001A;
|
|
12
12
|
padding-bottom: 10px;
|
|
13
|
-
padding-horizontal:
|
|
13
|
+
padding-horizontal: 10px;
|
|
14
14
|
`
|
|
15
15
|
|
|
16
16
|
export const TitleHeader = styled.View``
|
|
@@ -155,7 +155,7 @@ const MomentOptionUI = (props: MomentOptionParams) => {
|
|
|
155
155
|
});
|
|
156
156
|
const { bottom } = useSafeAreaInsets();
|
|
157
157
|
|
|
158
|
-
const is12hours = configs?.
|
|
158
|
+
const is12hours = configs?.general_hour_format?.value?.includes('hh:mm')
|
|
159
159
|
|
|
160
160
|
const [selectedTime, setSelectedTime] = useState(null);
|
|
161
161
|
const [datesWhitelist, setDateWhitelist] = useState<any>([{ start: null, end: null }])
|
|
@@ -327,8 +327,8 @@ const MomentOptionUI = (props: MomentOptionParams) => {
|
|
|
327
327
|
<>
|
|
328
328
|
<Container
|
|
329
329
|
style={{
|
|
330
|
-
paddingLeft: !cateringPreorder || isPage ?
|
|
331
|
-
paddingRight: !cateringPreorder || isPage ?
|
|
330
|
+
paddingLeft: !cateringPreorder || isPage ? 20 : 0,
|
|
331
|
+
paddingRight: !cateringPreorder || isPage ? 20 : 0
|
|
332
332
|
}}
|
|
333
333
|
nestedScrollEnabled
|
|
334
334
|
>
|
|
@@ -467,7 +467,7 @@ const MomentOptionUI = (props: MomentOptionParams) => {
|
|
|
467
467
|
<Spinner visible={momentState.isLoading === 1} />
|
|
468
468
|
</Container>
|
|
469
469
|
{!isCart && !cateringPreorder && (
|
|
470
|
-
<View style={{ position: 'absolute', bottom: bottom, paddingBottom: 20, paddingHorizontal:
|
|
470
|
+
<View style={{ position: 'absolute', bottom: bottom, paddingBottom: 20, paddingHorizontal: 20, backgroundColor: 'white', width: '100%' }}>
|
|
471
471
|
<OButton onClick={() => handleChangeMoment()} isDisabled={!selectedTime} text={t('CONTINUE', 'Continue')} style={{ borderRadius: 7.6, height: 44, shadowOpacity: 0 }} textStyle={{ color: 'white', fontSize: 14 }} showNextIcon />
|
|
472
472
|
</View>
|
|
473
473
|
)}
|
|
@@ -30,7 +30,7 @@ const MomentSelectorUI = (props: any) => {
|
|
|
30
30
|
const [customizedDateList, setCustomizedDateList] = useState([])
|
|
31
31
|
const [customizedTimeList, setCustomizedTimeList] = useState([])
|
|
32
32
|
|
|
33
|
-
const is12hours = configs?.
|
|
33
|
+
const is12hours = configs?.general_hour_format?.value?.includes('hh:mm')
|
|
34
34
|
|
|
35
35
|
const styles = StyleSheet.create({
|
|
36
36
|
selectOption: {
|
|
@@ -11,7 +11,7 @@ export const MultiCartUI = () => {
|
|
|
11
11
|
const theme = useTheme();
|
|
12
12
|
return (
|
|
13
13
|
<Container noPadding>
|
|
14
|
-
<ChContainer style={{ paddingHorizontal:
|
|
14
|
+
<ChContainer style={{ paddingHorizontal: 20 }}>
|
|
15
15
|
<ChSection>
|
|
16
16
|
<ChUserDetails>
|
|
17
17
|
<Placeholder Animation={Fade}>
|