ordering-ui-react-native 0.16.69 → 0.16.70-release
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -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 +10 -10
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +2 -1
- package/src/components/LanguageSelector/index.tsx +21 -16
- package/src/components/Messages/index.tsx +2 -2
- package/src/components/OrdersOption/index.tsx +54 -56
- package/src/components/PaymentOptions/index.tsx +298 -345
- package/src/components/PaymentOptionsWebView/index.tsx +119 -120
- package/src/components/SingleProductReview/index.tsx +7 -4
- package/src/components/StripeElementsForm/index.tsx +25 -16
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +4 -4
- package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
- package/src/utils/index.tsx +2 -1
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +260 -238
- 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 +7 -5
- package/themes/business/src/components/LoginForm/index.tsx +111 -74
- package/themes/business/src/components/MapView/index.tsx +14 -3
- 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/OrderContentComponent.tsx +70 -43
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +3 -3
- package/themes/business/src/components/OrdersOption/index.tsx +63 -73
- 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 +440 -245
- package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
- package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
- package/themes/business/src/components/ReviewCustomer/index.tsx +39 -15
- 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/OText.tsx +8 -2
- package/themes/business/src/types/index.tsx +14 -3
- package/themes/business/src/utils/index.tsx +10 -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/index.tsx +121 -10
- package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -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/ProductForm/index.tsx +1 -14
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/types/index.d.ts +2 -0
- package/themes/original/index.tsx +6 -0
- package/themes/original/src/components/AddressDetails/index.tsx +10 -8
- package/themes/original/src/components/AddressForm/index.tsx +153 -137
- 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 +49 -33
- package/themes/original/src/components/BusinessController/index.tsx +101 -70
- 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 +12 -6
- package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
- package/themes/original/src/components/BusinessListingSearch/index.tsx +87 -142
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
- package/themes/original/src/components/BusinessProductsList/index.tsx +41 -62
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +561 -479
- 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 +93 -98
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
- package/themes/original/src/components/BusinessesListing/index.tsx +8 -8
- package/themes/original/src/components/Cart/index.tsx +75 -42
- package/themes/original/src/components/CartContent/index.tsx +80 -18
- package/themes/original/src/components/CartContent/styles.tsx +11 -1
- package/themes/original/src/components/Checkout/index.tsx +110 -114
- package/themes/original/src/components/Checkout/styles.tsx +4 -3
- 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 +47 -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 +7 -7
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +14 -20
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
- package/themes/original/src/components/HelpGuide/index.tsx +12 -11
- package/themes/original/src/components/HelpGuide/styles.tsx +5 -0
- package/themes/original/src/components/HelpOrder/index.tsx +12 -20
- 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 +98 -41
- 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 +35 -20
- package/themes/original/src/components/MomentOption/index.tsx +17 -11
- 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 +158 -77
- package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +85 -34
- package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
- package/themes/original/src/components/MyOrders/index.tsx +86 -20
- package/themes/original/src/components/NavBar/index.tsx +7 -6
- 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/index.tsx +115 -215
- package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
- package/themes/original/src/components/OrderItAgain/index.tsx +46 -43
- package/themes/original/src/components/OrderProgress/index.tsx +79 -100
- package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
- package/themes/original/src/components/OrderSummary/index.tsx +3 -36
- package/themes/original/src/components/OrderTypeSelector/index.tsx +13 -6
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +94 -98
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
- package/themes/original/src/components/OrdersOption/index.tsx +97 -88
- 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 +1 -2
- package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
- package/themes/original/src/components/PlaceSpot/index.tsx +249 -47
- package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
- package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
- package/themes/original/src/components/ProductForm/index.tsx +212 -253
- 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 +17 -9
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
- package/themes/original/src/components/ProfessionalFilter/index.tsx +2 -1
- package/themes/original/src/components/ProfessionalProfile/index.tsx +19 -8
- 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 +328 -264
- package/themes/original/src/components/SignupForm/index.tsx +134 -89
- package/themes/original/src/components/SingleOrderCard/index.tsx +129 -54
- package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
- package/themes/original/src/components/SingleProductCard/index.tsx +85 -82
- package/themes/original/src/components/SingleProductCard/styles.tsx +2 -9
- 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 +13 -2
- package/themes/original/src/components/UpsellingProducts/index.tsx +244 -215
- package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
- package/themes/original/src/components/UserDetails/index.tsx +5 -3
- package/themes/original/src/components/UserFormDetails/index.tsx +6 -48
- 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 +19 -28
- package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
- package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
- package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
- package/themes/original/src/components/Wallets/index.tsx +230 -164
- package/themes/original/src/components/Wallets/styles.tsx +12 -8
- 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 +6 -4
- package/themes/original/src/components/shared/OButton.tsx +9 -4
- 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 +44 -6
- package/themes/original/src/utils/index.tsx +305 -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>
|
|
@@ -32,7 +32,6 @@ import {
|
|
|
32
32
|
HeaderWrapper,
|
|
33
33
|
ListWrapper,
|
|
34
34
|
FeaturedWrapper,
|
|
35
|
-
OrderProgressWrapper,
|
|
36
35
|
FarAwayMessage,
|
|
37
36
|
AddressInputContainer,
|
|
38
37
|
PreorderInput,
|
|
@@ -40,8 +39,7 @@ import {
|
|
|
40
39
|
BusinessLogosContainer
|
|
41
40
|
} from './styles';
|
|
42
41
|
|
|
43
|
-
import {
|
|
44
|
-
import { OButton, OIcon, OText, OBottomPopup, OModal } from '../../../shared';
|
|
42
|
+
import { OIcon, OText, OModal } from '../../../shared';
|
|
45
43
|
import { BusinessesListingParams } from '../../../../types';
|
|
46
44
|
import { NotFoundSource } from '../../../NotFoundSource';
|
|
47
45
|
import { BusinessTypeFilter } from '../../../BusinessTypeFilter';
|
|
@@ -50,10 +48,12 @@ import { OrderTypeSelector } from '../../../OrderTypeSelector';
|
|
|
50
48
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
51
49
|
import { BusinessFeaturedController } from '../../../BusinessFeaturedController';
|
|
52
50
|
import { HighestRatedBusinesses } from '../../../HighestRatedBusinesses';
|
|
53
|
-
import { getTypesText
|
|
51
|
+
import { getTypesText } from '../../../../utils';
|
|
54
52
|
import { OrderProgress } from '../../../OrderProgress';
|
|
55
53
|
import { useFocusEffect, useIsFocused } from '@react-navigation/native';
|
|
56
54
|
import FastImage from 'react-native-fast-image';
|
|
55
|
+
import IconAntDesign from 'react-native-vector-icons/AntDesign';
|
|
56
|
+
import { CitiesControl } from '../../../CitiesControl'
|
|
57
57
|
|
|
58
58
|
const PIXELS_TO_SCROLL = 2000;
|
|
59
59
|
|
|
@@ -61,12 +61,10 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
61
61
|
const {
|
|
62
62
|
navigation,
|
|
63
63
|
businessesList,
|
|
64
|
-
searchValue,
|
|
65
64
|
getBusinesses,
|
|
66
65
|
handleChangeBusinessType,
|
|
67
66
|
handleBusinessClick,
|
|
68
67
|
paginationProps,
|
|
69
|
-
handleChangeSearch,
|
|
70
68
|
businessId,
|
|
71
69
|
isGuestUser,
|
|
72
70
|
handleUpdateBusinessList,
|
|
@@ -78,11 +76,10 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
78
76
|
const [orderingTheme] = useOrderingTheme()
|
|
79
77
|
const isFocused = useIsFocused();
|
|
80
78
|
const appState = useRef(AppState.currentState)
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
const isChewLayout = orderingTheme?.theme?.header?.components?.layout?.type === 'chew'
|
|
84
|
-
const hideCities = orderingTheme?.theme?.business_listing_view?.components?.cities?.hidden
|
|
79
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
80
|
+
const hideCities = theme?.business_listing_view?.components?.cities?.hidden ?? true
|
|
85
81
|
const [refreshing] = useState(false);
|
|
82
|
+
const bgHeader = orderingTheme?.theme?.business_listing_view?.components?.business_hero?.components?.image
|
|
86
83
|
const styles = StyleSheet.create({
|
|
87
84
|
container: {
|
|
88
85
|
marginBottom: 0,
|
|
@@ -132,7 +129,11 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
132
129
|
borderColor: theme.colors.backgroundGray,
|
|
133
130
|
borderRadius: 8,
|
|
134
131
|
marginHorizontal: 40,
|
|
135
|
-
|
|
132
|
+
minHeight: 45,
|
|
133
|
+
paddingVertical: 5,
|
|
134
|
+
paddingHorizontal: 20,
|
|
135
|
+
borderWidth: 1,
|
|
136
|
+
justifyContent: 'center'
|
|
136
137
|
},
|
|
137
138
|
businessSkeleton: {
|
|
138
139
|
borderRadius: 8,
|
|
@@ -162,16 +163,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
162
163
|
const timerId = useRef<any>(false)
|
|
163
164
|
const [favoriteIds, setFavoriteIds] = useState<any>([])
|
|
164
165
|
const chewOrderTypes = [{ name: t('DELIVERY', 'Delivery').toUpperCase(), value: 1 }, { name: t('PICKUP', 'Pickup').toUpperCase(), value: 2 }]
|
|
165
|
-
|
|
166
|
-
// const panResponder = useRef(
|
|
167
|
-
// PanResponder.create({
|
|
168
|
-
// onMoveShouldSetPanResponder: (e, gestureState) => {
|
|
169
|
-
// const { dx, dy } = gestureState;
|
|
170
|
-
// resetInactivityTimeout()
|
|
171
|
-
// return (Math.abs(dx) > 20) || (Math.abs(dy) > 20);
|
|
172
|
-
// },
|
|
173
|
-
// })
|
|
174
|
-
// ).current
|
|
166
|
+
const enabledPoweredByOrdering = configs?.powered_by_ordering_module?.value
|
|
175
167
|
|
|
176
168
|
const handleMomentClick = () => {
|
|
177
169
|
if (isPreorderEnabled) {
|
|
@@ -191,11 +183,15 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
191
183
|
paginationProps.totalPages === paginationProps.currentPage
|
|
192
184
|
);
|
|
193
185
|
|
|
194
|
-
if (y + PIXELS_TO_SCROLL > height && !businessesList.loading && hasMore) {
|
|
186
|
+
if (y + PIXELS_TO_SCROLL > height && !businessesList.loading && hasMore && businessesList?.businesses?.length > 0) {
|
|
195
187
|
getBusinesses();
|
|
196
188
|
}
|
|
197
189
|
};
|
|
198
190
|
|
|
191
|
+
const convertToRadian = (value: number) => {
|
|
192
|
+
return value * Math.PI / 180
|
|
193
|
+
}
|
|
194
|
+
|
|
199
195
|
const getDistance = (lat1: any, lon1: any, lat2: any, lon2: any) => {
|
|
200
196
|
const R = 6371 // km
|
|
201
197
|
const dLat = convertToRadian(lat2 - lat1)
|
|
@@ -294,7 +290,10 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
294
290
|
|
|
295
291
|
if (logosLayout) {
|
|
296
292
|
return (
|
|
297
|
-
<BusinessLogosContainer
|
|
293
|
+
<BusinessLogosContainer
|
|
294
|
+
horizontal
|
|
295
|
+
showsHorizontalScrollIndicator={false}
|
|
296
|
+
>
|
|
298
297
|
{businessesList?.loading ? (
|
|
299
298
|
<Placeholder Animation={Fade}>
|
|
300
299
|
<View style={{ flexDirection: 'row' }}>
|
|
@@ -308,14 +307,27 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
308
307
|
) : (
|
|
309
308
|
<>
|
|
310
309
|
{businessesList.businesses
|
|
311
|
-
?.filter(business => business?.
|
|
310
|
+
?.filter(business => business?.open)
|
|
312
311
|
?.map(business => (
|
|
313
312
|
<TouchableOpacity
|
|
314
313
|
key={business?.id}
|
|
315
314
|
onPress={() => handleBusinessClick && handleBusinessClick(business)}
|
|
315
|
+
style={{
|
|
316
|
+
width: 60,
|
|
317
|
+
height: 60,
|
|
318
|
+
borderRadius: 8,
|
|
319
|
+
marginRight: 5
|
|
320
|
+
}}
|
|
316
321
|
>
|
|
317
322
|
<FastImage
|
|
318
|
-
style={{
|
|
323
|
+
style={{
|
|
324
|
+
width: 56,
|
|
325
|
+
height: 56,
|
|
326
|
+
marginRight: 20,
|
|
327
|
+
borderRadius: 8,
|
|
328
|
+
borderColor: theme.colors.primary,
|
|
329
|
+
borderWidth: business?.slug === actualSlug ? 2 : 0
|
|
330
|
+
}}
|
|
319
331
|
source={{
|
|
320
332
|
uri: business?.logo,
|
|
321
333
|
priority: FastImage.priority.normal,
|
|
@@ -331,7 +343,10 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
331
343
|
}
|
|
332
344
|
|
|
333
345
|
return (
|
|
334
|
-
<IOScrollView
|
|
346
|
+
<IOScrollView
|
|
347
|
+
style={styles.container}
|
|
348
|
+
onScroll={(e) => handleScroll(e)}
|
|
349
|
+
showsVerticalScrollIndicator={false}
|
|
335
350
|
refreshControl={
|
|
336
351
|
<RefreshControl
|
|
337
352
|
refreshing={refreshing}
|
|
@@ -339,6 +354,13 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
339
354
|
/>
|
|
340
355
|
}
|
|
341
356
|
>
|
|
357
|
+
{enabledPoweredByOrdering && auth && (
|
|
358
|
+
<View style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', top: 20 }}>
|
|
359
|
+
<OText>
|
|
360
|
+
Powered By Ordering.co
|
|
361
|
+
</OText>
|
|
362
|
+
</View>
|
|
363
|
+
)}
|
|
342
364
|
<View style={{
|
|
343
365
|
height: !isPreOrderSetting && isChewLayout ? 150 : isChewLayout ? 200 : isFarAway ? 150 : 100,
|
|
344
366
|
marginTop: Platform.OS == 'ios' ? 0 : 50,
|
|
@@ -347,8 +369,8 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
347
369
|
>
|
|
348
370
|
{isChewLayout && (
|
|
349
371
|
<View style={{ marginTop: 30, paddingHorizontal: 30, flexDirection: 'row', justifyContent: 'space-between' }}>
|
|
350
|
-
<OText size={
|
|
351
|
-
{t('WELCOME', 'Welcome')} {user?.name}
|
|
372
|
+
<OText size={24} weight={700} color={theme.colors?.white}>
|
|
373
|
+
{t('WELCOME', 'Welcome')} {user?.name}
|
|
352
374
|
</OText>
|
|
353
375
|
</View>
|
|
354
376
|
)}
|
|
@@ -426,7 +448,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
426
448
|
</OrderControlContainer>
|
|
427
449
|
) : (
|
|
428
450
|
<>
|
|
429
|
-
{
|
|
451
|
+
{isPreOrderSetting && (
|
|
430
452
|
<View style={{ paddingHorizontal: 30 }}>
|
|
431
453
|
<PreorderInput
|
|
432
454
|
isChewLayout={isChewLayout}
|
|
@@ -444,13 +466,14 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
444
466
|
</View>
|
|
445
467
|
{!isChewLayout ? (
|
|
446
468
|
<HeaderWrapper
|
|
447
|
-
source={theme.images.
|
|
469
|
+
source={bgHeader ? { uri: bgHeader } : theme.images.backgrounds.business_list_header}
|
|
448
470
|
style={{ paddingTop: top + 20 }}
|
|
449
|
-
resizeMode='
|
|
471
|
+
resizeMode='cover'
|
|
450
472
|
>
|
|
451
473
|
{!auth && (
|
|
474
|
+
|
|
452
475
|
<TouchableOpacity onPress={() => navigation?.canGoBack() && navigation.goBack()} style={{ position: 'absolute', marginStart: 40, paddingVertical: 20 }}>
|
|
453
|
-
<OIcon src={theme.images.general.arrow_left}
|
|
476
|
+
<OIcon src={theme.images.general.arrow_left} color={theme.colors.textNormal} />
|
|
454
477
|
</TouchableOpacity>
|
|
455
478
|
)}
|
|
456
479
|
</HeaderWrapper>
|
|
@@ -460,47 +483,28 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
460
483
|
handleChangeBusinessType={handleChangeBusinessType}
|
|
461
484
|
isChewLayout
|
|
462
485
|
chewOrderTypes={chewOrderTypes}
|
|
486
|
+
handleChangeType={setOrderTypeValue}
|
|
463
487
|
/>
|
|
464
488
|
</OrderTypesContainer>
|
|
465
489
|
)}
|
|
466
|
-
{!businessId && (
|
|
467
|
-
<SearchBar
|
|
468
|
-
forwardRef={searchBarRef}
|
|
469
|
-
onSearch={handleChangeSearch}
|
|
470
|
-
searchValue={searchValue}
|
|
471
|
-
lazyLoad
|
|
472
|
-
hideIcon
|
|
473
|
-
isCancelXButtonShow={!!searchValue}
|
|
474
|
-
onCancel={() => handleChangeSearch('')}
|
|
475
|
-
placeholder={t('SEARCH', 'Search')}
|
|
476
|
-
height={50}
|
|
477
|
-
isDisabled={!businessTypes}
|
|
478
|
-
inputContainerStyles={styles.inputContainerStyles}
|
|
479
|
-
containerStyles={{
|
|
480
|
-
marginHorizontal: 40,
|
|
481
|
-
marginTop: 20
|
|
482
|
-
}}
|
|
483
|
-
inputStyle={{ ...styles.searchInput, ...Platform.OS === 'ios' ? { paddingBottom: 6 } : { paddingBottom: 4 } }}
|
|
484
|
-
onSubmitEditing={() => { configs?.advanced_business_search_enabled?.value === '1' && navigation.navigate('BusinessSearch', { businessTypes, defaultTerm: searchValue }) }}
|
|
485
|
-
/>
|
|
486
|
-
)}
|
|
487
490
|
|
|
488
|
-
{!hideCities && (
|
|
489
|
-
<View style={{ marginTop:
|
|
490
|
-
<
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
491
|
+
{!hideCities && orderTypeValue === 2 && (
|
|
492
|
+
<View style={{ marginTop: 20 }}>
|
|
493
|
+
<TouchableOpacity
|
|
494
|
+
style={styles.buttonCityStyle}
|
|
495
|
+
onPress={() => setIsOpenCities(true)}
|
|
496
|
+
disabled={orderState?.loading}
|
|
497
|
+
>
|
|
498
|
+
<OText size={18} color={theme.colors.backgroundGray} weight='bold' style={{ textAlign: 'center' }}>
|
|
499
|
+
{citiesState?.cities?.find((city: any) => city?.id === orderState?.options?.city_id)?.name || t('FILTER_BY_CITY', 'Filter by city')}
|
|
500
|
+
</OText>
|
|
501
|
+
</TouchableOpacity>
|
|
496
502
|
</View>
|
|
497
503
|
)}
|
|
498
|
-
<
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
/>
|
|
503
|
-
</OrderProgressWrapper>
|
|
504
|
+
<OrderProgress
|
|
505
|
+
{...props}
|
|
506
|
+
isFocused={isFocused}
|
|
507
|
+
/>
|
|
504
508
|
{
|
|
505
509
|
!businessId && !props.franchiseId && featuredBusiness && featuredBusiness.length > 0 && (
|
|
506
510
|
<FeaturedWrapper>
|
|
@@ -533,19 +537,23 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
533
537
|
</FeaturedWrapper>
|
|
534
538
|
)
|
|
535
539
|
}
|
|
540
|
+
{!isChewLayout && (
|
|
541
|
+
<>
|
|
542
|
+
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100 }} />
|
|
543
|
+
{
|
|
544
|
+
!businessId && !props.franchiseId && (
|
|
545
|
+
<HighestRatedBusinesses
|
|
546
|
+
onBusinessClick={handleBusinessClick}
|
|
547
|
+
navigation={navigation}
|
|
548
|
+
favoriteIds={favoriteIds}
|
|
549
|
+
setFavoriteIds={setFavoriteIds}
|
|
550
|
+
/>
|
|
551
|
+
)
|
|
552
|
+
}
|
|
553
|
+
</>
|
|
554
|
+
)}
|
|
536
555
|
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100 }} />
|
|
537
|
-
{
|
|
538
|
-
!businessId && !props.franchiseId && (
|
|
539
|
-
<HighestRatedBusinesses
|
|
540
|
-
onBusinessClick={handleBusinessClick}
|
|
541
|
-
navigation={navigation}
|
|
542
|
-
favoriteIds={favoriteIds}
|
|
543
|
-
setFavoriteIds={setFavoriteIds}
|
|
544
|
-
/>
|
|
545
|
-
)
|
|
546
|
-
}
|
|
547
|
-
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100 }} />
|
|
548
|
-
<ListWrapper>
|
|
556
|
+
<ListWrapper style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}>
|
|
549
557
|
{!businessId && (
|
|
550
558
|
<BusinessTypeFilter
|
|
551
559
|
images={props.images}
|
|
@@ -568,6 +576,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
568
576
|
<BusinessController
|
|
569
577
|
key={`${business.id}_` + i}
|
|
570
578
|
enableIntersection
|
|
579
|
+
isCustomLayout={isChewLayout}
|
|
571
580
|
business={business}
|
|
572
581
|
isBusinessOpen={business.open}
|
|
573
582
|
handleCustomClick={handleBusinessClick}
|
|
@@ -644,25 +653,11 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
644
653
|
onClose={() => setIsOpenCities(false)}
|
|
645
654
|
title={t('SELECT_A_CITY', 'Select a city')}
|
|
646
655
|
>
|
|
647
|
-
<
|
|
648
|
-
{citiesState?.cities
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
padding: 10,
|
|
653
|
-
borderBottomWidth: 1,
|
|
654
|
-
borderBottomColor: orderState?.options?.city_id === city?.id ? theme.colors.primary : theme.colors.backgroundGray,
|
|
655
|
-
marginBottom: 10,
|
|
656
|
-
}}
|
|
657
|
-
onPress={() => handleChangeCity(city?.id)}
|
|
658
|
-
disabled={orderState?.loading}
|
|
659
|
-
>
|
|
660
|
-
<OText color={orderState?.options?.city_id === city?.id ? theme.colors.primary : theme.colors.black}>
|
|
661
|
-
{city?.name}
|
|
662
|
-
</OText>
|
|
663
|
-
</TouchableOpacity>
|
|
664
|
-
))}
|
|
665
|
-
</View>
|
|
656
|
+
<CitiesControl
|
|
657
|
+
cities={citiesState?.cities}
|
|
658
|
+
onClose={() => setIsOpenCities(false)}
|
|
659
|
+
handleChangeCity={handleChangeCity}
|
|
660
|
+
/>
|
|
666
661
|
</OModal>
|
|
667
662
|
</IOScrollView>
|
|
668
663
|
);
|
|
@@ -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,
|
|
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'
|
|
@@ -12,11 +11,12 @@ import { NotificationSetting } from '../../../../../src/components/NotificationS
|
|
|
12
11
|
export const BusinessesListing = (props: any) => {
|
|
13
12
|
const { logosLayout } = props
|
|
14
13
|
const theme = useTheme()
|
|
15
|
-
const
|
|
16
|
-
const layout = orderingTheme?.theme?.business_listing_view?.components?.layout?.type || 'original'
|
|
14
|
+
const layout = theme?.business_listing_view?.components?.layout?.type || 'original'
|
|
17
15
|
const [, t] = useLanguage();
|
|
18
16
|
const [{ auth }] = useSession()
|
|
19
17
|
const [, { getLastOrderHasNoReview }] = useOrder();
|
|
18
|
+
const [{ configs }] = useConfig()
|
|
19
|
+
const isShowReviewsPopupEnabled = configs?.show_reviews_popups_enabled?.value === '1'
|
|
20
20
|
|
|
21
21
|
const [, setIsReviewed] = useState()
|
|
22
22
|
const [checkNotificationStatus, setCheckNotificationStatus] = useState({ open: false, checked: false })
|
|
@@ -74,16 +74,15 @@ export const BusinessesListing = (props: any) => {
|
|
|
74
74
|
)
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
|
|
79
77
|
useEffect(() => {
|
|
78
|
+
if (!isShowReviewsPopupEnabled) return
|
|
80
79
|
(checkNotificationStatus?.checked && auth) && _getLastOrderHasNoReview()
|
|
81
|
-
}, [checkNotificationStatus, auth])
|
|
80
|
+
}, [checkNotificationStatus, auth, isShowReviewsPopupEnabled])
|
|
82
81
|
|
|
83
82
|
return (
|
|
84
83
|
<>
|
|
85
84
|
{((layout === 'original') || logosLayout) && <OriginalBusinessListing {...props} />}
|
|
86
|
-
{(layout === '
|
|
85
|
+
{(layout === 'appointments') && !logosLayout && <AppointmentBusinessListing {...props} />}
|
|
87
86
|
|
|
88
87
|
{lastOrderReview?.isReviewOpen && (
|
|
89
88
|
<OBottomPopup
|
|
@@ -94,6 +93,7 @@ export const BusinessesListing = (props: any) => {
|
|
|
94
93
|
bottomContainerStyle={{ height: 'auto', borderRadius: 10 }}
|
|
95
94
|
titleStyle={{ textAlign: 'center' }}
|
|
96
95
|
closeIcon={theme.images.general.close}
|
|
96
|
+
presentationStyle='overFullScreen'
|
|
97
97
|
>
|
|
98
98
|
{lastOrderReview?.order && <ReviewTrigger order={lastOrderReview?.order} handleOpenOrderReview={handleOpenOrderReview} />}
|
|
99
99
|
</OBottomPopup>
|