ordering-ui-react-native 0.21.86 → 0.21.87-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 -7
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/StripeMethodForm/index.tsx +6 -4
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/types/index.tsx +3 -1
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -6
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +1 -0
- package/themes/business/src/components/BusinessController/index.tsx +8 -3
- package/themes/business/src/components/BusinessProductList/index.tsx +2 -1
- package/themes/business/src/components/Chat/index.tsx +5 -2
- package/themes/business/src/components/DriverMap/index.tsx +49 -27
- package/themes/business/src/components/GoogleMap/index.tsx +15 -8
- package/themes/business/src/components/Home/index.tsx +5 -1
- package/themes/business/src/components/LanguageSelector/index.tsx +2 -3
- package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
- package/themes/business/src/components/LogoutButton/index.tsx +1 -1
- package/themes/business/src/components/MapView/index.tsx +36 -17
- package/themes/business/src/components/NewOrderNotification/index.tsx +69 -33
- package/themes/business/src/components/OrderDetails/Business.tsx +74 -9
- package/themes/business/src/components/OrderDetails/Delivery.tsx +131 -51
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +112 -41
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +55 -24
- package/themes/business/src/components/OrderDetails/styles.tsx +39 -3
- package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +221 -0
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +3 -2
- package/themes/business/src/components/OrderSummary/index.tsx +223 -73
- package/themes/business/src/components/OrdersListManager/index.tsx +13 -1
- package/themes/business/src/components/OrdersOption/index.tsx +251 -159
- package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
- package/themes/business/src/components/PreviousMessages/index.tsx +26 -3
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +42 -20
- package/themes/business/src/components/PreviousOrders/index.tsx +76 -66
- package/themes/business/src/components/PrinterEdition/MessageAlert.tsx +33 -0
- package/themes/business/src/components/PrinterEdition/index.tsx +431 -0
- package/themes/business/src/components/PrinterEdition/printerList.tsx +23 -0
- package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
- package/themes/business/src/components/PrinterSettings/index.tsx +267 -0
- package/themes/business/src/components/PrinterSettings/styles.tsx +30 -0
- package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
- package/themes/business/src/components/Sessions/index.tsx +1 -1
- package/themes/business/src/components/StoresList/index.tsx +2 -2
- package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
- package/themes/business/src/components/UserProfileForm/index.tsx +56 -35
- package/themes/business/src/components/WebsocketStatus/index.tsx +2 -2
- package/themes/business/src/components/shared/OInput.tsx +2 -0
- package/themes/business/src/components/shared/OTextarea.tsx +8 -9
- package/themes/business/src/hooks/useLocation.tsx +5 -4
- package/themes/business/src/layouts/SafeAreaContainer.tsx +35 -19
- package/themes/business/src/types/index.tsx +14 -4
- package/themes/business/src/utils/index.tsx +25 -1
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/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 +13 -1
- package/themes/original/src/components/AddressDetails/index.tsx +20 -10
- package/themes/original/src/components/AddressForm/index.tsx +32 -17
- package/themes/original/src/components/AddressList/index.tsx +8 -7
- package/themes/original/src/components/AnalyticsSegment/index.tsx +6 -6
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +5 -8
- package/themes/original/src/components/BusinessController/index.tsx +12 -7
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +13 -5
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +2 -3
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +1 -3
- package/themes/original/src/components/BusinessListingSearch/index.tsx +1 -2
- package/themes/original/src/components/BusinessPreorder/index.tsx +20 -15
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +5 -5
- 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 +18 -6
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +9 -8
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +1 -1
- 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 +43 -15
- package/themes/original/src/components/CartContent/index.tsx +21 -8
- package/themes/original/src/components/Checkout/index.tsx +109 -60
- package/themes/original/src/components/CitiesControl/index.tsx +0 -3
- package/themes/original/src/components/CouponControl/index.tsx +1 -3
- package/themes/original/src/components/DriverTips/index.tsx +1 -3
- package/themes/original/src/components/Favorite/index.tsx +1 -5
- package/themes/original/src/components/FavoriteList/index.tsx +0 -1
- package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -7
- package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
- package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +15 -17
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +3 -7
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +24 -32
- package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +7 -9
- package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
- package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
- package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +82 -0
- package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
- package/themes/original/src/components/GoogleMap/index.tsx +39 -18
- package/themes/original/src/components/Help/index.tsx +2 -0
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
- package/themes/original/src/components/Home/index.tsx +2 -10
- package/themes/original/src/components/LoginForm/Otp/index.tsx +0 -3
- package/themes/original/src/components/LoginForm/index.tsx +4 -7
- package/themes/original/src/components/MessageListing/index.tsx +2 -1
- package/themes/original/src/components/Messages/index.tsx +13 -9
- package/themes/original/src/components/MomentOption/index.tsx +13 -2
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +7 -3
- package/themes/original/src/components/MultiCheckout/index.tsx +139 -87
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +2 -1
- package/themes/original/src/components/MyOrders/index.tsx +21 -26
- package/themes/original/src/components/NavBar/index.tsx +7 -4
- package/themes/original/src/components/NetworkError/index.tsx +0 -5
- package/themes/original/src/components/NotFoundSource/index.tsx +0 -3
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +4 -3
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +13 -10
- package/themes/original/src/components/OrderDetails/index.tsx +42 -19
- package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
- package/themes/original/src/components/OrderProgress/index.tsx +26 -6
- package/themes/original/src/components/OrderSummary/index.tsx +28 -9
- package/themes/original/src/components/OrderTypeSelector/index.tsx +7 -6
- package/themes/original/src/components/OrdersOption/index.tsx +4 -6
- package/themes/original/src/components/PaymentOptionStripe/index.tsx +0 -5
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +17 -9
- package/themes/original/src/components/PlaceSpot/index.tsx +1 -3
- package/themes/original/src/components/PreviousOrders/index.tsx +1 -2
- package/themes/original/src/components/ProductForm/ActionButton.tsx +17 -20
- package/themes/original/src/components/ProductForm/index.tsx +107 -102
- package/themes/original/src/components/ProductItemAccordion/index.tsx +55 -49
- package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
- package/themes/original/src/components/ProfessionalProfile/index.tsx +4 -5
- package/themes/original/src/components/Promotions/index.tsx +6 -9
- package/themes/original/src/components/ReviewDriver/index.tsx +1 -1
- package/themes/original/src/components/ReviewOrder/index.tsx +2 -2
- package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
- package/themes/original/src/components/ReviewTrigger/index.tsx +2 -2
- package/themes/original/src/components/ServiceForm/index.tsx +52 -54
- package/themes/original/src/components/Sessions/index.tsx +3 -3
- package/themes/original/src/components/SignupForm/index.tsx +86 -78
- package/themes/original/src/components/SingleOrderCard/index.tsx +7 -5
- package/themes/original/src/components/SingleProductCard/index.tsx +3 -4
- package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
- package/themes/original/src/components/StripeCardForm/index.tsx +0 -3
- package/themes/original/src/components/StripeCardsList/index.tsx +10 -3
- package/themes/original/src/components/StripeElementsForm/index.tsx +77 -60
- package/themes/original/src/components/StripeElementsForm/naked.tsx +48 -1
- package/themes/original/src/components/StripeRedirectForm/index.tsx +0 -3
- package/themes/original/src/components/TaxInformation/index.tsx +3 -2
- package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +10 -7
- package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +8 -3
- package/themes/original/src/components/UserDetails/index.tsx +3 -2
- package/themes/original/src/components/UserFormDetails/index.tsx +154 -130
- package/themes/original/src/components/UserProfile/index.tsx +11 -2
- package/themes/original/src/components/Wallets/index.tsx +6 -3
- package/themes/original/src/components/WebsocketStatus/index.tsx +169 -0
- package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
- package/themes/original/src/components/shared/OAlert.tsx +2 -1
- package/themes/original/src/components/shared/OButton.tsx +5 -4
- package/themes/original/src/components/shared/OInput.tsx +4 -8
- package/themes/original/src/components/shared/OModal.tsx +7 -2
- package/themes/original/src/types/index.tsx +5 -1
- package/themes/original/src/utils/index.tsx +30 -1
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -230,7 +230,7 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
230
230
|
</BusinessInfoItem>
|
|
231
231
|
<OButton
|
|
232
232
|
onClick={() => onBusinessClick(business)}
|
|
233
|
-
textStyle={{
|
|
233
|
+
textStyle={{ fontSize: 10 }}
|
|
234
234
|
text={t('GO_TO_STORE', 'Go to store')}
|
|
235
235
|
style={{
|
|
236
236
|
borderRadius: 23,
|
|
@@ -238,7 +238,6 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
238
238
|
paddingRight: 10,
|
|
239
239
|
height: 23,
|
|
240
240
|
shadowOpacity: 0,
|
|
241
|
-
backgroundColor: theme.colors.primaryContrast,
|
|
242
241
|
borderWidth: 0
|
|
243
242
|
}}
|
|
244
243
|
/>
|
|
@@ -11,6 +11,8 @@ import { BusinessMenuList } from '../BusinessMenuList'
|
|
|
11
11
|
import Spinner from 'react-native-loading-spinner-overlay'
|
|
12
12
|
import { BusinessPreorderParams } from '../../types'
|
|
13
13
|
import moment from 'moment'
|
|
14
|
+
import { setLocalMoment } from '../../utils';
|
|
15
|
+
|
|
14
16
|
import SelectDropdown from 'react-native-select-dropdown'
|
|
15
17
|
import {
|
|
16
18
|
PreOrderContainer,
|
|
@@ -311,6 +313,10 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
|
|
|
311
313
|
}
|
|
312
314
|
}, [dateSelected])
|
|
313
315
|
|
|
316
|
+
useEffect(() => {
|
|
317
|
+
setLocalMoment(moment, t)
|
|
318
|
+
}, [])
|
|
319
|
+
|
|
314
320
|
useFocusEffect(
|
|
315
321
|
React.useCallback(() => {
|
|
316
322
|
handleAsap && handleAsap()
|
|
@@ -527,7 +533,6 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
|
|
|
527
533
|
)}
|
|
528
534
|
<OButton
|
|
529
535
|
text={t('GO_TO_MENU', 'Go to menu')}
|
|
530
|
-
textStyle={{ color: 'white' }}
|
|
531
536
|
style={{ borderRadius: 7.6, marginBottom: 20, marginTop: 30 }}
|
|
532
537
|
onClick={() => handleClickBusiness()}
|
|
533
538
|
isDisabled={isAsap || !(dateSelected && timeSelected)}
|
|
@@ -553,21 +558,21 @@ export const BusinessPreorder = (props: any) => {
|
|
|
553
558
|
currentDate.setMinutes(59)
|
|
554
559
|
|
|
555
560
|
const cateringTypeString = orderState?.options?.type === 7
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
561
|
+
? 'catering_delivery'
|
|
562
|
+
: orderState?.options?.type === 8
|
|
563
|
+
? 'catering_pickup'
|
|
564
|
+
: null
|
|
560
565
|
|
|
561
|
-
const splitCateringValue = (configName
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
const preorderSlotInterval = parseInt(splitCateringValue('preorder_slot_interval'))
|
|
567
|
-
const preorderLeadTime = parseInt(splitCateringValue('preorder_lead_time'))
|
|
568
|
-
const preorderTimeRange = parseInt(splitCateringValue('preorder_time_range'))
|
|
569
|
-
const preorderMaximumDays = parseInt(splitCateringValue('preorder_maximum_days'))
|
|
570
|
-
const preorderMinimumDays = parseInt(splitCateringValue('preorder_minimum_days'))
|
|
566
|
+
const splitCateringValue = (configName: string) =>
|
|
567
|
+
Object.values(props?.business?.configs || {})
|
|
568
|
+
?.find(config => config?.key === configName)
|
|
569
|
+
?.value?.split('|')
|
|
570
|
+
?.find(val => val.includes(cateringTypeString || ''))?.split(',')[1]
|
|
571
|
+
const preorderSlotInterval = parseInt(splitCateringValue('preorder_slot_interval'))
|
|
572
|
+
const preorderLeadTime = parseInt(splitCateringValue('preorder_lead_time'))
|
|
573
|
+
const preorderTimeRange = parseInt(splitCateringValue('preorder_time_range'))
|
|
574
|
+
const preorderMaximumDays = parseInt(splitCateringValue('preorder_maximum_days'))
|
|
575
|
+
const preorderMinimumDays = parseInt(splitCateringValue('preorder_minimum_days'))
|
|
571
576
|
|
|
572
577
|
const businessPreorderProps = {
|
|
573
578
|
...props,
|
package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx
CHANGED
|
@@ -16,7 +16,7 @@ interface SubcategoriesComponentParams {
|
|
|
16
16
|
onClickSubcategory: any
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
const SubcategoriesComponent = (props
|
|
19
|
+
const SubcategoriesComponent = (props: SubcategoriesComponentParams) => {
|
|
20
20
|
const {
|
|
21
21
|
subcategoriesSelected,
|
|
22
22
|
category,
|
|
@@ -56,10 +56,10 @@ const SubcategoriesComponent = (props : SubcategoriesComponentParams) => {
|
|
|
56
56
|
>
|
|
57
57
|
<OButton
|
|
58
58
|
onClick={() => onClickSubcategory(null, category)}
|
|
59
|
-
bgColor={allsubcategorySelected ? theme.colors.primary : theme.colors.backgroundGray}
|
|
60
59
|
text={`${t('ALL', 'All')} ${allsubcategorySelected ? 'X' : ''}`}
|
|
61
60
|
style={bpStyles.categoryButtonStyle}
|
|
62
|
-
textStyle={{
|
|
61
|
+
textStyle={{ fontSize: 12 }}
|
|
62
|
+
isDisabled={!allsubcategorySelected}
|
|
63
63
|
/>
|
|
64
64
|
</ContainerButton>
|
|
65
65
|
{category?.subcategories?.map((subcategory: any) => {
|
|
@@ -71,10 +71,10 @@ const SubcategoriesComponent = (props : SubcategoriesComponentParams) => {
|
|
|
71
71
|
>
|
|
72
72
|
<OButton
|
|
73
73
|
onClick={() => onClickSubcategory(subcategory, category)}
|
|
74
|
-
bgColor={isSubcategorySelected ? theme.colors.primary : theme.colors.backgroundGray}
|
|
75
74
|
text={`${subcategory?.name} ${isSubcategorySelected ? 'X' : ''}`}
|
|
76
75
|
style={bpStyles.categoryButtonStyle}
|
|
77
|
-
textStyle={{
|
|
76
|
+
textStyle={{ fontSize: 12 }}
|
|
77
|
+
isDisabled={!allsubcategorySelected}
|
|
78
78
|
/>
|
|
79
79
|
</ContainerButton>
|
|
80
80
|
)
|
|
@@ -214,11 +214,11 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
|
|
|
214
214
|
text={t('VIEW_MORE', 'View more')}
|
|
215
215
|
parentStyle={{ padding: 0 }}
|
|
216
216
|
onClick={() => setOpenDescription(category)}
|
|
217
|
-
bgColor=
|
|
217
|
+
bgColor={theme.colors.white}
|
|
218
|
+
borderColor={theme.colors.primary}
|
|
218
219
|
textStyle={{
|
|
219
220
|
fontSize: 12,
|
|
220
221
|
borderBottomWidth: 1,
|
|
221
|
-
borderBottomColor: theme.colors.primary,
|
|
222
222
|
color: theme.colors.primary
|
|
223
223
|
}}
|
|
224
224
|
/>
|
|
@@ -18,15 +18,12 @@ export const RibbonBox = styled.View`
|
|
|
18
18
|
background-color: ${(props: any) => props.theme.colors.primary};
|
|
19
19
|
padding: 2px 8px;
|
|
20
20
|
max-width: 180px;
|
|
21
|
-
|
|
22
21
|
${(props: any) => props.bgColor && css`
|
|
23
22
|
background-color: ${props.bgColor};
|
|
24
23
|
`}
|
|
25
|
-
|
|
26
24
|
${(props: any) => props.isRoundRect && css`
|
|
27
25
|
border-radius: 7.6px;
|
|
28
26
|
`}
|
|
29
|
-
|
|
30
27
|
${(props: any) => props.isCapsule && css`
|
|
31
28
|
border-radius: 50px;
|
|
32
29
|
`}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
|
2
|
-
import { View, TouchableOpacity, StyleSheet, SafeAreaView, Dimensions, Platform, KeyboardAvoidingViewBase, KeyboardAvoidingView, Keyboard, KeyboardEvent, BackHandler, ScrollView } from 'react-native'
|
|
2
|
+
import { View, TouchableOpacity, StyleSheet, SafeAreaView, Dimensions, Platform, KeyboardAvoidingViewBase, KeyboardAvoidingView, Keyboard, KeyboardEvent, BackHandler, ScrollView, Vibration } from 'react-native'
|
|
3
3
|
import { IOScrollView } from 'react-native-intersection-observer'
|
|
4
4
|
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
5
5
|
import { useTheme } from 'styled-components/native';
|
|
@@ -225,8 +225,9 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
225
225
|
cartUuid: cart?.uuid,
|
|
226
226
|
businessLogo: cart?.business?.logo,
|
|
227
227
|
businessName: cart?.business?.name,
|
|
228
|
-
cartTotal: cart?.total
|
|
229
|
-
|
|
228
|
+
cartTotal: cart?.total,
|
|
229
|
+
fromProductsList: true
|
|
230
|
+
})
|
|
230
231
|
} else {
|
|
231
232
|
const groupKeys: any = {}
|
|
232
233
|
cartsAvailable.forEach((_cart: any) => {
|
|
@@ -242,12 +243,12 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
242
243
|
props.onNavigationRedirect('CheckoutNavigator', {
|
|
243
244
|
screen: 'MultiCheckout',
|
|
244
245
|
checkCarts: true
|
|
245
|
-
}
|
|
246
|
+
})
|
|
246
247
|
} else {
|
|
247
248
|
props.onNavigationRedirect('CheckoutNavigator', {
|
|
248
249
|
screen: 'MultiCheckout',
|
|
249
250
|
cartUuid: cartsAvailable[0]?.group?.uuid
|
|
250
|
-
}
|
|
251
|
+
})
|
|
251
252
|
}
|
|
252
253
|
}
|
|
253
254
|
}
|
|
@@ -381,6 +382,14 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
381
382
|
setViewedCategory(_viewedCategory)
|
|
382
383
|
events.emit('product_list_viewed', _viewedCategory)
|
|
383
384
|
}
|
|
385
|
+
} else {
|
|
386
|
+
if (business.categories) {
|
|
387
|
+
const categoryAll: any = {}
|
|
388
|
+
categoryAll.business_id = business.id
|
|
389
|
+
categoryAll.id = null
|
|
390
|
+
categoryAll.name = 'All'
|
|
391
|
+
events.emit('product_list_viewed', categoryAll)
|
|
392
|
+
}
|
|
384
393
|
}
|
|
385
394
|
}, [business?.lazy_load_products_recommended, selectedCategoryId, categorySelected?.id, viewedCategory])
|
|
386
395
|
|
|
@@ -679,7 +688,10 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
679
688
|
btnLeftValue={currentCart?.products.reduce((prev: number, product: any) => prev + product.quantity, 0)}
|
|
680
689
|
btnRightValue={parsePrice(currentCart?.total)}
|
|
681
690
|
disabled={subtotalWithTaxes < currentCart?.minimum || openUpselling}
|
|
682
|
-
handleClick={() =>
|
|
691
|
+
handleClick={() => {
|
|
692
|
+
Vibration.vibrate(100)
|
|
693
|
+
setOpenUpselling(true)
|
|
694
|
+
}}
|
|
683
695
|
/>
|
|
684
696
|
</View>
|
|
685
697
|
)}
|
|
@@ -26,9 +26,9 @@ import { BusinessTypeFilterParams } from '../../types';
|
|
|
26
26
|
const windowWidth = Dimensions.get('window').width;
|
|
27
27
|
|
|
28
28
|
export const BusinessTypeFilterUI = (props: BusinessTypeFilterParams) => {
|
|
29
|
-
const {
|
|
30
|
-
typesState,
|
|
31
|
-
currentTypeSelected,
|
|
29
|
+
const {
|
|
30
|
+
typesState,
|
|
31
|
+
currentTypeSelected,
|
|
32
32
|
handleChangeBusinessType,
|
|
33
33
|
setBusinessTypes,
|
|
34
34
|
isAppoint
|
|
@@ -38,13 +38,13 @@ export const BusinessTypeFilterUI = (props: BusinessTypeFilterParams) => {
|
|
|
38
38
|
|
|
39
39
|
const theme = useTheme();
|
|
40
40
|
const [isOpenAllCategories, setIsOpenAllCategories] = useState(false)
|
|
41
|
-
const defaultImage = (name
|
|
41
|
+
const defaultImage = (name: string) => theme.images?.categories?.[name.toLowerCase().replace(' ', '')]
|
|
42
42
|
|
|
43
43
|
useEffect(() => {
|
|
44
|
-
if(typesState?.types?.length > 0){
|
|
45
|
-
|
|
44
|
+
if (typesState?.types?.length > 0) {
|
|
45
|
+
setBusinessTypes && setBusinessTypes(typesState?.types)
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
}, [typesState])
|
|
48
48
|
|
|
49
49
|
const handleChangeServiceType = (serviceId: any) => {
|
|
50
50
|
if (serviceId === currentTypeSelected) {
|
|
@@ -119,10 +119,11 @@ export const BusinessTypeFilterUI = (props: BusinessTypeFilterParams) => {
|
|
|
119
119
|
<OButton
|
|
120
120
|
key={i}
|
|
121
121
|
bgColor={(currentTypeSelected === businessType?.id) ? theme.colors.primary : theme.colors.backgroundGray200}
|
|
122
|
+
borderColor={(currentTypeSelected === businessType?.id) ? theme.colors.primary : theme.colors.backgroundGray200}
|
|
122
123
|
onClick={() => handleChangeServiceType(businessType?.id)}
|
|
123
124
|
text={`${businessType?.name} ${(currentTypeSelected === businessType?.id) ? ' X' : ''}`}
|
|
124
125
|
style={styles.businessType}
|
|
125
|
-
textStyle={{ fontSize: 10, color: (currentTypeSelected === businessType?.id) ? theme.colors.
|
|
126
|
+
textStyle={{ fontSize: 10, color: (currentTypeSelected === businessType?.id) ? theme.colors.white : theme.colors.textNormal }}
|
|
126
127
|
/>
|
|
127
128
|
))}
|
|
128
129
|
</ServiceWrapper>
|
|
@@ -392,10 +392,11 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
392
392
|
<OButton
|
|
393
393
|
key={i}
|
|
394
394
|
bgColor={(priceLevelSelected === price?.level) ? theme.colors.primary : theme.colors.backgroundGray200}
|
|
395
|
+
borderColor={(priceLevelSelected === price?.level) ? theme.colors.primary : theme.colors.backgroundGray200}
|
|
395
396
|
onClick={() => handleChangePriceLevel(price?.level)}
|
|
396
397
|
text={`${price.content} ${(priceLevelSelected === price?.level) ? ' X' : ''}`}
|
|
397
398
|
style={styles.priceLevel}
|
|
398
|
-
textStyle={{ fontSize: 10, color: (priceLevelSelected === price?.level) ? theme.colors.backgroundLight : theme.colors.
|
|
399
|
+
textStyle={{ fontSize: 10, color: (priceLevelSelected === price?.level) ? theme.colors.backgroundLight : theme.colors.black }}
|
|
399
400
|
/>
|
|
400
401
|
))}
|
|
401
402
|
</ScrollView>
|
|
@@ -168,7 +168,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
168
168
|
setFeaturedBusinesses(ary);
|
|
169
169
|
}
|
|
170
170
|
resetInactivityTimeout()
|
|
171
|
-
}, [businessesList.loading])
|
|
171
|
+
}, [businessesList.loading, businessesList?.businesses])
|
|
172
172
|
|
|
173
173
|
const handleOnRefresh = () => {
|
|
174
174
|
if (!businessesList.loading) {
|
|
@@ -60,7 +60,7 @@ export const WrapMomentOption = styled.TouchableOpacity`
|
|
|
60
60
|
|
|
61
61
|
export const HeaderWrapper = styled.ImageBackground`
|
|
62
62
|
width: 100%;
|
|
63
|
-
height:
|
|
63
|
+
height: 270px;
|
|
64
64
|
padding: 20px;
|
|
65
65
|
background-color: transparent;
|
|
66
66
|
`;
|
|
@@ -19,7 +19,7 @@ import { CouponControl } from '../CouponControl';
|
|
|
19
19
|
import { OButton, OInput, OModal, OText } from '../shared';
|
|
20
20
|
import { UpsellingProducts } from '../UpsellingProducts';
|
|
21
21
|
import { verifyDecimals } from '../../utils';
|
|
22
|
-
import { ActivityIndicator, TouchableOpacity, View } from 'react-native';
|
|
22
|
+
import { ActivityIndicator, TouchableOpacity, View, Vibration } from 'react-native';
|
|
23
23
|
import AntIcon from 'react-native-vector-icons/AntDesign'
|
|
24
24
|
import { TaxInformation } from '../TaxInformation';
|
|
25
25
|
import { CartStoresListing } from '../CartStoresListing';
|
|
@@ -114,6 +114,7 @@ const CartUI = (props: any) => {
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
const handleUpsellingPage = (individualCart: any) => {
|
|
117
|
+
Vibration.vibrate(100)
|
|
117
118
|
const isProductCartParam = !!individualCart?.products?.length
|
|
118
119
|
setOpenUpselling(false)
|
|
119
120
|
setCanOpenUpselling(false)
|
|
@@ -128,8 +129,9 @@ const CartUI = (props: any) => {
|
|
|
128
129
|
cartUuid: cart?.uuid,
|
|
129
130
|
businessLogo: cart?.business?.logo,
|
|
130
131
|
businessName: cart?.business?.name,
|
|
131
|
-
cartTotal: cart?.total
|
|
132
|
-
|
|
132
|
+
cartTotal: cart?.total,
|
|
133
|
+
fromProductsList: isFromUpselling
|
|
134
|
+
})
|
|
133
135
|
} else {
|
|
134
136
|
const groupKeys: any = {}
|
|
135
137
|
cartsAvailable.forEach((_cart: any) => {
|
|
@@ -145,28 +147,30 @@ const CartUI = (props: any) => {
|
|
|
145
147
|
onNavigationRedirect('CheckoutNavigator', {
|
|
146
148
|
screen: 'MultiCheckout',
|
|
147
149
|
checkCarts: true
|
|
148
|
-
}
|
|
150
|
+
})
|
|
149
151
|
} else {
|
|
150
152
|
onNavigationRedirect('CheckoutNavigator', {
|
|
151
153
|
screen: 'MultiCheckout',
|
|
152
154
|
cartUuid: cartsAvailable[0]?.group?.uuid
|
|
153
|
-
}
|
|
155
|
+
})
|
|
154
156
|
}
|
|
155
157
|
}
|
|
156
158
|
}
|
|
157
159
|
|
|
158
|
-
const getIncludedTaxes = () => {
|
|
160
|
+
const getIncludedTaxes = (isDeliveryFee?: boolean) => {
|
|
159
161
|
if (cart?.taxes === null || !cart?.taxes) {
|
|
160
|
-
return cart
|
|
162
|
+
return cart?.business.tax_type === 1 ? cart?.tax : 0
|
|
161
163
|
} else {
|
|
162
164
|
return cart?.taxes.reduce((taxIncluded: number, tax: any) => {
|
|
163
|
-
return taxIncluded +
|
|
165
|
+
return taxIncluded +
|
|
166
|
+
(((!isDeliveryFee && tax.type === 1 && tax.target === 'product') ||
|
|
167
|
+
(isDeliveryFee && tax.type === 1 && tax.target === 'delivery_fee')) ? tax.summary?.tax : 0)
|
|
164
168
|
}, 0)
|
|
165
169
|
}
|
|
166
170
|
}
|
|
167
171
|
|
|
168
172
|
const getIncludedTaxesDiscounts = () => {
|
|
169
|
-
return cart?.taxes?.filter((tax: any) => tax?.type === 1)?.reduce((carry: number, tax: any) => carry + (tax?.summary?.tax_after_discount ?? tax?.summary?.tax), 0)
|
|
173
|
+
return cart?.taxes?.filter((tax: any) => (tax?.type === 1 && tax?.target === 'product'))?.reduce((carry: number, tax: any) => carry + (tax?.summary?.tax_after_discount ?? tax?.summary?.tax), 0)
|
|
170
174
|
}
|
|
171
175
|
|
|
172
176
|
const OfferAlert = ({ offerId }: any) => {
|
|
@@ -197,10 +201,15 @@ const CartUI = (props: any) => {
|
|
|
197
201
|
}, cart?.subtotal)
|
|
198
202
|
|
|
199
203
|
const handleClickCheckout = () => {
|
|
204
|
+
Vibration.vibrate(100)
|
|
200
205
|
if (cart?.business_id) {
|
|
201
206
|
setOpenUpselling(true)
|
|
202
207
|
} else {
|
|
203
|
-
|
|
208
|
+
onNavigationRedirect('CheckoutNavigator', {
|
|
209
|
+
screen: 'CheckoutPage',
|
|
210
|
+
cartUuid: cart?.uuid,
|
|
211
|
+
cartTotal: cart?.total
|
|
212
|
+
}, true)
|
|
204
213
|
}
|
|
205
214
|
}
|
|
206
215
|
|
|
@@ -239,7 +248,10 @@ const CartUI = (props: any) => {
|
|
|
239
248
|
handleClearProducts={handleClearProducts}
|
|
240
249
|
handleCartOpen={handleCartOpen}
|
|
241
250
|
onNavigationRedirect={props.onNavigationRedirect}
|
|
242
|
-
handleChangeStore={() =>
|
|
251
|
+
handleChangeStore={() => {
|
|
252
|
+
Vibration.vibrate(100)
|
|
253
|
+
setOpenChangeStore(true)
|
|
254
|
+
}}
|
|
243
255
|
handleClickCheckout={() => handleClickCheckout()}
|
|
244
256
|
checkoutButtonDisabled={(openUpselling && !canOpenUpselling) || subtotalWithTaxes < cart?.minimum || !cart?.valid_address}
|
|
245
257
|
isMultiCheckout={isMultiCheckout}
|
|
@@ -320,7 +332,7 @@ const CartUI = (props: any) => {
|
|
|
320
332
|
</OSTable>
|
|
321
333
|
)}
|
|
322
334
|
{
|
|
323
|
-
cart.taxes?.length > 0 && cart.taxes.filter((tax: any) => tax.type === 2 && tax?.rate !== 0).map((tax: any, i: number) => (
|
|
335
|
+
cart.taxes?.length > 0 && cart.taxes.filter((tax: any) => tax.type === 2 && tax?.rate !== 0 && tax?.target === 'product').map((tax: any, i: number) => (
|
|
324
336
|
<OSTable key={`${tax.id}_${i}`}>
|
|
325
337
|
<OSRow>
|
|
326
338
|
<OText size={12} lineHeight={18} numberOfLines={1} >
|
|
@@ -375,9 +387,25 @@ const CartUI = (props: any) => {
|
|
|
375
387
|
{orderState?.options?.type === 1 && cart?.delivery_price_with_discount > 0 && !hideDeliveryFee && (
|
|
376
388
|
<OSTable>
|
|
377
389
|
<OText size={12} lineHeight={18}>{t('DELIVERY_FEE', 'Delivery Fee')}</OText>
|
|
378
|
-
<OText size={12} lineHeight={18}>{parsePrice(cart?.delivery_price_with_discount)}</OText>
|
|
390
|
+
<OText size={12} lineHeight={18}>{parsePrice(cart?.delivery_price_with_discount + getIncludedTaxes(true))}</OText>
|
|
379
391
|
</OSTable>
|
|
380
392
|
)}
|
|
393
|
+
{
|
|
394
|
+
cart?.taxes?.length > 0 && cart?.taxes?.filter((tax: any) => tax?.type === 2 && tax?.rate !== 0 && tax?.target === 'delivery_fee').map((tax: any, i: number) => (
|
|
395
|
+
<OSTable key={`${tax.description}_${i}`}>
|
|
396
|
+
<OSRow>
|
|
397
|
+
<OText size={12} lineHeight={18} numberOfLines={1}>
|
|
398
|
+
{tax.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
399
|
+
{`(${verifyDecimals(tax?.rate, parseNumber)}%)`}
|
|
400
|
+
</OText>
|
|
401
|
+
<TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: tax, type: 'tax' })}>
|
|
402
|
+
<AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
|
|
403
|
+
</TouchableOpacity>
|
|
404
|
+
</OSRow>
|
|
405
|
+
<OText size={12} lineHeight={18}>{parsePrice(tax?.summary?.tax_after_discount ?? tax?.summary?.tax ?? 0)}</OText>
|
|
406
|
+
</OSTable>
|
|
407
|
+
))
|
|
408
|
+
}
|
|
381
409
|
{
|
|
382
410
|
cart?.offers?.length > 0 && cart?.offers?.filter((offer: any) => offer?.target === 2)?.map((offer: any, i: number) => (
|
|
383
411
|
<OSTable key={`${offer.id}_${i}`}>
|
|
@@ -553,10 +581,10 @@ const CartUI = (props: any) => {
|
|
|
553
581
|
`${t('MINIMUN_SUBTOTAL_ORDER', 'Minimum subtotal order:')} ${parsePrice(cart?.minimum)}`
|
|
554
582
|
)}
|
|
555
583
|
bgColor={(subtotalWithTaxes < cart?.minimum || !cart?.valid_address) ? theme.colors.secundary : theme.colors.primary}
|
|
584
|
+
borderColor={(subtotalWithTaxes < cart?.minimum || !cart?.valid_address) ? theme.colors.secundary : theme.colors.primary}
|
|
556
585
|
isDisabled={(openUpselling && !canOpenUpselling) || subtotalWithTaxes < cart?.minimum || !cart?.valid_address}
|
|
557
|
-
borderColor={theme.colors.primary}
|
|
558
586
|
imgRightSrc={null}
|
|
559
|
-
textStyle={{
|
|
587
|
+
textStyle={{ textAlign: 'center', flex: 1 }}
|
|
560
588
|
onClick={() => handleClickCheckout()}
|
|
561
589
|
style={{ width: '100%', flexDirection: 'row', justifyContent: 'center', borderRadius: 7.6, shadowOpacity: 0 }}
|
|
562
590
|
/>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { useCallback, useState } from 'react';
|
|
2
|
-
import { View } from 'react-native';
|
|
1
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import { Vibration, View } from 'react-native';
|
|
3
3
|
import { useLanguage, useConfig, useUtils, useOrder } from 'ordering-components/native';
|
|
4
4
|
import { useTheme } from 'styled-components/native';
|
|
5
5
|
import { CCContainer, CCNotCarts, CCList, CheckoutAction, ChCartsTotal } from './styles';
|
|
@@ -13,7 +13,8 @@ export const CartContent = (props: any) => {
|
|
|
13
13
|
const {
|
|
14
14
|
onNavigationRedirect,
|
|
15
15
|
singleBusiness,
|
|
16
|
-
businessSlug
|
|
16
|
+
businessSlug,
|
|
17
|
+
navigation
|
|
17
18
|
} = props
|
|
18
19
|
|
|
19
20
|
const theme = useTheme();
|
|
@@ -22,7 +23,7 @@ export const CartContent = (props: any) => {
|
|
|
22
23
|
const [{ parsePrice }] = useUtils();
|
|
23
24
|
const [isCartsLoading, setIsCartsLoading] = useState(false)
|
|
24
25
|
const [cartsOpened, setCartsOpened] = useState([])
|
|
25
|
-
const [{ carts: cartsContext }] = useOrder();
|
|
26
|
+
const [{ carts: cartsContext }, { confirmCart }] = useOrder();
|
|
26
27
|
const cartsList =
|
|
27
28
|
(cartsContext &&
|
|
28
29
|
Object.values(cartsContext).filter((cart: any) => cart.products.length > 0)) ??
|
|
@@ -38,6 +39,7 @@ export const CartContent = (props: any) => {
|
|
|
38
39
|
?.filter((cart: any) => cart?.status !== 1 && cart?.valid && cart?.products?.length)
|
|
39
40
|
?.reduce((total: any, cart: any) => { return total + (cart?.delivery_price_with_discount) }, 0)
|
|
40
41
|
const handleCheckoutRedirect = () => {
|
|
42
|
+
Vibration.vibrate(100)
|
|
41
43
|
if (cartsAvailable.length === 1) {
|
|
42
44
|
onNavigationRedirect('CheckoutNavigator', {
|
|
43
45
|
screen: 'CheckoutPage',
|
|
@@ -71,7 +73,7 @@ export const CartContent = (props: any) => {
|
|
|
71
73
|
}
|
|
72
74
|
}
|
|
73
75
|
|
|
74
|
-
const changeActiveState = useCallback((isClosed
|
|
76
|
+
const changeActiveState = useCallback((isClosed: boolean, uuid: string) => {
|
|
75
77
|
const isActive = cartsOpened?.includes?.(uuid) || !!singleBusiness
|
|
76
78
|
if (isActive || !isClosed) {
|
|
77
79
|
setCartsOpened(cartsOpened?.filter?.((_uuid) => _uuid !== uuid))
|
|
@@ -83,6 +85,20 @@ export const CartContent = (props: any) => {
|
|
|
83
85
|
}
|
|
84
86
|
}, [cartsOpened])
|
|
85
87
|
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
const unsuscribe = navigation.addListener('focus', () => {
|
|
90
|
+
const cartsListBlockedByPaypal = carts?.filter((cart: any) => cart?.status === 2 && cart?.paymethod_data?.gateway === 'paypal')
|
|
91
|
+
if (cartsListBlockedByPaypal?.length > 0) {
|
|
92
|
+
cartsListBlockedByPaypal.map(async (cart: any) => {
|
|
93
|
+
await confirmCart(cart?.uuid)
|
|
94
|
+
})
|
|
95
|
+
}
|
|
96
|
+
})
|
|
97
|
+
return () => {
|
|
98
|
+
return unsuscribe()
|
|
99
|
+
}
|
|
100
|
+
}, [carts, navigation])
|
|
101
|
+
|
|
86
102
|
return (
|
|
87
103
|
<CCContainer
|
|
88
104
|
style={{ paddingHorizontal: 20 }}
|
|
@@ -158,11 +174,8 @@ export const CartContent = (props: any) => {
|
|
|
158
174
|
<CheckoutAction style={{ marginTop: 0 }}>
|
|
159
175
|
<OButton
|
|
160
176
|
text={t('CHECKOUT', 'Checkout')}
|
|
161
|
-
bgColor={!cartsAvailable.length ? theme.colors.secundary : theme.colors.primary}
|
|
162
177
|
isDisabled={!cartsAvailable.length}
|
|
163
|
-
borderColor={theme.colors.primary}
|
|
164
178
|
imgRightSrc={null}
|
|
165
|
-
textStyle={{ color: 'white', textAlign: 'center', flex: 1 }}
|
|
166
179
|
onClick={() => handleCheckoutRedirect()}
|
|
167
180
|
style={{ width: '100%', flexDirection: 'row', justifyContent: 'center', borderRadius: 7.6, shadowOpacity: 0 }}
|
|
168
181
|
/>
|