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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useState, useCallback } from 'react'
|
|
2
2
|
|
|
3
3
|
import { Platform, StyleSheet, View, TouchableOpacity, ScrollView } from 'react-native';
|
|
4
|
+
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
4
5
|
|
|
5
6
|
import { OButton, OText, OLink, OModal } from '../shared'
|
|
6
7
|
import {
|
|
@@ -53,9 +54,16 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
53
54
|
const WIDTH_SCREEN = orientationState?.dimensions?.width
|
|
54
55
|
|
|
55
56
|
const [openReviewModal, setOpenReviewModal] = useState(false)
|
|
57
|
+
const [showCustomFields, setShowCustomFields] = useState<boolean>(false);
|
|
56
58
|
|
|
57
|
-
const [isReadMore, setIsReadMore] = useState(
|
|
58
|
-
|
|
59
|
+
const [isReadMore, setIsReadMore] = useState({
|
|
60
|
+
customerAddress: false,
|
|
61
|
+
businessAddressNotes: false
|
|
62
|
+
})
|
|
63
|
+
const [lengthMore, setLengthMore] = useState({
|
|
64
|
+
customerAddress: false,
|
|
65
|
+
businessAddressNotes: false
|
|
66
|
+
})
|
|
59
67
|
|
|
60
68
|
const pastOrderStatuses = [1, 2, 5, 6, 10, 11, 12, 16, 17]
|
|
61
69
|
|
|
@@ -105,11 +113,19 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
105
113
|
}
|
|
106
114
|
|
|
107
115
|
const containsOnlyNumbers = (str: string) => {
|
|
116
|
+
str = str?.replace('+', '');
|
|
108
117
|
return /^\d+$/.test(str);
|
|
109
118
|
}
|
|
110
119
|
|
|
111
|
-
const onTextLayout = useCallback((e: any) => {
|
|
112
|
-
|
|
120
|
+
const onTextLayout = useCallback((e: any, item: string) => {
|
|
121
|
+
if (item === 'customerAddress') {
|
|
122
|
+
const customerAddressMore = (e.nativeEvent.lines.length == 2 && e.nativeEvent.lines[1].width > WIDTH_SCREEN * .76) || e.nativeEvent.lines.length > 2
|
|
123
|
+
setLengthMore(prev => ({ ...prev, customerAddress: customerAddressMore }))
|
|
124
|
+
}
|
|
125
|
+
if (item === 'businessAddressNotes') {
|
|
126
|
+
const businessAddressNotesMore = (e.nativeEvent.lines.length == 3 && e.nativeEvent.lines[2].width > WIDTH_SCREEN * .76) || e.nativeEvent.lines.length > 3
|
|
127
|
+
setLengthMore(prev => ({ ...prev, businessAddressNotes: businessAddressNotesMore }))
|
|
128
|
+
}
|
|
113
129
|
}, []);
|
|
114
130
|
|
|
115
131
|
return (
|
|
@@ -120,27 +136,36 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
120
136
|
|
|
121
137
|
{order?.metafields?.length > 0 && (
|
|
122
138
|
<OrderBusiness>
|
|
123
|
-
<
|
|
124
|
-
{
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
139
|
+
<TouchableOpacity onPress={() => setShowCustomFields((prev: boolean) => !prev)} style={{ flexDirection: 'row', width: '100%', justifyContent: 'space-between', alignItems: 'flex-start' }}>
|
|
140
|
+
<OText style={{ marginBottom: 5 }} size={16} weight="600">
|
|
141
|
+
{t('CUSTOM_FIELDS', 'Custom fields')}
|
|
142
|
+
</OText>
|
|
143
|
+
<AntDesignIcon
|
|
144
|
+
name={showCustomFields ? 'up' : 'down'}
|
|
145
|
+
size={14}
|
|
146
|
+
/>
|
|
147
|
+
</TouchableOpacity>
|
|
148
|
+
{showCustomFields && (
|
|
149
|
+
<>
|
|
150
|
+
{order.metafields.map((field: any) => (
|
|
151
|
+
<View
|
|
152
|
+
key={field.id}
|
|
153
|
+
style={{
|
|
154
|
+
width: '100%',
|
|
155
|
+
flexDirection: 'row',
|
|
156
|
+
marginBottom: 5
|
|
157
|
+
}}
|
|
158
|
+
>
|
|
159
|
+
<OText style={{ width: '50%' }}>
|
|
160
|
+
{field.key}
|
|
161
|
+
</OText>
|
|
162
|
+
<OText style={{ width: '45%', textAlign: 'right' }}>
|
|
163
|
+
{field.value}
|
|
164
|
+
</OText>
|
|
165
|
+
</View>
|
|
166
|
+
))}
|
|
167
|
+
</>
|
|
168
|
+
)}
|
|
144
169
|
</OrderBusiness>
|
|
145
170
|
)}
|
|
146
171
|
|
|
@@ -170,7 +195,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
170
195
|
<OLink
|
|
171
196
|
PressStyle={styles.linkWithIcons}
|
|
172
197
|
url={`tel:${containsOnlyNumbers(order?.business?.cellphone) ? order?.business?.cellphone : 'invalid'}`}
|
|
173
|
-
shorcut={`${order?.business?.cellphone}`}
|
|
198
|
+
shorcut={`${(!!order?.business?.country_phone_code && !order?.business?.cellphone?.includes('+')) ? '+' + order?.business?.country_phone_code : ''}${order?.business?.cellphone}`}
|
|
174
199
|
TextStyle={styles.textLink}
|
|
175
200
|
/>
|
|
176
201
|
</View>
|
|
@@ -180,8 +205,8 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
180
205
|
<View style={styles.linkWithIcons}>
|
|
181
206
|
<OLink
|
|
182
207
|
PressStyle={styles.linkWithIcons}
|
|
183
|
-
url={`tel:${containsOnlyNumbers(order?.business?.
|
|
184
|
-
shorcut={order?.business?.phone}
|
|
208
|
+
url={`tel:${containsOnlyNumbers(order?.business?.phone) ? order?.business?.phone : 'invalid'}`}
|
|
209
|
+
shorcut={`${(!!order?.business?.country_phone_code && !order?.business?.phone?.includes('+')) ? '+' + order?.business?.country_phone_code : ''}${order?.business?.phone}`}
|
|
185
210
|
TextStyle={styles.textLink}
|
|
186
211
|
/>
|
|
187
212
|
</View>
|
|
@@ -209,17 +234,28 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
209
234
|
</OText>
|
|
210
235
|
)}
|
|
211
236
|
{!!order?.business?.address_notes && (
|
|
212
|
-
|
|
213
|
-
<
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
237
|
+
<>
|
|
238
|
+
<View style={styles.linkWithIcons}>
|
|
239
|
+
<OLink
|
|
240
|
+
PressStyle={styles.linkWithIcons}
|
|
241
|
+
url={Platform.select({
|
|
242
|
+
ios: `maps:0,0?q=${order?.business?.address_notes}`,
|
|
243
|
+
android: `geo:0,0?q=${order?.business?.address_notes}`,
|
|
244
|
+
})}
|
|
245
|
+
shorcut={order?.business?.address_notes}
|
|
246
|
+
TextStyle={styles.textLink}
|
|
247
|
+
onTextLayout={e => onTextLayout(e, 'businessAddressNotes')}
|
|
248
|
+
numberOfLines={isReadMore.businessAddressNotes ? 20 : 3}
|
|
249
|
+
/>
|
|
250
|
+
</View>
|
|
251
|
+
{lengthMore.businessAddressNotes && (
|
|
252
|
+
<TouchableOpacity
|
|
253
|
+
onPress={() => setIsReadMore({ ...isReadMore, businessAddressNotes: !isReadMore.businessAddressNotes })}
|
|
254
|
+
>
|
|
255
|
+
<OText size={12} color={theme.colors.statusOrderBlue}>{isReadMore.businessAddressNotes ? t('SHOW_LESS', 'Show less') : t('READ_MORE', 'Read more')}</OText>
|
|
256
|
+
</TouchableOpacity>
|
|
257
|
+
)}
|
|
258
|
+
</>
|
|
223
259
|
)}
|
|
224
260
|
</OrderBusiness>
|
|
225
261
|
|
|
@@ -301,7 +337,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
301
337
|
<OLink
|
|
302
338
|
PressStyle={styles.linkWithIcons}
|
|
303
339
|
url={`tel:${!!order?.customer?.country_phone_code ? '+' + order?.customer?.country_phone_code : ''} ${containsOnlyNumbers(order?.customer?.cellphone) ? order?.customer?.cellphone : 'invalid'}`}
|
|
304
|
-
shorcut={`${!!order?.customer?.country_phone_code ? '+' + order?.customer?.country_phone_code : ''}
|
|
340
|
+
shorcut={`${!!order?.customer?.country_phone_code ? '+' + order?.customer?.country_phone_code : ''}${order?.customer?.cellphone}`}
|
|
305
341
|
TextStyle={styles.textLink}
|
|
306
342
|
/>
|
|
307
343
|
</View>
|
|
@@ -311,8 +347,8 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
311
347
|
<View style={styles.linkWithIcons}>
|
|
312
348
|
<OLink
|
|
313
349
|
PressStyle={styles.linkWithIcons}
|
|
314
|
-
url={`tel:${containsOnlyNumbers(order?.customer?.phone) ? order?.customer?.phone : 'invalid'}`}
|
|
315
|
-
shorcut={order?.customer?.phone}
|
|
350
|
+
url={`tel:${!!order?.customer?.country_phone_code ? '+' + order?.customer?.country_phone_code : ''} ${containsOnlyNumbers(order?.customer?.phone) ? order?.customer?.phone : 'invalid'}`}
|
|
351
|
+
shorcut={`${!!order?.customer?.country_phone_code ? '+' + order?.customer?.country_phone_code : ''}${order?.customer?.phone}`}
|
|
316
352
|
TextStyle={styles.textLink}
|
|
317
353
|
/>
|
|
318
354
|
</View>
|
|
@@ -327,15 +363,17 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
327
363
|
ios: `maps:0,0?q=${order?.customer?.address}`,
|
|
328
364
|
android: `geo:0,0?q=${order?.customer?.address}`,
|
|
329
365
|
})}
|
|
330
|
-
onTextLayout={onTextLayout}
|
|
331
|
-
numberOfLines={isReadMore ? 20 : 2}
|
|
366
|
+
onTextLayout={e => onTextLayout(e, 'customerAddress')}
|
|
367
|
+
numberOfLines={isReadMore.customerAddress ? 20 : 2}
|
|
332
368
|
shorcut={order?.customer?.address}
|
|
333
369
|
TextStyle={styles.textLink}
|
|
334
370
|
/>
|
|
335
371
|
</View>
|
|
336
|
-
{lengthMore && (
|
|
337
|
-
<TouchableOpacity
|
|
338
|
-
|
|
372
|
+
{lengthMore.customerAddress && (
|
|
373
|
+
<TouchableOpacity
|
|
374
|
+
onPress={() => setIsReadMore({ ...isReadMore, customerAddress: !isReadMore.customerAddress })}
|
|
375
|
+
>
|
|
376
|
+
<OText size={12} color={theme.colors.statusOrderBlue}>{isReadMore.customerAddress ? t('SHOW_LESS', 'Show less') : t('READ_MORE', 'Read more')}</OText>
|
|
339
377
|
</TouchableOpacity>
|
|
340
378
|
)}
|
|
341
379
|
</>
|
|
@@ -550,15 +588,14 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
550
588
|
</Table>
|
|
551
589
|
))
|
|
552
590
|
}
|
|
553
|
-
{order?.summary?.driver_tip > 0 && (
|
|
591
|
+
{(order?.summary?.driver_tip > 0 || order?.driver_tip > 0) && (
|
|
554
592
|
<Table>
|
|
555
593
|
<OText mBottom={4}>
|
|
556
594
|
{t('DRIVER_TIP', 'Driver tip')}
|
|
557
|
-
{order?.
|
|
558
|
-
parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
|
|
595
|
+
{order?.driver_tip > 0 && parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
|
|
559
596
|
!parseInt(configs?.driver_tip_use_custom?.value, 10) &&
|
|
560
597
|
(
|
|
561
|
-
`(${verifyDecimals(order?.
|
|
598
|
+
`(${verifyDecimals(order?.driver_tip, parseNumber)}%)`
|
|
562
599
|
)}
|
|
563
600
|
</OText>
|
|
564
601
|
<OText mBottom={4}>{parsePrice(order?.summary?.driver_tip ?? order?.totalDriverTip, { currency: order?.currency })}</OText>
|
|
@@ -263,6 +263,12 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
263
263
|
)}
|
|
264
264
|
</>
|
|
265
265
|
</OText>
|
|
266
|
+
{order?.external_id && (
|
|
267
|
+
<OText size={13}>
|
|
268
|
+
<OText size={13} weight='bold'>{`${t('EXTERNAL_ID', 'External ID :')} `}</OText>
|
|
269
|
+
{order?.external_id}
|
|
270
|
+
</OText>
|
|
271
|
+
)}
|
|
266
272
|
{!order?.isLogistic && !!order?.delivery_type && (!order?.order_group_id || !logisticOrderStatus?.includes(order?.status)) && (
|
|
267
273
|
<>
|
|
268
274
|
<OText size={13}>
|
|
@@ -275,12 +281,12 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
275
281
|
{t(order?.delivery_option?.name?.toUpperCase()?.replace(/ /g, '_'), order?.delivery_option?.name)}
|
|
276
282
|
</OText>
|
|
277
283
|
)}
|
|
278
|
-
|
|
279
|
-
<
|
|
284
|
+
<OText>
|
|
285
|
+
<OText size={13} weight='bold'>
|
|
286
|
+
{`${t('PAYMENT_METHODS', 'Payment methods')}: `}
|
|
287
|
+
</OText>
|
|
288
|
+
{order?.payment_events?.length > 0 ? (
|
|
280
289
|
<OText size={13}>
|
|
281
|
-
<OText size={13} weight='bold'>
|
|
282
|
-
{`${t('PAYMENT_METHODS', 'Payment methods')}: `}
|
|
283
|
-
</OText>
|
|
284
290
|
{order?.payment_events?.map((event: any, idx: number) => {
|
|
285
291
|
return event?.wallet_event
|
|
286
292
|
? idx < order?.payment_events?.length - 1
|
|
@@ -291,7 +297,21 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
291
297
|
: t(event?.paymethod?.name?.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)
|
|
292
298
|
})}
|
|
293
299
|
</OText>
|
|
294
|
-
|
|
300
|
+
) : (
|
|
301
|
+
<OText size={13}>{t(order?.paymethod?.gateway?.toUpperCase(), order?.paymethod?.name)}</OText>
|
|
302
|
+
)}
|
|
303
|
+
</OText>
|
|
304
|
+
{order?.spot_number && (
|
|
305
|
+
<OText size={13}>
|
|
306
|
+
<OText size={13} weight='bold'>
|
|
307
|
+
{`${order?.delivery_type === 3
|
|
308
|
+
? t('EATIN_SPOT_NUMBER', 'Table number')
|
|
309
|
+
: order?.delivery_type === 5
|
|
310
|
+
? t('DRIVE_THRU_SPOT_NUMBER', 'Drive thru lane')
|
|
311
|
+
: t('CURBSIDE_SPOT_NUMBER', 'Spot number')}: `}
|
|
312
|
+
</OText>
|
|
313
|
+
{order.spot_number}
|
|
314
|
+
</OText>
|
|
295
315
|
)}
|
|
296
316
|
</>
|
|
297
317
|
)}
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
useLanguage,
|
|
11
11
|
OrderDetails as OrderDetailsConTableoller,
|
|
12
12
|
useSession,
|
|
13
|
+
useConfig
|
|
13
14
|
} from 'ordering-components/native';
|
|
14
15
|
|
|
15
16
|
//Components
|
|
@@ -34,6 +35,8 @@ export const OrderDetailsLogisticUI = (props: OrderDetailsLogisticParams) => {
|
|
|
34
35
|
const theme = useTheme();
|
|
35
36
|
const [, t] = useLanguage();
|
|
36
37
|
const [session] = useSession();
|
|
38
|
+
const [{ configs }] = useConfig();
|
|
39
|
+
|
|
37
40
|
const [alertState, setAlertState] = useState<{
|
|
38
41
|
open: boolean;
|
|
39
42
|
content: Array<string>;
|
|
@@ -41,6 +44,7 @@ export const OrderDetailsLogisticUI = (props: OrderDetailsLogisticParams) => {
|
|
|
41
44
|
}>({ open: false, content: [], key: null });
|
|
42
45
|
|
|
43
46
|
const logisticOrderStatus = [4, 6, 7]
|
|
47
|
+
const isHideRejectButtons = configs?.reject_orders_enabled && configs?.reject_orders_enabled?.value !== '1'
|
|
44
48
|
|
|
45
49
|
const showFloatButtonsAcceptOrReject: any = {
|
|
46
50
|
0: true,
|
|
@@ -166,7 +170,8 @@ export const OrderDetailsLogisticUI = (props: OrderDetailsLogisticParams) => {
|
|
|
166
170
|
secondButton={true}
|
|
167
171
|
firstColorCustom={theme.colors.red}
|
|
168
172
|
secondColorCustom={theme.colors.green}
|
|
169
|
-
widthButton={'45%'}
|
|
173
|
+
widthButton={isHideRejectButtons ? '100%': '45%'}
|
|
174
|
+
isHideRejectButtons={isHideRejectButtons}
|
|
170
175
|
/>
|
|
171
176
|
)}
|
|
172
177
|
</>
|
|
@@ -80,6 +80,9 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
|
|
|
80
80
|
!parseInt(configs?.driver_tip_use_custom?.value, 10) &&
|
|
81
81
|
verifyDecimals(order?.summary?.driver_tip, parseNumber);
|
|
82
82
|
|
|
83
|
+
const customerName = `${order?.customer?.name ?? ''} ${order?.customer?.middle_name ?? ''} ${order?.customer?.lastname ?? ''} ${order?.customer?.second_lastname ?? ''
|
|
84
|
+
}`?.replace(' ', ' ')?.trim() ?? ''
|
|
85
|
+
|
|
83
86
|
const orderSummary = () => {
|
|
84
87
|
return `
|
|
85
88
|
<div>
|
|
@@ -100,9 +103,7 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
|
|
|
100
103
|
</p>
|
|
101
104
|
|
|
102
105
|
<h1>${t('CUSTOMER_DETAILS', 'Customer details')}</h1>
|
|
103
|
-
<p style="font-size: 27px"> ${t('FULL_NAME', 'Full Name')}: ${
|
|
104
|
-
} ${order?.customer?.middle_name} ${order?.customer?.lastname} ${order?.customer?.second_lastname
|
|
105
|
-
}
|
|
106
|
+
<p style="font-size: 27px"> ${t('FULL_NAME', 'Full Name')}: ${customerName}
|
|
106
107
|
</br>
|
|
107
108
|
${t('EMAIL', 'Email')}: ${order?.customer?.email}
|
|
108
109
|
</br>
|
|
@@ -373,8 +374,8 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
|
|
|
373
374
|
|
|
374
375
|
<OText style={{ marginBottom: 5 }}>
|
|
375
376
|
{`${t('DELIVERY_DATE', 'Delivery Date')}: ${order?.delivery_datetime_utc
|
|
376
|
-
|
|
377
|
-
|
|
377
|
+
? parseDate(order?.delivery_datetime_utc)
|
|
378
|
+
: parseDate(order?.delivery_datetime, { utc: false })
|
|
378
379
|
}`}
|
|
379
380
|
</OText>
|
|
380
381
|
|
|
@@ -400,9 +401,7 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
|
|
|
400
401
|
adjustsFontSizeToFit
|
|
401
402
|
ellipsizeMode="tail"
|
|
402
403
|
color={theme.colors.textGray}>
|
|
403
|
-
{`${t('FULL_NAME', 'Full Name')}: ${
|
|
404
|
-
} ${order?.customer?.lastname} ${order?.customer?.second_lastname
|
|
405
|
-
}`}
|
|
404
|
+
{`${t('FULL_NAME', 'Full Name')}: ${customerName}`}
|
|
406
405
|
</OText>
|
|
407
406
|
|
|
408
407
|
<OText
|
|
@@ -40,6 +40,7 @@ import { OrdersOptionPaymethod } from '../OrdersOptionPaymethod';
|
|
|
40
40
|
import { OrdersOptionDriver } from '../OrdersOptionDriver';
|
|
41
41
|
import { OrdersOptionDate } from '../OrdersOptionDate';
|
|
42
42
|
import { OrderDetailsBusiness } from '../OrderDetails/Business';
|
|
43
|
+
import { WebsocketStatus } from '../WebsocketStatus'
|
|
43
44
|
|
|
44
45
|
const { useDeviceOrientation, PORTRAIT } = DeviceOrientationMethods
|
|
45
46
|
|
|
@@ -314,7 +315,11 @@ const OrdersListManagerUI = (props: OrdersOptionParams) => {
|
|
|
314
315
|
</View>
|
|
315
316
|
{configState?.configs?.order_deadlines_enabled?.value === '1' && (
|
|
316
317
|
<View style={styles.SLAwrapper}>
|
|
317
|
-
<View style={{ flex:
|
|
318
|
+
<View style={{ flex: 1 }}>
|
|
319
|
+
<WebsocketStatus />
|
|
320
|
+
</View>
|
|
321
|
+
<View style={{ width: 10, height: '100%' }} />
|
|
322
|
+
<View style={{ flex: 1 }}>
|
|
318
323
|
<OButton
|
|
319
324
|
text={t('SLA_SETTING', 'SLA’s Settings')}
|
|
320
325
|
textStyle={{ color: theme.colors.backArrow }}
|
|
@@ -330,7 +335,7 @@ const OrdersListManagerUI = (props: OrdersOptionParams) => {
|
|
|
330
335
|
/>
|
|
331
336
|
</View>
|
|
332
337
|
<View style={{ width: 10, height: '100%' }} />
|
|
333
|
-
<View style={{ flex:
|
|
338
|
+
<View style={{ flex: 1, justifyContent: 'center' }}>
|
|
334
339
|
<SelectDropdown
|
|
335
340
|
defaultButtonText={t('SLA', 'SLA\'s')}
|
|
336
341
|
data={preorderTypeList}
|
|
@@ -209,7 +209,7 @@ export const Timer = () => {
|
|
|
209
209
|
return (
|
|
210
210
|
<TimerInputWrapper>
|
|
211
211
|
<OText style={styles.settingTime} color={theme.colors.disabled}>{configs?.order_deadlines_delayed_time?.value}</OText>
|
|
212
|
-
<OText>{t('
|
|
212
|
+
<OText>{t('TIME_MIN', 'min')}</OText>
|
|
213
213
|
</TimerInputWrapper>
|
|
214
214
|
)
|
|
215
215
|
}
|
|
@@ -6,12 +6,14 @@ import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
|
|
|
6
6
|
import FeatherIcon from 'react-native-vector-icons/Feather';
|
|
7
7
|
import FontistoIcon from 'react-native-vector-icons/Fontisto'
|
|
8
8
|
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
9
|
+
|
|
9
10
|
import { useTheme } from 'styled-components/native';
|
|
10
11
|
import { DeviceOrientationMethods } from '../../../../../src/hooks/DeviceOrientation'
|
|
11
12
|
import { NotificationSetting } from '../../../../../src/components/NotificationSetting'
|
|
12
13
|
import { NewOrderNotification } from '../NewOrderNotification';
|
|
14
|
+
import { WebsocketStatus } from '../WebsocketStatus'
|
|
13
15
|
|
|
14
|
-
import { OText, OButton, OModal,
|
|
16
|
+
import { OText, OButton, OModal, OInput, OIcon } from '../shared';
|
|
15
17
|
import { NotFoundSource } from '../NotFoundSource';
|
|
16
18
|
import {
|
|
17
19
|
FiltersTab,
|
|
@@ -73,6 +75,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
73
75
|
|
|
74
76
|
const defaultSearchList = {
|
|
75
77
|
id: '',
|
|
78
|
+
external_id: '',
|
|
76
79
|
state: '',
|
|
77
80
|
city: '',
|
|
78
81
|
business: '',
|
|
@@ -92,35 +95,11 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
92
95
|
const [{ parseDate }] = useUtils()
|
|
93
96
|
const [configState] = useConfig()
|
|
94
97
|
const [orientationState] = useDeviceOrientation();
|
|
95
|
-
const [, { showToast }] = useToast();
|
|
96
98
|
const [openSearchModal, setOpenSearchModal] = useState(false)
|
|
97
99
|
const [openSLASettingModal, setOpenSLASettingModal] = useState(false)
|
|
98
100
|
const [slaSettingTime, setSlaSettingTime] = useState(6000)
|
|
99
101
|
const [currentDeliveryType, setCurrentDeliveryType] = useState('Delivery')
|
|
100
102
|
const [search, setSearch] = useState(defaultSearchList)
|
|
101
|
-
const [selectedTabStatus, setSelectedTabStatus] = useState<any>([])
|
|
102
|
-
const [hour, setHour] = useState(0)
|
|
103
|
-
const [minute, setMinute] = useState(0)
|
|
104
|
-
const [openedSelect, setOpenedSelect] = useState('')
|
|
105
|
-
const WIDTH_SCREEN = orientationState?.dimensions?.width
|
|
106
|
-
const HEIGHT_SCREEN = orientationState?.dimensions?.height
|
|
107
|
-
const IS_PORTRAIT = orientationState.orientation === PORTRAIT
|
|
108
|
-
|
|
109
|
-
const preorderTypeList = [
|
|
110
|
-
{ key: null, name: t('SLA', 'SLA\'s') },
|
|
111
|
-
{ key: 'in_time', name: t('OK', 'Ok') },
|
|
112
|
-
{ key: 'at_risk', name: t('AT_RISK', 'At Risk') },
|
|
113
|
-
{ key: 'delayed', name: t('DELAYED', 'Delayed') }
|
|
114
|
-
]
|
|
115
|
-
|
|
116
|
-
const defaultOrderTypes = [
|
|
117
|
-
{ key: 1, name: t('DELIVERY', 'Delivery') },
|
|
118
|
-
{ key: 2, name: t('PICKUP', 'Pickup') },
|
|
119
|
-
{ key: 3, name: t('EAT_IN', 'Eat in') },
|
|
120
|
-
{ key: 4, name: t('CURBSIDE', 'Curbside') },
|
|
121
|
-
{ key: 5, name: t('DRIVE_THRU', 'Drive thru') }
|
|
122
|
-
]
|
|
123
|
-
|
|
124
103
|
const deliveryStatus = [
|
|
125
104
|
{
|
|
126
105
|
key: t('OK', 'Ok'),
|
|
@@ -144,6 +123,26 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
144
123
|
backColor: '#E63757'
|
|
145
124
|
}
|
|
146
125
|
]
|
|
126
|
+
const [selectedTabStatus, setSelectedTabStatus] = useState<any>(deliveryStatus)
|
|
127
|
+
const [openedSelect, setOpenedSelect] = useState('')
|
|
128
|
+
|
|
129
|
+
const HEIGHT_SCREEN = orientationState?.dimensions?.height
|
|
130
|
+
const IS_PORTRAIT = orientationState.orientation === PORTRAIT
|
|
131
|
+
|
|
132
|
+
const preorderTypeList = [
|
|
133
|
+
{ key: null, name: t('SLA', 'SLA\'s') },
|
|
134
|
+
{ key: 'in_time', name: t('OK', 'Ok') },
|
|
135
|
+
{ key: 'at_risk', name: t('AT_RISK', 'At Risk') },
|
|
136
|
+
{ key: 'delayed', name: t('DELAYED', 'Delayed') }
|
|
137
|
+
]
|
|
138
|
+
|
|
139
|
+
const defaultOrderTypes = [
|
|
140
|
+
{ key: 1, name: t('DELIVERY', 'Delivery') },
|
|
141
|
+
{ key: 2, name: t('PICKUP', 'Pickup') },
|
|
142
|
+
{ key: 3, name: t('EAT_IN', 'Eat in') },
|
|
143
|
+
{ key: 4, name: t('CURBSIDE', 'Curbside') },
|
|
144
|
+
{ key: 5, name: t('DRIVE_THRU', 'Drive thru') }
|
|
145
|
+
]
|
|
147
146
|
|
|
148
147
|
const styles = StyleSheet.create({
|
|
149
148
|
header: {
|
|
@@ -385,10 +384,6 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
385
384
|
setTags({ values: [] })
|
|
386
385
|
}, [currentTabSelected])
|
|
387
386
|
|
|
388
|
-
useEffect(() => {
|
|
389
|
-
setSelectedTabStatus(deliveryStatus)
|
|
390
|
-
}, [])
|
|
391
|
-
|
|
392
387
|
return (
|
|
393
388
|
<>
|
|
394
389
|
<View style={styles.header}>
|
|
@@ -409,6 +404,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
409
404
|
/>
|
|
410
405
|
</IconWrapper>
|
|
411
406
|
</View>
|
|
407
|
+
<WebsocketStatus />
|
|
412
408
|
{configState?.configs?.order_deadlines_enabled?.value === '1' && (
|
|
413
409
|
<View style={styles.SLAwrapper}>
|
|
414
410
|
<View style={{ flex: 0.5 }}>
|
|
@@ -610,6 +606,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
610
606
|
orderTitle={props.orderDetailsProps?.orderTitle}
|
|
611
607
|
handleChangeOrderStatus={handleChangeOrderStatus}
|
|
612
608
|
handleSendCustomerReview={handleSendCustomerReview}
|
|
609
|
+
isBusinessApp={isBusinessApp}
|
|
613
610
|
/>
|
|
614
611
|
)}
|
|
615
612
|
{!logisticOrders?.error?.length &&
|
|
@@ -620,6 +617,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
620
617
|
onNavigationRedirect={onNavigationRedirect}
|
|
621
618
|
getOrderStatus={getOrderStatus}
|
|
622
619
|
handleClickLogisticOrder={handleClickLogisticOrder}
|
|
620
|
+
isBusinessApp={isBusinessApp}
|
|
623
621
|
isLogisticOrder
|
|
624
622
|
/>
|
|
625
623
|
)
|
|
@@ -730,6 +728,21 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
730
728
|
onPress={() => setSearch({ ...search, id: '' })}
|
|
731
729
|
/>
|
|
732
730
|
</InputContainer>
|
|
731
|
+
<InputContainer>
|
|
732
|
+
<OInput
|
|
733
|
+
value={search.external_id}
|
|
734
|
+
onChange={(value: any) => setSearch({ ...search, external_id: value })}
|
|
735
|
+
style={styles.inputStyle}
|
|
736
|
+
placeholder={t('EXTERNAL_ID', 'External id')}
|
|
737
|
+
autoCorrect={false}
|
|
738
|
+
/>
|
|
739
|
+
<AntDesignIcon
|
|
740
|
+
name='close'
|
|
741
|
+
size={20}
|
|
742
|
+
style={{ position: 'absolute', right: 12, top: 13 }}
|
|
743
|
+
onPress={() => setSearch({ ...search, external_id: '' })}
|
|
744
|
+
/>
|
|
745
|
+
</InputContainer>
|
|
733
746
|
<OrdersOptionDate
|
|
734
747
|
{...props}
|
|
735
748
|
search={search}
|
|
@@ -919,15 +932,13 @@ export const Timer = () => {
|
|
|
919
932
|
return (
|
|
920
933
|
<TimerInputWrapper>
|
|
921
934
|
<OText style={styles.settingTime} color={theme.colors.disabled}>{configs?.order_deadlines_delayed_time?.value}</OText>
|
|
922
|
-
<OText>{t('
|
|
935
|
+
<OText>{t('TIME_MIN', 'min')}</OText>
|
|
923
936
|
</TimerInputWrapper>
|
|
924
937
|
)
|
|
925
938
|
}
|
|
926
939
|
|
|
927
940
|
export const OrdersOption = (props: OrdersOptionParams) => {
|
|
928
941
|
const [, t] = useLanguage();
|
|
929
|
-
const [configState] = useConfig()
|
|
930
|
-
const theme = useTheme()
|
|
931
942
|
const [checkNotificationStatus, setCheckNotificationStatus] = useState({ open: false, checked: false })
|
|
932
943
|
const ordersProps = {
|
|
933
944
|
...props,
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { Dimensions, View, StyleSheet } from 'react-native'
|
|
3
|
+
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder'
|
|
4
|
+
import { OButton } from '../shared'
|
|
5
|
+
import { useTheme } from 'styled-components/native'
|
|
6
|
+
import { useLanguage } from 'ordering-components/native'
|
|
7
|
+
|
|
8
|
+
export const FooterComponent = (props : any) => {
|
|
9
|
+
const {
|
|
10
|
+
loading,
|
|
11
|
+
reload,
|
|
12
|
+
pagination,
|
|
13
|
+
tabsFilter,
|
|
14
|
+
tabs,
|
|
15
|
+
loadMore
|
|
16
|
+
} = props
|
|
17
|
+
|
|
18
|
+
const theme = useTheme()
|
|
19
|
+
const [, t] = useLanguage()
|
|
20
|
+
|
|
21
|
+
const [orientation, setOrientation] = useState(
|
|
22
|
+
Dimensions.get('window').width < Dimensions.get('window').height
|
|
23
|
+
? 'Portrait'
|
|
24
|
+
: 'Landscape',
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
Dimensions.addEventListener('change', ({ window: { width, height } }) => {
|
|
28
|
+
if (width < height) {
|
|
29
|
+
setOrientation('Portrait');
|
|
30
|
+
} else {
|
|
31
|
+
setOrientation('Landscape');
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const styles = StyleSheet.create({
|
|
36
|
+
loadButton: {
|
|
37
|
+
borderRadius: 7.6,
|
|
38
|
+
height: 44,
|
|
39
|
+
marginRight: 10,
|
|
40
|
+
marginBottom: 10,
|
|
41
|
+
marginTop: 5,
|
|
42
|
+
},
|
|
43
|
+
loadButtonText: {
|
|
44
|
+
color: theme.colors.white,
|
|
45
|
+
fontFamily: 'Poppins',
|
|
46
|
+
fontStyle: 'normal',
|
|
47
|
+
fontWeight: 'normal',
|
|
48
|
+
fontSize: 18,
|
|
49
|
+
},
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<>
|
|
54
|
+
{(loading || reload) && (
|
|
55
|
+
<>
|
|
56
|
+
<View>
|
|
57
|
+
{[...Array(5)].map((item, i) => (
|
|
58
|
+
<Placeholder key={i} Animation={Fade}>
|
|
59
|
+
<View
|
|
60
|
+
style={{
|
|
61
|
+
width: '100%',
|
|
62
|
+
flexDirection: 'row',
|
|
63
|
+
marginBottom: 10,
|
|
64
|
+
}}>
|
|
65
|
+
<PlaceholderLine
|
|
66
|
+
width={orientation === 'Portrait' ? 22 : 11}
|
|
67
|
+
height={74}
|
|
68
|
+
style={{
|
|
69
|
+
marginRight: 20,
|
|
70
|
+
marginBottom: 20,
|
|
71
|
+
borderRadius: 7.6,
|
|
72
|
+
}}
|
|
73
|
+
/>
|
|
74
|
+
<Placeholder>
|
|
75
|
+
<PlaceholderLine width={30} style={{ marginTop: 5 }} />
|
|
76
|
+
<PlaceholderLine width={50} />
|
|
77
|
+
<PlaceholderLine width={20} />
|
|
78
|
+
</Placeholder>
|
|
79
|
+
</View>
|
|
80
|
+
</Placeholder>
|
|
81
|
+
))}
|
|
82
|
+
</View>
|
|
83
|
+
</>
|
|
84
|
+
)}
|
|
85
|
+
|
|
86
|
+
{pagination?.totalPages &&
|
|
87
|
+
!loading &&
|
|
88
|
+
!reload &&
|
|
89
|
+
JSON.stringify(tabsFilter) === JSON.stringify(tabs[0].tags) &&
|
|
90
|
+
pagination?.currentPage < pagination?.totalPages && (
|
|
91
|
+
<OButton
|
|
92
|
+
onClick={() => loadMore && loadMore()}
|
|
93
|
+
text={t('LOAD_MORE_ORDERS', 'Load more orders')}
|
|
94
|
+
imgRightSrc={null}
|
|
95
|
+
textStyle={styles.loadButtonText}
|
|
96
|
+
style={styles.loadButton}
|
|
97
|
+
bgColor={theme.colors.primary}
|
|
98
|
+
borderColor={theme.colors.primary}
|
|
99
|
+
/>
|
|
100
|
+
)}
|
|
101
|
+
</>
|
|
102
|
+
)
|
|
103
|
+
}
|