ordering-ui-react-native 0.16.87 → 0.16.88-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 +5 -5
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/ActiveOrders/styles.tsx +8 -14
- package/src/components/BusinessInformation/index.tsx +19 -4
- package/src/components/BusinessInformation/styles.tsx +2 -2
- package/src/components/BusinessProductsList/index.tsx +1 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/OrderCreating/index.tsx +1 -21
- package/src/components/OrdersOption/index.tsx +54 -56
- package/src/components/PaymentOptionsWebView/index.tsx +119 -120
- package/src/components/SingleProductReview/index.tsx +7 -4
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +4 -4
- package/src/utils/index.tsx +2 -1
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
- package/themes/business/src/components/BusinessController/index.tsx +2 -2
- package/themes/business/src/components/Chat/index.tsx +31 -31
- package/themes/business/src/components/DriverMap/index.tsx +22 -9
- package/themes/business/src/components/GoogleMap/index.tsx +58 -57
- package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
- package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/business/src/components/LoginForm/index.tsx +239 -80
- package/themes/business/src/components/LoginForm/styles.tsx +10 -0
- package/themes/business/src/components/MapView/index.tsx +18 -7
- package/themes/business/src/components/MessagesOption/index.tsx +11 -1
- package/themes/business/src/components/NewOrderNotification/index.tsx +31 -41
- package/themes/business/src/components/OrderDetails/Delivery.tsx +4 -3
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +96 -50
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +59 -62
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
- package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
- package/themes/business/src/components/OrderMessage/index.tsx +18 -17
- package/themes/business/src/components/OrdersOption/index.tsx +79 -87
- package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
- package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
- package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
- package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
- package/themes/business/src/components/PreviousOrders/index.tsx +447 -247
- package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
- package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
- package/themes/business/src/components/ReviewCustomer/index.tsx +54 -27
- package/themes/business/src/components/shared/ODropDown.tsx +42 -8
- package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
- package/themes/business/src/components/shared/OLink.tsx +33 -13
- package/themes/business/src/components/shared/OModal.tsx +16 -9
- package/themes/business/src/components/shared/OText.tsx +8 -2
- package/themes/business/src/types/index.tsx +35 -3
- package/themes/business/src/utils/index.tsx +53 -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/BusinessesListing/index.tsx +2 -1
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
- package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/kiosk/src/components/LoginForm/index.tsx +473 -151
- package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
- package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +1 -0
- package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
- package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
- package/themes/kiosk/src/layouts/Container.tsx +7 -1
- package/themes/kiosk/src/types/index.d.ts +13 -0
- package/themes/kiosk/src/utils/index.tsx +15 -0
- package/themes/original/index.tsx +8 -0
- package/themes/original/src/components/AddressDetails/index.tsx +10 -8
- package/themes/original/src/components/AddressForm/index.tsx +155 -139
- package/themes/original/src/components/AddressList/index.tsx +18 -18
- package/themes/original/src/components/AddressList/styles.tsx +4 -2
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +118 -76
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -4
- package/themes/original/src/components/BusinessController/index.tsx +100 -47
- package/themes/original/src/components/BusinessController/styles.tsx +14 -9
- package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +9 -3
- package/themes/original/src/components/BusinessListingSearch/index.tsx +87 -34
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +6 -0
- package/themes/original/src/components/BusinessPreorder/index.tsx +96 -15
- package/themes/original/src/components/BusinessProductsList/index.tsx +10 -8
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +564 -495
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +13 -12
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +116 -81
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
- package/themes/original/src/components/BusinessesListing/index.tsx +6 -6
- package/themes/original/src/components/Cart/index.tsx +83 -42
- package/themes/original/src/components/CartContent/index.tsx +77 -15
- package/themes/original/src/components/CartContent/styles.tsx +11 -1
- package/themes/original/src/components/Checkout/index.tsx +280 -173
- package/themes/original/src/components/Checkout/styles.tsx +4 -2
- package/themes/original/src/components/CitiesControl/index.tsx +89 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
- package/themes/original/src/components/DriverTips/index.tsx +52 -37
- package/themes/original/src/components/DriverTips/styles.tsx +2 -1
- package/themes/original/src/components/Favorite/index.tsx +7 -4
- package/themes/original/src/components/Favorite/styles.tsx +1 -1
- package/themes/original/src/components/FavoriteList/index.tsx +70 -80
- package/themes/original/src/components/FloatingButton/index.tsx +1 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/index.tsx +20 -19
- package/themes/original/src/components/GPSButton/styles.ts +3 -3
- package/themes/original/src/components/GoogleMap/index.tsx +10 -1
- package/themes/original/src/components/Help/index.tsx +8 -8
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +11 -22
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
- package/themes/original/src/components/HelpGuide/index.tsx +12 -16
- package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
- package/themes/original/src/components/HelpOrder/index.tsx +12 -25
- package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
- package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
- package/themes/original/src/components/LastOrder/index.tsx +1 -34
- package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
- package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
- package/themes/original/src/components/LoginForm/index.tsx +43 -19
- package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
- package/themes/original/src/components/MessageListing/index.tsx +7 -40
- package/themes/original/src/components/Messages/index.tsx +26 -10
- package/themes/original/src/components/MomentOption/index.tsx +195 -88
- package/themes/original/src/components/MultiCart/index.tsx +50 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
- package/themes/original/src/components/MultiCheckout/index.tsx +193 -79
- package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +67 -20
- package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
- package/themes/original/src/components/MyOrders/index.tsx +66 -17
- package/themes/original/src/components/NavBar/index.tsx +6 -11
- package/themes/original/src/components/NetworkError/index.tsx +5 -3
- package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
- package/themes/original/src/components/Notifications/index.tsx +144 -0
- package/themes/original/src/components/Notifications/styles.tsx +20 -0
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +59 -0
- package/themes/original/src/components/OrderDetails/index.tsx +110 -221
- package/themes/original/src/components/OrderDetails/styles.tsx +10 -1
- package/themes/original/src/components/OrderItAgain/index.tsx +44 -42
- package/themes/original/src/components/OrderProgress/index.tsx +74 -112
- package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
- package/themes/original/src/components/OrderSummary/index.tsx +52 -17
- package/themes/original/src/components/OrderTypeSelector/index.tsx +9 -3
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +29 -20
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
- package/themes/original/src/components/OrdersOption/index.tsx +76 -83
- package/themes/original/src/components/PageBanner/index.tsx +146 -0
- package/themes/original/src/components/PageBanner/styles.tsx +11 -0
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +2 -2
- package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
- package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
- package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
- package/themes/original/src/components/ProductForm/index.tsx +240 -256
- package/themes/original/src/components/ProductForm/styles.tsx +5 -8
- package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -10
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
- package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
- package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -49
- package/themes/original/src/components/ProfessionalProfile/index.tsx +54 -14
- package/themes/original/src/components/Promotions/index.tsx +234 -220
- package/themes/original/src/components/Promotions/styles.tsx +7 -2
- package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
- package/themes/original/src/components/ReviewOrder/index.tsx +43 -11
- package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
- package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
- package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
- package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
- package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
- package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
- package/themes/original/src/components/ServiceForm/index.tsx +377 -270
- package/themes/original/src/components/Sessions/index.tsx +11 -8
- package/themes/original/src/components/Sessions/styles.tsx +5 -0
- package/themes/original/src/components/SignupForm/index.tsx +79 -67
- package/themes/original/src/components/SingleOrderCard/index.tsx +126 -57
- package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
- package/themes/original/src/components/SingleProductCard/index.tsx +104 -45
- package/themes/original/src/components/SingleProductCard/styles.tsx +14 -13
- package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
- package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
- package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
- package/themes/original/src/components/StripeElementsForm/index.tsx +4 -1
- package/themes/original/src/components/UpsellingProducts/index.tsx +243 -218
- package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
- package/themes/original/src/components/UserDetails/index.tsx +8 -4
- package/themes/original/src/components/UserFormDetails/index.tsx +53 -54
- package/themes/original/src/components/UserProfile/index.tsx +58 -35
- package/themes/original/src/components/UserProfile/styles.ts +17 -0
- package/themes/original/src/components/UserProfileForm/index.tsx +21 -28
- package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
- package/themes/original/src/components/Wallets/index.tsx +96 -93
- package/themes/original/src/components/Wallets/styles.tsx +2 -0
- package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
- package/themes/original/src/components/shared/OBottomPopup.tsx +1 -1
- package/themes/original/src/components/shared/OButton.tsx +6 -2
- package/themes/original/src/components/shared/OIcon.tsx +8 -1
- package/themes/original/src/components/shared/OInput.tsx +10 -1
- package/themes/original/src/layouts/Container.tsx +13 -9
- package/themes/original/src/types/index.tsx +37 -5
- package/themes/original/src/utils/index.tsx +321 -58
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components/native'
|
|
2
2
|
|
|
3
|
-
export const ContainerSafeAreaView = styled.SafeAreaView`
|
|
4
|
-
`
|
|
5
|
-
|
|
6
3
|
export const WrapHeader = styled.View`
|
|
7
4
|
position: relative;
|
|
8
5
|
`
|
|
@@ -14,7 +11,6 @@ export const TopHeader = styled.View`
|
|
|
14
11
|
z-index: 1;
|
|
15
12
|
height: 60px;
|
|
16
13
|
min-height: 60px;
|
|
17
|
-
margin-top: ${(props : any) => props.isIos ? '0' : '40px'};
|
|
18
14
|
`
|
|
19
15
|
export const AddressInput = styled.TouchableOpacity`
|
|
20
16
|
flex: 1;
|
|
@@ -28,7 +24,7 @@ export const WrapSearchBar = styled.View`
|
|
|
28
24
|
flex: 1;
|
|
29
25
|
`
|
|
30
26
|
export const WrapContent = styled.View`
|
|
31
|
-
padding: 10px
|
|
27
|
+
padding-vertical: 10px;
|
|
32
28
|
`
|
|
33
29
|
|
|
34
30
|
export const BusinessProductsListingContainer = styled.ScrollView`
|
|
@@ -41,18 +37,16 @@ export const BusinessProductsListingContainer = styled.ScrollView`
|
|
|
41
37
|
export const FiltProductsContainer = styled.ScrollView`
|
|
42
38
|
position: absolute;
|
|
43
39
|
width: 100%;
|
|
44
|
-
z-index:
|
|
45
|
-
top: ${(props : any) => props.isIos ? '40px': '80px'};
|
|
46
|
-
margin-top: 20px;
|
|
40
|
+
z-index: 20000;
|
|
47
41
|
`
|
|
48
42
|
|
|
49
43
|
export const BackgroundGray = styled.View`
|
|
50
44
|
flex: 1;
|
|
51
|
-
height: 100
|
|
45
|
+
height: ${(props: any) => props.isIos ? '80%' : '100%'};
|
|
52
46
|
background-color: rgba(0,0,0,0.5);
|
|
53
|
-
position: absolute;
|
|
54
|
-
margin-top: 100px;
|
|
55
|
-
z-index:
|
|
47
|
+
position: absolute;
|
|
48
|
+
margin-top: 100px;
|
|
49
|
+
z-index: 10000;
|
|
56
50
|
width: 100%;
|
|
57
51
|
`
|
|
58
52
|
|
|
@@ -66,3 +60,10 @@ export const NearBusiness = styled.View`
|
|
|
66
60
|
padding-left: 20px;
|
|
67
61
|
max-height: 80px;
|
|
68
62
|
`
|
|
63
|
+
|
|
64
|
+
export const TopActions = styled.TouchableOpacity`
|
|
65
|
+
height: 60px;
|
|
66
|
+
justify-content: center;
|
|
67
|
+
padding-horizontal: 30px;
|
|
68
|
+
width: 100px;
|
|
69
|
+
`;
|
|
@@ -38,6 +38,7 @@ export const BusinessTypeFilterUI = (props: BusinessTypeFilterParams) => {
|
|
|
38
38
|
|
|
39
39
|
const theme = useTheme();
|
|
40
40
|
const [isOpenAllCategories, setIsOpenAllCategories] = useState(false)
|
|
41
|
+
const defaultImage = (name : string) => theme.images?.categories?.[name.toLowerCase().replace(' ', '')]
|
|
41
42
|
|
|
42
43
|
useEffect(() => {
|
|
43
44
|
if(typesState?.types?.length > 0){
|
|
@@ -197,9 +198,9 @@ export const BusinessTypeFilterUI = (props: BusinessTypeFilterParams) => {
|
|
|
197
198
|
isOpenAllCategories && setIsOpenAllCategories(false)
|
|
198
199
|
}}
|
|
199
200
|
>
|
|
200
|
-
{item.image ? (
|
|
201
|
+
{(defaultImage(item.name) || item.image) ? (
|
|
201
202
|
<OIcon
|
|
202
|
-
url={item.image}
|
|
203
|
+
url={typeof item.name === 'number' ? item.image || defaultImage(item.name) : defaultImage(item.name) || item.image}
|
|
203
204
|
style={styles.logo}
|
|
204
205
|
/>
|
|
205
206
|
) : (
|
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
} from 'ordering-components/native';
|
|
23
23
|
import { useTheme } from 'styled-components/native';
|
|
24
24
|
import Ionicons from 'react-native-vector-icons/Ionicons'
|
|
25
|
+
import IconAntDesign from 'react-native-vector-icons/AntDesign';
|
|
25
26
|
|
|
26
27
|
import {
|
|
27
28
|
Search,
|
|
@@ -283,7 +284,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
283
284
|
style={{ paddingTop: top + 20 }}>
|
|
284
285
|
{!auth && (
|
|
285
286
|
<TouchableOpacity onPress={() => navigation?.canGoBack() && navigation.goBack()} style={{ position: 'absolute', marginStart: 40, paddingVertical: 20 }}>
|
|
286
|
-
<OIcon src={theme.images.general.arrow_left}
|
|
287
|
+
<OIcon src={theme.images.general.arrow_left} color={theme.colors.textNormal} />
|
|
287
288
|
</TouchableOpacity>
|
|
288
289
|
)}
|
|
289
290
|
<Search>
|
|
@@ -31,7 +31,6 @@ import {
|
|
|
31
31
|
HeaderWrapper,
|
|
32
32
|
ListWrapper,
|
|
33
33
|
FeaturedWrapper,
|
|
34
|
-
OrderProgressWrapper,
|
|
35
34
|
FarAwayMessage,
|
|
36
35
|
AddressInputContainer,
|
|
37
36
|
PreorderInput,
|
|
@@ -39,8 +38,7 @@ import {
|
|
|
39
38
|
BusinessLogosContainer
|
|
40
39
|
} from './styles';
|
|
41
40
|
|
|
42
|
-
import {
|
|
43
|
-
import { OButton, OIcon, OText, OBottomPopup, OModal } from '../../../shared';
|
|
41
|
+
import { OIcon, OText, OModal } from '../../../shared';
|
|
44
42
|
import { BusinessesListingParams } from '../../../../types';
|
|
45
43
|
import { NotFoundSource } from '../../../NotFoundSource';
|
|
46
44
|
import { BusinessTypeFilter } from '../../../BusinessTypeFilter';
|
|
@@ -49,10 +47,13 @@ import { OrderTypeSelector } from '../../../OrderTypeSelector';
|
|
|
49
47
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
50
48
|
import { BusinessFeaturedController } from '../../../BusinessFeaturedController';
|
|
51
49
|
import { HighestRatedBusinesses } from '../../../HighestRatedBusinesses';
|
|
52
|
-
import { getTypesText
|
|
50
|
+
import { getTypesText } from '../../../../utils';
|
|
53
51
|
import { OrderProgress } from '../../../OrderProgress';
|
|
54
52
|
import { useFocusEffect, useIsFocused } from '@react-navigation/native';
|
|
55
53
|
import FastImage from 'react-native-fast-image';
|
|
54
|
+
import IconAntDesign from 'react-native-vector-icons/AntDesign';
|
|
55
|
+
import { PageBanner } from '../../../PageBanner'
|
|
56
|
+
import { CitiesControl } from '../../../CitiesControl'
|
|
56
57
|
|
|
57
58
|
const PIXELS_TO_SCROLL = 2000;
|
|
58
59
|
|
|
@@ -60,12 +61,10 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
60
61
|
const {
|
|
61
62
|
navigation,
|
|
62
63
|
businessesList,
|
|
63
|
-
searchValue,
|
|
64
64
|
getBusinesses,
|
|
65
65
|
handleChangeBusinessType,
|
|
66
66
|
handleBusinessClick,
|
|
67
67
|
paginationProps,
|
|
68
|
-
handleChangeSearch,
|
|
69
68
|
businessId,
|
|
70
69
|
isGuestUser,
|
|
71
70
|
handleUpdateBusinessList,
|
|
@@ -75,12 +74,24 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
75
74
|
} = props;
|
|
76
75
|
const theme = useTheme();
|
|
77
76
|
const isFocused = useIsFocused();
|
|
77
|
+
|
|
78
|
+
const [, t] = useLanguage();
|
|
79
|
+
const [{ user, auth }] = useSession();
|
|
80
|
+
const [orderState, { changeCityFilter }] = useOrder();
|
|
81
|
+
const [{ configs }] = useConfig();
|
|
82
|
+
const [{ parseDate }] = useUtils();
|
|
83
|
+
|
|
78
84
|
const appState = useRef(AppState.currentState)
|
|
79
|
-
const
|
|
80
|
-
const [appStateVisible, setAppStateVisible] = useState(appState.current);
|
|
81
|
-
const isChewLayout = theme?.header?.components?.layout?.type === 'original'
|
|
82
|
-
const hideCities = theme?.business_listing_view?.components?.cities?.hidden ?? true
|
|
85
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
83
86
|
const [refreshing] = useState(false);
|
|
87
|
+
const hideCities = (theme?.business_listing_view?.components?.cities?.hidden || orderState?.options?.type !== 2) ?? true
|
|
88
|
+
const hideHero = theme?.business_listing_view?.components?.business_hero?.hidden
|
|
89
|
+
const hidePreviousOrders = theme?.business_listing_view?.components?.previous_orders_block?.hidden
|
|
90
|
+
const hideHighestBusiness = theme?.business_listing_view?.components?.highest_rated_business_block?.hidden
|
|
91
|
+
const isAllCategoriesHidden = theme?.business_listing_view?.components?.categories?.hidden
|
|
92
|
+
const bgHeader = theme?.business_listing_view?.components?.business_hero?.components?.image
|
|
93
|
+
const bgHeaderHeight = theme?.business_listing_view?.components?.business_hero?.components?.style?.height
|
|
94
|
+
|
|
84
95
|
const styles = StyleSheet.create({
|
|
85
96
|
container: {
|
|
86
97
|
marginBottom: 0,
|
|
@@ -133,7 +144,8 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
133
144
|
minHeight: 45,
|
|
134
145
|
paddingVertical: 5,
|
|
135
146
|
paddingHorizontal: 20,
|
|
136
|
-
borderWidth: 1
|
|
147
|
+
borderWidth: 1,
|
|
148
|
+
justifyContent: 'center'
|
|
137
149
|
},
|
|
138
150
|
businessSkeleton: {
|
|
139
151
|
borderRadius: 8,
|
|
@@ -143,19 +155,12 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
143
155
|
},
|
|
144
156
|
});
|
|
145
157
|
|
|
146
|
-
|
|
147
|
-
const [, t] = useLanguage();
|
|
148
|
-
const [{ user, auth }] = useSession();
|
|
149
|
-
const [orderState, { changeCityFilter }] = useOrder();
|
|
150
|
-
const [{ configs }] = useConfig();
|
|
151
|
-
const [{ parseDate }] = useUtils();
|
|
152
|
-
|
|
153
158
|
const { top } = useSafeAreaInsets();
|
|
154
159
|
|
|
155
160
|
const [featuredBusiness, setFeaturedBusinesses] = useState(Array);
|
|
156
161
|
const [isFarAway, setIsFarAway] = useState(false)
|
|
157
162
|
const [businessTypes, setBusinessTypes] = useState(null)
|
|
158
|
-
const [orderTypeValue, setOrderTypeValue] = useState(orderState?.options
|
|
163
|
+
const [orderTypeValue, setOrderTypeValue] = useState(orderState?.options?.value)
|
|
159
164
|
const [isOpenCities, setIsOpenCities] = useState(false)
|
|
160
165
|
const isPreorderEnabled = (configs?.preorder_status_enabled?.value === '1' || configs?.preorder_status_enabled?.value === 'true') &&
|
|
161
166
|
Number(configs?.max_days_preorder?.value) > 0
|
|
@@ -163,16 +168,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
163
168
|
const timerId = useRef<any>(false)
|
|
164
169
|
const [favoriteIds, setFavoriteIds] = useState<any>([])
|
|
165
170
|
const chewOrderTypes = [{ name: t('DELIVERY', 'Delivery').toUpperCase(), value: 1 }, { name: t('PICKUP', 'Pickup').toUpperCase(), value: 2 }]
|
|
166
|
-
|
|
167
|
-
// const panResponder = useRef(
|
|
168
|
-
// PanResponder.create({
|
|
169
|
-
// onMoveShouldSetPanResponder: (e, gestureState) => {
|
|
170
|
-
// const { dx, dy } = gestureState;
|
|
171
|
-
// resetInactivityTimeout()
|
|
172
|
-
// return (Math.abs(dx) > 20) || (Math.abs(dy) > 20);
|
|
173
|
-
// },
|
|
174
|
-
// })
|
|
175
|
-
// ).current
|
|
171
|
+
const enabledPoweredByOrdering = configs?.powered_by_ordering_module?.value
|
|
176
172
|
|
|
177
173
|
const handleMomentClick = () => {
|
|
178
174
|
if (isPreorderEnabled) {
|
|
@@ -192,11 +188,15 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
192
188
|
paginationProps.totalPages === paginationProps.currentPage
|
|
193
189
|
);
|
|
194
190
|
|
|
195
|
-
if (y + PIXELS_TO_SCROLL > height && !businessesList.loading && hasMore) {
|
|
191
|
+
if (y + PIXELS_TO_SCROLL > height && !businessesList.loading && hasMore && businessesList?.businesses?.length > 0) {
|
|
196
192
|
getBusinesses();
|
|
197
193
|
}
|
|
198
194
|
};
|
|
199
195
|
|
|
196
|
+
const convertToRadian = (value: number) => {
|
|
197
|
+
return value * Math.PI / 180
|
|
198
|
+
}
|
|
199
|
+
|
|
200
200
|
const getDistance = (lat1: any, lon1: any, lat2: any, lon2: any) => {
|
|
201
201
|
const R = 6371 // km
|
|
202
202
|
const dLat = convertToRadian(lat2 - lat1)
|
|
@@ -295,7 +295,10 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
295
295
|
|
|
296
296
|
if (logosLayout) {
|
|
297
297
|
return (
|
|
298
|
-
<BusinessLogosContainer
|
|
298
|
+
<BusinessLogosContainer
|
|
299
|
+
horizontal
|
|
300
|
+
showsHorizontalScrollIndicator={false}
|
|
301
|
+
>
|
|
299
302
|
{businessesList?.loading ? (
|
|
300
303
|
<Placeholder Animation={Fade}>
|
|
301
304
|
<View style={{ flexDirection: 'row' }}>
|
|
@@ -309,14 +312,27 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
309
312
|
) : (
|
|
310
313
|
<>
|
|
311
314
|
{businessesList.businesses
|
|
312
|
-
?.filter(business => business?.
|
|
315
|
+
?.filter(business => business?.open)
|
|
313
316
|
?.map(business => (
|
|
314
317
|
<TouchableOpacity
|
|
315
318
|
key={business?.id}
|
|
316
319
|
onPress={() => handleBusinessClick && handleBusinessClick(business)}
|
|
320
|
+
style={{
|
|
321
|
+
width: 60,
|
|
322
|
+
height: 60,
|
|
323
|
+
borderRadius: 8,
|
|
324
|
+
marginRight: 5
|
|
325
|
+
}}
|
|
317
326
|
>
|
|
318
327
|
<FastImage
|
|
319
|
-
style={{
|
|
328
|
+
style={{
|
|
329
|
+
width: 56,
|
|
330
|
+
height: 56,
|
|
331
|
+
marginRight: 20,
|
|
332
|
+
borderRadius: 8,
|
|
333
|
+
borderColor: theme.colors.primary,
|
|
334
|
+
borderWidth: business?.slug === actualSlug ? 2 : 0
|
|
335
|
+
}}
|
|
320
336
|
source={{
|
|
321
337
|
uri: business?.logo,
|
|
322
338
|
priority: FastImage.priority.normal,
|
|
@@ -332,7 +348,10 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
332
348
|
}
|
|
333
349
|
|
|
334
350
|
return (
|
|
335
|
-
<IOScrollView
|
|
351
|
+
<IOScrollView
|
|
352
|
+
style={styles.container}
|
|
353
|
+
onScroll={(e) => handleScroll(e)}
|
|
354
|
+
showsVerticalScrollIndicator={false}
|
|
336
355
|
refreshControl={
|
|
337
356
|
<RefreshControl
|
|
338
357
|
refreshing={refreshing}
|
|
@@ -340,6 +359,13 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
340
359
|
/>
|
|
341
360
|
}
|
|
342
361
|
>
|
|
362
|
+
{enabledPoweredByOrdering && auth && (
|
|
363
|
+
<View style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', top: 20 }}>
|
|
364
|
+
<OText>
|
|
365
|
+
Powered By Ordering.co
|
|
366
|
+
</OText>
|
|
367
|
+
</View>
|
|
368
|
+
)}
|
|
343
369
|
<View style={{
|
|
344
370
|
height: !isPreOrderSetting && isChewLayout ? 150 : isChewLayout ? 200 : isFarAway ? 150 : 100,
|
|
345
371
|
marginTop: Platform.OS == 'ios' ? 0 : 50,
|
|
@@ -348,8 +374,8 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
348
374
|
>
|
|
349
375
|
{isChewLayout && (
|
|
350
376
|
<View style={{ marginTop: 30, paddingHorizontal: 30, flexDirection: 'row', justifyContent: 'space-between' }}>
|
|
351
|
-
<OText size={
|
|
352
|
-
{t('WELCOME', 'Welcome')} {user?.name}
|
|
377
|
+
<OText size={24} weight={700} color={theme.colors?.white}>
|
|
378
|
+
{t('WELCOME', 'Welcome')} {user?.name}
|
|
353
379
|
</OText>
|
|
354
380
|
</View>
|
|
355
381
|
)}
|
|
@@ -444,32 +470,47 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
444
470
|
)}
|
|
445
471
|
</View>
|
|
446
472
|
{!isChewLayout ? (
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
473
|
+
<>
|
|
474
|
+
{!hideHero ? (
|
|
475
|
+
<HeaderWrapper
|
|
476
|
+
source={bgHeader ? { uri: bgHeader } : theme.images.backgrounds.business_list_header}
|
|
477
|
+
style={{ paddingTop: top + 20 }}
|
|
478
|
+
resizeMode='cover'
|
|
479
|
+
bgHeaderHeight={bgHeaderHeight}
|
|
480
|
+
>
|
|
481
|
+
{!auth && (
|
|
482
|
+
<TouchableOpacity onPress={() => navigation?.canGoBack() && navigation.goBack()} style={{ position: 'absolute', marginStart: 40, paddingVertical: 20 }}>
|
|
483
|
+
<OIcon src={theme.images.general.arrow_left} color={theme.colors.textNormal} />
|
|
484
|
+
</TouchableOpacity>
|
|
485
|
+
)}
|
|
486
|
+
</HeaderWrapper>
|
|
487
|
+
) : (
|
|
488
|
+
<>
|
|
489
|
+
{!auth && (
|
|
490
|
+
<TouchableOpacity onPress={() => navigation?.canGoBack() && navigation.goBack()} style={{ position: 'absolute', marginStart: 40, paddingVertical: 20 }}>
|
|
491
|
+
<OIcon src={theme.images.general.arrow_left} color={theme.colors.textNormal} />
|
|
492
|
+
</TouchableOpacity>
|
|
493
|
+
)}
|
|
494
|
+
</>
|
|
456
495
|
)}
|
|
457
|
-
|
|
496
|
+
</>
|
|
458
497
|
) : (
|
|
459
498
|
<OrderTypesContainer>
|
|
460
499
|
<OrderTypeSelector
|
|
461
500
|
handleChangeBusinessType={handleChangeBusinessType}
|
|
462
501
|
isChewLayout
|
|
463
502
|
chewOrderTypes={chewOrderTypes}
|
|
503
|
+
handleChangeType={setOrderTypeValue}
|
|
464
504
|
/>
|
|
465
505
|
</OrderTypesContainer>
|
|
466
506
|
)}
|
|
467
507
|
|
|
468
|
-
{!hideCities && (
|
|
508
|
+
{!hideCities && orderTypeValue === 2 && (
|
|
469
509
|
<View style={{ marginTop: 20 }}>
|
|
470
510
|
<TouchableOpacity
|
|
471
511
|
style={styles.buttonCityStyle}
|
|
472
512
|
onPress={() => setIsOpenCities(true)}
|
|
513
|
+
disabled={orderState?.loading}
|
|
473
514
|
>
|
|
474
515
|
<OText size={18} color={theme.colors.backgroundGray} weight='bold' style={{ textAlign: 'center' }}>
|
|
475
516
|
{citiesState?.cities?.find((city: any) => city?.id === orderState?.options?.city_id)?.name || t('FILTER_BY_CITY', 'Filter by city')}
|
|
@@ -477,12 +518,12 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
477
518
|
</TouchableOpacity>
|
|
478
519
|
</View>
|
|
479
520
|
)}
|
|
480
|
-
|
|
521
|
+
{!hidePreviousOrders && (
|
|
481
522
|
<OrderProgress
|
|
482
523
|
{...props}
|
|
483
524
|
isFocused={isFocused}
|
|
484
525
|
/>
|
|
485
|
-
|
|
526
|
+
)}
|
|
486
527
|
{
|
|
487
528
|
!businessId && !props.franchiseId && featuredBusiness && featuredBusiness.length > 0 && (
|
|
488
529
|
<FeaturedWrapper>
|
|
@@ -515,20 +556,27 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
515
556
|
</FeaturedWrapper>
|
|
516
557
|
)
|
|
517
558
|
}
|
|
559
|
+
{!isChewLayout && !hideHighestBusiness && (
|
|
560
|
+
<>
|
|
561
|
+
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100 }} />
|
|
562
|
+
{
|
|
563
|
+
!businessId && !props.franchiseId && (
|
|
564
|
+
<HighestRatedBusinesses
|
|
565
|
+
onBusinessClick={handleBusinessClick}
|
|
566
|
+
navigation={navigation}
|
|
567
|
+
favoriteIds={favoriteIds}
|
|
568
|
+
setFavoriteIds={setFavoriteIds}
|
|
569
|
+
/>
|
|
570
|
+
)
|
|
571
|
+
}
|
|
572
|
+
</>
|
|
573
|
+
)}
|
|
574
|
+
|
|
575
|
+
<PageBanner position='app_business_listing' navigation={navigation} />
|
|
576
|
+
|
|
518
577
|
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100 }} />
|
|
519
|
-
{
|
|
520
|
-
!businessId && !
|
|
521
|
-
<HighestRatedBusinesses
|
|
522
|
-
onBusinessClick={handleBusinessClick}
|
|
523
|
-
navigation={navigation}
|
|
524
|
-
favoriteIds={favoriteIds}
|
|
525
|
-
setFavoriteIds={setFavoriteIds}
|
|
526
|
-
/>
|
|
527
|
-
)
|
|
528
|
-
}
|
|
529
|
-
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100 }} />
|
|
530
|
-
<ListWrapper>
|
|
531
|
-
{!businessId && (
|
|
578
|
+
<ListWrapper style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}>
|
|
579
|
+
{!businessId && !isAllCategoriesHidden && (
|
|
532
580
|
<BusinessTypeFilter
|
|
533
581
|
images={props.images}
|
|
534
582
|
businessTypes={props.businessTypes}
|
|
@@ -550,6 +598,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
550
598
|
<BusinessController
|
|
551
599
|
key={`${business.id}_` + i}
|
|
552
600
|
enableIntersection
|
|
601
|
+
isCustomLayout={isChewLayout}
|
|
553
602
|
business={business}
|
|
554
603
|
isBusinessOpen={business.open}
|
|
555
604
|
handleCustomClick={handleBusinessClick}
|
|
@@ -626,25 +675,11 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
626
675
|
onClose={() => setIsOpenCities(false)}
|
|
627
676
|
title={t('SELECT_A_CITY', 'Select a city')}
|
|
628
677
|
>
|
|
629
|
-
<
|
|
630
|
-
{citiesState?.cities
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
padding: 10,
|
|
635
|
-
borderBottomWidth: 1,
|
|
636
|
-
borderBottomColor: orderState?.options?.city_id === city?.id ? theme.colors.primary : theme.colors.backgroundGray,
|
|
637
|
-
marginBottom: 10,
|
|
638
|
-
}}
|
|
639
|
-
onPress={() => handleChangeCity(city?.id)}
|
|
640
|
-
disabled={orderState?.loading}
|
|
641
|
-
>
|
|
642
|
-
<OText color={orderState?.options?.city_id === city?.id ? theme.colors.primary : theme.colors.black}>
|
|
643
|
-
{city?.name}
|
|
644
|
-
</OText>
|
|
645
|
-
</TouchableOpacity>
|
|
646
|
-
))}
|
|
647
|
-
</View>
|
|
678
|
+
<CitiesControl
|
|
679
|
+
cities={citiesState?.cities}
|
|
680
|
+
onClose={() => setIsOpenCities(false)}
|
|
681
|
+
handleChangeCity={handleChangeCity}
|
|
682
|
+
/>
|
|
648
683
|
</OModal>
|
|
649
684
|
</IOScrollView>
|
|
650
685
|
);
|
|
@@ -60,28 +60,20 @@ export const WrapMomentOption = styled.TouchableOpacity`
|
|
|
60
60
|
|
|
61
61
|
export const HeaderWrapper = styled.ImageBackground`
|
|
62
62
|
width: 100%;
|
|
63
|
-
|
|
63
|
+
height: 270px;
|
|
64
64
|
padding: 20px 40px;
|
|
65
65
|
background-color: transparent;
|
|
66
66
|
`;
|
|
67
67
|
|
|
68
68
|
export const ListWrapper = styled.View`
|
|
69
69
|
background-color: ${(props: any) => props.theme.colors.backgroundLight};
|
|
70
|
-
padding-horizontal: 40px;
|
|
71
70
|
`;
|
|
72
71
|
|
|
73
72
|
export const FeaturedWrapper = styled.View`
|
|
74
73
|
background-color: ${(props: any) => props.theme.colors.backgroundLight};
|
|
75
|
-
height: 220px;
|
|
76
74
|
paddingVertical: 30px;
|
|
77
75
|
`;
|
|
78
76
|
|
|
79
|
-
export const OrderProgressWrapper = styled.View`
|
|
80
|
-
margin-top: 37px;
|
|
81
|
-
margin-bottom: 20px;
|
|
82
|
-
padding-horizontal: 40px;
|
|
83
|
-
`
|
|
84
|
-
|
|
85
77
|
export const FarAwayMessage = styled.View`
|
|
86
78
|
flex-direction: row;
|
|
87
79
|
align-items: center;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
1
|
import React, { useState, useEffect } from 'react'
|
|
3
|
-
import { useOrder, useSession, useLanguage } from 'ordering-components/native';
|
|
2
|
+
import { useOrder, useSession, useLanguage, useConfig } from 'ordering-components/native';
|
|
4
3
|
|
|
5
4
|
import { useTheme } from 'styled-components/native'
|
|
6
5
|
import { BusinessesListing as OriginalBusinessListing } from './Layout/Original'
|
|
@@ -16,6 +15,8 @@ export const BusinessesListing = (props: any) => {
|
|
|
16
15
|
const [, t] = useLanguage();
|
|
17
16
|
const [{ auth }] = useSession()
|
|
18
17
|
const [, { getLastOrderHasNoReview }] = useOrder();
|
|
18
|
+
const [{ configs }] = useConfig()
|
|
19
|
+
const isShowReviewsPopupEnabled = configs?.show_reviews_popups_enabled?.value === '1'
|
|
19
20
|
|
|
20
21
|
const [, setIsReviewed] = useState()
|
|
21
22
|
const [checkNotificationStatus, setCheckNotificationStatus] = useState({ open: false, checked: false })
|
|
@@ -73,16 +74,15 @@ export const BusinessesListing = (props: any) => {
|
|
|
73
74
|
)
|
|
74
75
|
}
|
|
75
76
|
|
|
76
|
-
|
|
77
|
-
|
|
78
77
|
useEffect(() => {
|
|
78
|
+
if (!isShowReviewsPopupEnabled) return
|
|
79
79
|
(checkNotificationStatus?.checked && auth) && _getLastOrderHasNoReview()
|
|
80
|
-
}, [checkNotificationStatus, auth])
|
|
80
|
+
}, [checkNotificationStatus, auth, isShowReviewsPopupEnabled])
|
|
81
81
|
|
|
82
82
|
return (
|
|
83
83
|
<>
|
|
84
84
|
{((layout === 'original') || logosLayout) && <OriginalBusinessListing {...props} />}
|
|
85
|
-
{(layout === '
|
|
85
|
+
{(layout === 'appointments') && !logosLayout && <AppointmentBusinessListing {...props} />}
|
|
86
86
|
|
|
87
87
|
{lastOrderReview?.isReviewOpen && (
|
|
88
88
|
<OBottomPopup
|