ordering-ui-react-native 0.16.42 → 0.16.43-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 +7 -5
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/ActiveOrders/index.tsx +61 -63
- package/src/components/ActiveOrders/styles.tsx +8 -14
- package/src/components/BusinessBasicInformation/index.tsx +11 -19
- package/src/components/BusinessInformation/index.tsx +33 -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/NotificationSetting/index.tsx +85 -0
- package/src/components/OrdersOption/index.tsx +54 -56
- package/src/components/PaymentOptions/index.tsx +298 -345
- package/src/components/PaymentOptionsWebView/index.tsx +120 -121
- package/src/components/ReviewDriver/index.tsx +1 -1
- package/src/components/ReviewOrder/index.tsx +2 -2
- package/src/components/ReviewProducts/index.tsx +11 -0
- package/src/components/SingleProductReview/index.tsx +8 -5
- package/src/components/StripeElementsForm/index.tsx +25 -16
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OBottomPopup.tsx +6 -2
- package/src/index.tsx +2 -0
- package/src/pages/BusinessesListing.tsx +7 -6
- package/src/pages/OrderDetails.tsx +1 -1
- package/src/pages/ReviewDriver.tsx +2 -2
- package/src/pages/ReviewOrder.tsx +2 -2
- 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/BusinessController/index.tsx +2 -2
- package/themes/business/src/components/Chat/index.tsx +40 -32
- package/themes/business/src/components/DriverMap/index.tsx +7 -5
- package/themes/business/src/components/DriverSchedule/index.tsx +36 -19
- package/themes/business/src/components/LoginForm/index.tsx +111 -74
- package/themes/business/src/components/MapView/index.tsx +12 -1
- package/themes/business/src/components/MessagesOption/index.tsx +11 -1
- package/themes/business/src/components/NewOrderNotification/index.tsx +26 -41
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +25 -19
- package/themes/business/src/components/OrdersListManager/index.tsx +10 -3
- package/themes/business/src/components/OrdersOption/index.tsx +65 -21
- 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/index.tsx +22 -24
- package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
- package/themes/business/src/components/ReviewCustomer/index.tsx +27 -13
- package/themes/business/src/components/ScheduleBlocked/index.tsx +2 -2
- package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
- package/themes/business/src/components/UserProfileForm/index.tsx +2 -0
- package/themes/business/src/components/shared/ODropDown.tsx +42 -8
- package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
- package/themes/business/src/types/index.tsx +15 -9
- 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 +4 -0
- package/themes/original/src/components/AddressDetails/index.tsx +10 -8
- package/themes/original/src/components/AddressForm/index.tsx +157 -140
- package/themes/original/src/components/AddressList/index.tsx +1 -1
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +218 -147
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +2 -2
- package/themes/original/src/components/BusinessController/index.tsx +216 -113
- package/themes/original/src/components/BusinessController/styles.tsx +1 -8
- 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 +109 -139
- 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 +59 -60
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +210 -115
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +18 -11
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +37 -25
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -4
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +275 -120
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +47 -10
- package/themes/original/src/components/BusinessesListing/index.tsx +95 -7
- package/themes/original/src/components/Cart/index.tsx +53 -15
- package/themes/original/src/components/Cart/styles.tsx +4 -0
- package/themes/original/src/components/CartContent/index.tsx +22 -16
- package/themes/original/src/components/Checkout/index.tsx +114 -118
- 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 +4 -4
- package/themes/original/src/components/DriverTips/styles.tsx +2 -1
- package/themes/original/src/components/FavoriteList/index.tsx +19 -0
- 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 +20 -12
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +25 -10
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +4 -0
- package/themes/original/src/components/HelpGuide/index.tsx +9 -8
- package/themes/original/src/components/HelpOrder/index.tsx +9 -8
- package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
- package/themes/original/src/components/LoginForm/Otp/index.tsx +95 -73
- package/themes/original/src/components/LoginForm/index.tsx +98 -41
- package/themes/original/src/components/LottieAnimation/index.tsx +69 -0
- package/themes/original/src/components/Messages/index.tsx +20 -20
- package/themes/original/src/components/MomentOption/index.tsx +8 -6
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -92
- package/themes/original/src/components/MultiCheckout/index.tsx +6 -0
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -16
- package/themes/original/src/components/MyOrders/index.tsx +88 -22
- package/themes/original/src/components/NavBar/index.tsx +15 -9
- 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 +148 -0
- package/themes/original/src/components/Notifications/styles.tsx +17 -0
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +167 -0
- package/themes/original/src/components/OrderDetails/index.tsx +200 -37
- package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
- package/themes/original/src/components/OrderItAgain/index.tsx +75 -0
- package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
- package/themes/original/src/components/OrderProgress/index.tsx +77 -66
- package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
- package/themes/original/src/components/OrderSummary/index.tsx +2 -35
- package/themes/original/src/components/OrderTypeSelector/index.tsx +85 -36
- package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
- 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 +71 -55
- 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 +639 -664
- package/themes/original/src/components/ProductForm/styles.tsx +10 -11
- package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
- package/themes/original/src/components/ProductOption/index.tsx +1 -1
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +0 -1
- package/themes/original/src/components/ProfessionalFilter/index.tsx +2 -1
- package/themes/original/src/components/ProfessionalProfile/index.tsx +26 -14
- package/themes/original/src/components/Promotions/index.tsx +232 -219
- package/themes/original/src/components/Promotions/styles.tsx +7 -2
- package/themes/original/src/components/ReviewDriver/index.tsx +7 -7
- package/themes/original/src/components/ReviewOrder/index.tsx +18 -3
- package/themes/original/src/components/ReviewProducts/index.tsx +2 -2
- package/themes/original/src/components/ReviewTrigger/index.tsx +118 -0
- package/themes/original/src/components/ReviewTrigger/styles.tsx +34 -0
- package/themes/original/src/components/SearchBar/index.tsx +5 -3
- package/themes/original/src/components/ServiceForm/index.tsx +410 -258
- package/themes/original/src/components/SignupForm/index.tsx +160 -113
- package/themes/original/src/components/SingleOrderCard/index.tsx +229 -181
- package/themes/original/src/components/SingleOrderCard/styles.tsx +0 -7
- package/themes/original/src/components/SingleProductCard/index.tsx +198 -112
- package/themes/original/src/components/SingleProductCard/styles.tsx +3 -10
- 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/StripeElementsForm/index.tsx +13 -2
- package/themes/original/src/components/UpsellingProducts/index.tsx +15 -5
- 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 +56 -31
- package/themes/original/src/components/UserProfile/styles.ts +17 -0
- package/themes/original/src/components/UserProfileForm/index.tsx +10 -10
- 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 +176 -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 +48 -15
- package/themes/original/src/components/shared/OButton.tsx +10 -3
- package/themes/original/src/components/shared/OIcon.tsx +8 -1
- package/themes/original/src/components/shared/OInput.tsx +13 -3
- package/themes/original/src/layouts/Container.tsx +13 -9
- package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
- package/themes/original/src/types/index.tsx +82 -28
- package/themes/original/src/utils/index.tsx +103 -58
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
2
|
import { PromotionsController, useLanguage, useUtils } from 'ordering-components/native'
|
|
3
|
+
import FastImage from 'react-native-fast-image'
|
|
3
4
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
PromotionsContainer,
|
|
6
|
+
SingleOfferContainer,
|
|
7
|
+
OfferInformation,
|
|
8
|
+
SearchBarContainer,
|
|
9
|
+
SingleBusinessOffer,
|
|
10
|
+
AvailableBusinesses,
|
|
11
|
+
OfferData,
|
|
12
|
+
Code,
|
|
13
|
+
BusinessInfo,
|
|
14
|
+
WrapperSingleOffer
|
|
13
15
|
} from './styles'
|
|
14
16
|
import { SearchBar } from '../SearchBar'
|
|
15
17
|
import NavBar from '../NavBar'
|
|
@@ -18,233 +20,244 @@ import { OButton, OIcon, OModal, OText } from '../shared'
|
|
|
18
20
|
import { Placeholder, PlaceholderLine } from 'rn-placeholder'
|
|
19
21
|
import { NotFoundSource } from '../NotFoundSource'
|
|
20
22
|
import { View, StyleSheet, ScrollView, Platform, RefreshControl } from 'react-native'
|
|
21
|
-
import FastImage from 'react-native-fast-image'
|
|
22
23
|
import { PromotionParams } from '../../types'
|
|
23
24
|
import { Container } from '../../layouts/Container'
|
|
24
25
|
|
|
25
26
|
const PromotionsUI = (props: PromotionParams) => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
const {
|
|
28
|
+
navigation,
|
|
29
|
+
offersState,
|
|
30
|
+
handleSearchValue,
|
|
31
|
+
searchValue,
|
|
32
|
+
loadOffers,
|
|
33
|
+
offerSelected,
|
|
34
|
+
setOfferSelected
|
|
35
|
+
} = props
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
const theme = useTheme();
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
39
|
+
const styles = StyleSheet.create({
|
|
40
|
+
productStyle: {
|
|
41
|
+
width: 75,
|
|
42
|
+
height: 75,
|
|
43
|
+
borderRadius: 7.6
|
|
44
|
+
},
|
|
45
|
+
buttonStyle: {
|
|
46
|
+
width: '100%',
|
|
47
|
+
height: 35,
|
|
48
|
+
paddingLeft: 0,
|
|
49
|
+
paddingRight: 0,
|
|
50
|
+
borderRadius: 8
|
|
51
|
+
},
|
|
52
|
+
offerTitle: {
|
|
53
|
+
fontSize: 14
|
|
54
|
+
},
|
|
55
|
+
offerDescription: {
|
|
56
|
+
color: '#909BA9',
|
|
57
|
+
fontSize: 12
|
|
58
|
+
},
|
|
59
|
+
offerExtraInfo: {
|
|
60
|
+
fontSize: 12
|
|
61
|
+
},
|
|
62
|
+
modalButtonStyle: {
|
|
63
|
+
width: 100,
|
|
64
|
+
height: 35,
|
|
65
|
+
paddingLeft: 0,
|
|
66
|
+
paddingRight: 0,
|
|
67
|
+
borderRadius: 7.6
|
|
68
|
+
}
|
|
69
|
+
});
|
|
68
70
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
const [, t] = useLanguage()
|
|
72
|
+
const [{ parseDate, parsePrice, optimizeImage }] = useUtils()
|
|
73
|
+
const [openModal, setOpenModal] = useState(false)
|
|
74
|
+
const [refreshing] = useState(false);
|
|
73
75
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
const handleClickOffer = (offer: any) => {
|
|
77
|
+
setOpenModal(true)
|
|
78
|
+
setOfferSelected(offer)
|
|
79
|
+
}
|
|
78
80
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
const handleBusinessClick = (store: any) => {
|
|
82
|
+
setOpenModal(false)
|
|
83
|
+
navigation.navigate('Business', { store: store.slug })
|
|
84
|
+
}
|
|
83
85
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
86
|
+
const handleOnRefresh = () => {
|
|
87
|
+
if (!offersState.loading) {
|
|
88
|
+
loadOffers();
|
|
88
89
|
}
|
|
90
|
+
}
|
|
89
91
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
const filteredOffers = offersState?.offers?.filter((offer: any) => offer.name.toLowerCase().includes(searchValue.toLowerCase()))
|
|
93
|
+
const targetString = offerSelected?.target === 1
|
|
94
|
+
? t('SUBTOTAL', 'Subtotal')
|
|
95
|
+
: offerSelected?.target === 2
|
|
96
|
+
? t('DELIVERY_FEE', 'Delivery fee')
|
|
97
|
+
: t('SERVICE_FEE', 'Service fee')
|
|
96
98
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
99
|
+
return (
|
|
100
|
+
<Container
|
|
101
|
+
noPadding
|
|
102
|
+
refreshControl={
|
|
103
|
+
<RefreshControl
|
|
104
|
+
refreshing={refreshing}
|
|
105
|
+
onRefresh={() => handleOnRefresh()}
|
|
106
|
+
/>
|
|
107
|
+
}
|
|
108
|
+
>
|
|
109
|
+
<NavBar
|
|
110
|
+
title={t('PROMOTIONS', 'Promotions')}
|
|
111
|
+
titleAlign={'center'}
|
|
112
|
+
onActionLeft={() => navigation.goBack()}
|
|
113
|
+
showCall={false}
|
|
114
|
+
style={{ paddingVertical: Platform.OS === 'ios' ? 0 : 20, marginLeft: 20 }}
|
|
115
|
+
/>
|
|
116
|
+
<PromotionsContainer>
|
|
117
|
+
<SearchBarContainer>
|
|
118
|
+
<SearchBar
|
|
119
|
+
placeholder={t('SEARCH_OFFERS', 'Search offers')}
|
|
120
|
+
onSearch={handleSearchValue}
|
|
121
|
+
/>
|
|
122
|
+
</SearchBarContainer>
|
|
123
|
+
|
|
124
|
+
{offersState?.loading && (
|
|
125
|
+
<>
|
|
126
|
+
{[...Array(5).keys()].map((key, i) => (
|
|
127
|
+
<Placeholder key={i} style={{ flexDirection: 'row', marginBottom: 20 }}>
|
|
128
|
+
<PlaceholderLine height={10} width={45} />
|
|
129
|
+
<PlaceholderLine height={10} width={60} />
|
|
130
|
+
<PlaceholderLine height={10} width={75} />
|
|
131
|
+
</Placeholder>
|
|
132
|
+
))}
|
|
133
|
+
</>
|
|
134
|
+
)}
|
|
135
|
+
{((!offersState?.loading && filteredOffers?.length === 0) || offersState?.error) && (
|
|
136
|
+
<NotFoundSource
|
|
137
|
+
content={offersState?.error || t('NOT_FOUND_OFFERS', 'Not found offers')}
|
|
138
|
+
/>
|
|
139
|
+
)}
|
|
140
|
+
<ScrollView>
|
|
141
|
+
{!offersState?.loading && offersState.offers?.length > 0 && filteredOffers?.map((offer: any) => (
|
|
142
|
+
<WrapperSingleOffer key={offer.id}>
|
|
143
|
+
<SingleOfferContainer>
|
|
144
|
+
<FastImage
|
|
145
|
+
style={{ height: 80, width: 80, aspectRatio: 3 / 2, borderRadius: 8 }}
|
|
146
|
+
source={typeof offer?.image !== 'number' ? {
|
|
147
|
+
uri: optimizeImage(offer?.image, 'h_1024,c_limit'),
|
|
148
|
+
priority: FastImage.priority.normal,
|
|
149
|
+
} : theme.images?.dummies?.businessLogo}
|
|
104
150
|
/>
|
|
105
|
-
|
|
151
|
+
<OfferInformation>
|
|
152
|
+
<OText style={styles.offerTitle} numberOfLines={2}>{offer?.name}</OText>
|
|
153
|
+
{!!offer?.description && (
|
|
154
|
+
<OText style={styles.offerDescription} numberOfLines={2}>{offer?.description}</OText>
|
|
155
|
+
)}
|
|
156
|
+
<OText style={styles.offerExtraInfo}>
|
|
157
|
+
{t('EXPIRES', 'Expires')} {parseDate(offer?.end, { outputFormat: 'MMM DD, YYYY' })}
|
|
158
|
+
</OText>
|
|
159
|
+
<AvailableBusinesses>
|
|
160
|
+
<OText style={styles.offerExtraInfo} numberOfLines={1}>
|
|
161
|
+
{t('APPLY_FOR', 'Apply for')}:
|
|
162
|
+
{offer.businesses.map((business: any, i: number) => (
|
|
163
|
+
<React.Fragment key={i}>{' '}{business?.name}{i + 1 < offer.businesses?.length ? ',' : ''}</React.Fragment>
|
|
164
|
+
))}
|
|
165
|
+
</OText>
|
|
166
|
+
</AvailableBusinesses>
|
|
167
|
+
</OfferInformation>
|
|
168
|
+
</SingleOfferContainer>
|
|
169
|
+
<OButton
|
|
170
|
+
onClick={() => handleClickOffer(offer)}
|
|
171
|
+
text={t('VIEW', 'View')}
|
|
172
|
+
style={styles.buttonStyle}
|
|
173
|
+
textStyle={{ fontSize: 14, color: '#fff', flexWrap: 'nowrap' }}
|
|
174
|
+
/>
|
|
175
|
+
</WrapperSingleOffer>
|
|
176
|
+
))}
|
|
177
|
+
</ScrollView>
|
|
178
|
+
<OModal
|
|
179
|
+
open={openModal}
|
|
180
|
+
entireModal
|
|
181
|
+
title={``}
|
|
182
|
+
onClose={() => setOpenModal(false)}
|
|
106
183
|
>
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
</
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
<OText style={{ alignSelf: 'center', fontWeight: '700' }} mBottom={20}>
|
|
176
|
-
{offerSelected?.name} / {t('VALUE_OF_OFFER', 'Value of offer')}: {offerSelected?.rate_type === 1 ? `${offerSelected?.rate}%` : `${parsePrice(offerSelected?.rate)}`}
|
|
177
|
-
</OText>
|
|
178
|
-
<OfferData>
|
|
179
|
-
{offerSelected?.type === 2 && (
|
|
180
|
-
<Code>
|
|
181
|
-
<OText>{t('YOUR_CODE', 'Your code')}</OText>
|
|
182
|
-
<OText color={theme.colors.primary}>{offerSelected.coupon}</OText>
|
|
183
|
-
</Code>
|
|
184
|
-
)}
|
|
185
|
-
<OText>{t('APPLIES_TO', 'Applies to')}: {targetString}</OText>
|
|
186
|
-
{offerSelected?.auto && (
|
|
187
|
-
<OText>{t('OFFER_AUTOMATIC', 'This offer applies automatic')}</OText>
|
|
188
|
-
)}
|
|
189
|
-
{!!offerSelected?.minimum && (
|
|
190
|
-
<OText>{t('MINIMUM_PURCHASE_FOR_OFFER', 'Minimum purchase for use this offer')}: {parsePrice(offerSelected?.minimum)}</OText>
|
|
191
|
-
)}
|
|
192
|
-
{!!offerSelected?.max_discount && (
|
|
193
|
-
<OText>{t('MAX_DISCOUNT_ALLOWED', 'Max discount allowed')}: {parsePrice(offerSelected?.max_discount)}</OText>
|
|
194
|
-
)}
|
|
195
|
-
{!!offerSelected?.description && (
|
|
196
|
-
<OText>{offerSelected?.description}</OText>
|
|
197
|
-
)}
|
|
198
|
-
</OfferData>
|
|
199
|
-
<OText style={{ marginTop: 10, marginBottom: 10 }}>
|
|
200
|
-
{t('AVAILABLE_BUSINESSES_FOR_OFFER', 'Available businesses for this offer')}:
|
|
201
|
-
</OText>
|
|
202
|
-
<ScrollView style={{ height: '75%' }}>
|
|
203
|
-
{offerSelected?.businesses?.map((business: any) => {
|
|
204
|
-
return (
|
|
205
|
-
<SingleBusinessOffer key={business.id}>
|
|
206
|
-
{business?.logo ? (
|
|
207
|
-
<FastImage
|
|
208
|
-
style={styles.productStyle}
|
|
209
|
-
source={{
|
|
210
|
-
uri: optimizeImage(business?.logo, 'h_250,c_limit'),
|
|
211
|
-
priority: FastImage.priority.normal,
|
|
212
|
-
}}
|
|
213
|
-
resizeMode={FastImage.resizeMode.cover}
|
|
214
|
-
/>
|
|
215
|
-
) : (
|
|
216
|
-
<OIcon
|
|
217
|
-
src={theme?.images?.dummies?.product}
|
|
218
|
-
style={styles.productStyle}
|
|
219
|
-
/>
|
|
220
|
-
)}
|
|
221
|
-
<BusinessInfo>
|
|
222
|
-
<OText style={{ maxWidth: '60%' }}>{business.name}</OText>
|
|
223
|
-
<OButton
|
|
224
|
-
onClick={() => handleBusinessClick(business)}
|
|
225
|
-
text={t('GO_TO_BUSINESSS', 'Go to business')}
|
|
226
|
-
style={styles.modalButtonStyle}
|
|
227
|
-
textStyle={{ fontSize: 10, color: '#fff' }}
|
|
228
|
-
/>
|
|
229
|
-
</BusinessInfo>
|
|
230
|
-
</SingleBusinessOffer>
|
|
231
|
-
)
|
|
232
|
-
})}
|
|
233
|
-
</ScrollView>
|
|
234
|
-
</View>
|
|
235
|
-
</OModal>
|
|
236
|
-
</PromotionsContainer>
|
|
237
|
-
</Container>
|
|
238
|
-
)
|
|
184
|
+
<View style={{ padding: 20 }}>
|
|
185
|
+
<OText style={{ alignSelf: 'center', fontWeight: '700' }} mBottom={20}>
|
|
186
|
+
{offerSelected?.name} / {t('VALUE_OF_OFFER', 'Value of offer')}: {offerSelected?.rate_type === 1 ? `${offerSelected?.rate}%` : `${parsePrice(offerSelected?.rate)}`}
|
|
187
|
+
</OText>
|
|
188
|
+
<OfferData>
|
|
189
|
+
{offerSelected?.type === 2 && (
|
|
190
|
+
<Code>
|
|
191
|
+
<OText>{t('YOUR_CODE', 'Your code')}</OText>
|
|
192
|
+
<OText color={theme.colors.primary}>{offerSelected.coupon}</OText>
|
|
193
|
+
</Code>
|
|
194
|
+
)}
|
|
195
|
+
<OText>{t('APPLIES_TO', 'Applies to')}: {targetString}</OText>
|
|
196
|
+
{offerSelected?.auto && (
|
|
197
|
+
<OText>{t('OFFER_AUTOMATIC', 'This offer applies automatic')}</OText>
|
|
198
|
+
)}
|
|
199
|
+
{!!offerSelected?.minimum && (
|
|
200
|
+
<OText>{t('MINIMUM_PURCHASE_FOR_OFFER', 'Minimum purchase for use this offer')}: {parsePrice(offerSelected?.minimum)}</OText>
|
|
201
|
+
)}
|
|
202
|
+
{!!offerSelected?.max_discount && (
|
|
203
|
+
<OText>{t('MAX_DISCOUNT_ALLOWED', 'Max discount allowed')}: {parsePrice(offerSelected?.max_discount)}</OText>
|
|
204
|
+
)}
|
|
205
|
+
{!!offerSelected?.description && (
|
|
206
|
+
<OText>{offerSelected?.description}</OText>
|
|
207
|
+
)}
|
|
208
|
+
</OfferData>
|
|
209
|
+
<OText style={{ marginTop: 10, marginBottom: 10 }}>
|
|
210
|
+
{t('AVAILABLE_BUSINESSES_FOR_OFFER', 'Available businesses for this offer')}:
|
|
211
|
+
</OText>
|
|
212
|
+
<ScrollView
|
|
213
|
+
showsVerticalScrollIndicator={false}
|
|
214
|
+
style={{ height: '75%' }}
|
|
215
|
+
>
|
|
216
|
+
{offerSelected?.businesses?.map((business: any) => {
|
|
217
|
+
return (
|
|
218
|
+
<SingleBusinessOffer key={business.id}>
|
|
219
|
+
{business?.logo ? (
|
|
220
|
+
<FastImage
|
|
221
|
+
style={styles.productStyle}
|
|
222
|
+
source={{
|
|
223
|
+
uri: optimizeImage(business?.logo, 'h_250,c_limit'),
|
|
224
|
+
priority: FastImage.priority.normal,
|
|
225
|
+
}}
|
|
226
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
227
|
+
/>
|
|
228
|
+
) : (
|
|
229
|
+
<OIcon
|
|
230
|
+
src={theme?.images?.dummies?.product}
|
|
231
|
+
style={styles.productStyle}
|
|
232
|
+
/>
|
|
233
|
+
)}
|
|
234
|
+
<BusinessInfo>
|
|
235
|
+
<OText style={{ maxWidth: '60%' }}>{business.name}</OText>
|
|
236
|
+
<OButton
|
|
237
|
+
onClick={() => handleBusinessClick(business)}
|
|
238
|
+
text={t('GO_TO_BUSINESSS', 'Go to business')}
|
|
239
|
+
style={styles.modalButtonStyle}
|
|
240
|
+
textStyle={{ fontSize: 10, color: '#fff' }}
|
|
241
|
+
/>
|
|
242
|
+
</BusinessInfo>
|
|
243
|
+
</SingleBusinessOffer>
|
|
244
|
+
)
|
|
245
|
+
})}
|
|
246
|
+
</ScrollView>
|
|
247
|
+
</View>
|
|
248
|
+
</OModal>
|
|
249
|
+
</PromotionsContainer>
|
|
250
|
+
</Container>
|
|
251
|
+
)
|
|
239
252
|
}
|
|
240
253
|
|
|
241
254
|
export const Promotions = (props: PromotionParams) => {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
255
|
+
const PromotionsProps = {
|
|
256
|
+
...props,
|
|
257
|
+
UIComponent: PromotionsUI
|
|
258
|
+
}
|
|
246
259
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
260
|
+
return (
|
|
261
|
+
<PromotionsController {...PromotionsProps} />
|
|
262
|
+
)
|
|
250
263
|
}
|
|
@@ -6,18 +6,22 @@ export const PromotionsContainer = styled.View`
|
|
|
6
6
|
padding-right: 40px;
|
|
7
7
|
`
|
|
8
8
|
|
|
9
|
+
export const WrapperSingleOffer = styled.View`
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
width: 100%;
|
|
12
|
+
`
|
|
13
|
+
|
|
9
14
|
export const SingleOfferContainer = styled.View`
|
|
10
15
|
flex-direction: row;
|
|
11
16
|
width: 100%;
|
|
12
17
|
justify-content: space-between;
|
|
13
18
|
align-items: center;
|
|
14
19
|
margin-bottom: 20px;
|
|
15
|
-
|
|
16
20
|
`
|
|
17
21
|
|
|
18
22
|
export const OfferInformation = styled.View`
|
|
19
23
|
justify-content: space-between;
|
|
20
|
-
max-width:
|
|
24
|
+
max-width: 70%;
|
|
21
25
|
`
|
|
22
26
|
|
|
23
27
|
export const SearchBarContainer = styled.View`
|
|
@@ -29,6 +33,7 @@ export const SearchBarContainer = styled.View`
|
|
|
29
33
|
|
|
30
34
|
export const SingleBusinessOffer = styled.View`
|
|
31
35
|
flex-direction: row;
|
|
36
|
+
margin-bottom: 10px;
|
|
32
37
|
`
|
|
33
38
|
|
|
34
39
|
export const AvailableBusinesses = styled.View`
|
|
@@ -44,7 +44,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
|
|
|
44
44
|
photoWrapper: {
|
|
45
45
|
shadowColor: theme.colors.black,
|
|
46
46
|
shadowRadius: 3,
|
|
47
|
-
shadowOffset: {width: 1, height: 4},
|
|
47
|
+
shadowOffset: { width: 1, height: 4 },
|
|
48
48
|
elevation: 3,
|
|
49
49
|
borderRadius: 8,
|
|
50
50
|
shadowOpacity: 0.1,
|
|
@@ -86,11 +86,11 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
|
|
|
86
86
|
const [alertState, setAlertState] = useState<{ open: boolean, content: Array<any>, success?: boolean }>({ open: false, content: [], success: false })
|
|
87
87
|
|
|
88
88
|
const qualificationList = [
|
|
89
|
-
{ key: 1, text: t('TERRIBLE', 'Terrible'), percent: 0,
|
|
89
|
+
{ key: 1, text: t('TERRIBLE', 'Terrible'), percent: 0, parentStyle: { left: '0%' }, isInnerStyle: false, pointerColor: false },
|
|
90
90
|
{ key: 2, text: t('BAD', 'Bad'), percent: 0.25, parentStyle: { left: '25%' }, isInnerStyle: true, pointerColor: true },
|
|
91
91
|
{ key: 3, text: t('OKAY', 'Okay'), percent: 0.5, parentStyle: { left: '50%' }, isInnerStyle: true, pointerColor: true },
|
|
92
92
|
{ key: 4, text: t('GOOD', 'Good'), percent: 0.75, parentStyle: { left: '75%' }, isInnerStyle: true, pointerColor: true },
|
|
93
|
-
{ key: 5, text: t('GREAT', 'Great'), percent: 1, parentStyle: { right: '0%' }, isInnerStyle: false,
|
|
93
|
+
{ key: 5, text: t('GREAT', 'Great'), percent: 1, parentStyle: { right: '0%' }, isInnerStyle: false, pointerColor: false }
|
|
94
94
|
]
|
|
95
95
|
|
|
96
96
|
const commentsList = reviewCommentList('driver')
|
|
@@ -186,7 +186,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
|
|
|
186
186
|
<NavBar
|
|
187
187
|
title={t('REVIEW_DRIVER', 'Review driver')}
|
|
188
188
|
titleAlign={'center'}
|
|
189
|
-
onActionLeft={() =>
|
|
189
|
+
onActionLeft={() => onNavigationRedirect('BottomTab')}
|
|
190
190
|
showCall={false}
|
|
191
191
|
btnStyle={{ paddingLeft: 0 }}
|
|
192
192
|
style={{ flexDirection: 'column', alignItems: 'flex-start' }}
|
|
@@ -204,7 +204,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
|
|
|
204
204
|
<OIcon
|
|
205
205
|
url={order?.driver?.photo}
|
|
206
206
|
src={!order?.driver?.photo && theme.images.general.user}
|
|
207
|
-
cover={order?.driver?.photo ? true: false}
|
|
207
|
+
cover={order?.driver?.photo ? true : false}
|
|
208
208
|
width={80}
|
|
209
209
|
height={80}
|
|
210
210
|
/>
|
|
@@ -212,7 +212,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
|
|
|
212
212
|
<OText weight={500} style={{ marginVertical: 10 }} color={theme.colors.textNormal}>{order?.driver?.name} {order?.driver?.lastname}</OText>
|
|
213
213
|
</DriverPhotoContainer>
|
|
214
214
|
|
|
215
|
-
<View style={{flex: 1, justifyContent: 'flex-end'}}>
|
|
215
|
+
<View style={{ flex: 1, justifyContent: 'flex-end' }}>
|
|
216
216
|
<FormReviews>
|
|
217
217
|
<OText mBottom={13} color={theme.colors.textNormal}>{t('HOW_WAS_YOUR_DRIVER', 'How was your driver?')}</OText>
|
|
218
218
|
<RatingBarContainer>
|
|
@@ -264,7 +264,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
|
|
|
264
264
|
style={{ height: 35, paddingLeft: 5, paddingRight: 5, marginHorizontal: 3, marginVertical: 10 }}
|
|
265
265
|
imgRightSrc={isSelectedComment(commentItem.key) ? theme.images.general.close : null}
|
|
266
266
|
imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
|
|
267
|
-
onClick={() => handleChangeComment(commentItem)
|
|
267
|
+
onClick={() => handleChangeComment(commentItem)}
|
|
268
268
|
/>
|
|
269
269
|
))}
|
|
270
270
|
</CommentsButtonGroup>
|
|
@@ -92,6 +92,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
|
92
92
|
const [alertState, setAlertState] = useState<{ open: boolean, content: Array<any>, success?: boolean }>({ open: false, content: [], success: false })
|
|
93
93
|
const [comments, setComments] = useState<Array<any>>([])
|
|
94
94
|
const [extraComment, setExtraComment] = useState('')
|
|
95
|
+
const [enableProduct, setEnableProduct] = useState(true)
|
|
95
96
|
|
|
96
97
|
const onSubmit = () => {
|
|
97
98
|
if (Object.values(stars).some((value: any) => value === 0)) {
|
|
@@ -105,6 +106,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
|
105
106
|
handleReviewState && handleReviewState(order?.id)
|
|
106
107
|
setIsReviewed && setIsReviewed(true)
|
|
107
108
|
setAlertState({ ...alertState, success: true })
|
|
109
|
+
!enableProduct && navigation?.canGoBack() && navigation.goBack()
|
|
108
110
|
}
|
|
109
111
|
|
|
110
112
|
const qualificationList = [
|
|
@@ -141,7 +143,16 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
|
141
143
|
if (!order?.review) {
|
|
142
144
|
onSubmit()
|
|
143
145
|
} else {
|
|
144
|
-
|
|
146
|
+
skipOrderReview()
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const skipOrderReview = () => {
|
|
151
|
+
if (enableProduct) onNavigationRedirect('ReviewProducts', { order: order })
|
|
152
|
+
else if (order?.driver && !order?.user_review) {
|
|
153
|
+
onNavigationRedirect('ReviewDriver', { order: order })
|
|
154
|
+
} else {
|
|
155
|
+
navigation?.canGoBack() && navigation.goBack()
|
|
145
156
|
}
|
|
146
157
|
}
|
|
147
158
|
|
|
@@ -187,6 +198,10 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
|
187
198
|
setStars({ ...stars, comments: _comment })
|
|
188
199
|
}, [comments, extraComment])
|
|
189
200
|
|
|
201
|
+
useEffect(() => {
|
|
202
|
+
setEnableProduct(!order?.products.every(product => product?.deleted))
|
|
203
|
+
}, [order])
|
|
204
|
+
|
|
190
205
|
return (
|
|
191
206
|
<>
|
|
192
207
|
<ReviewOrderContainer>
|
|
@@ -296,7 +311,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
|
296
311
|
<FloatingBottomContainer>
|
|
297
312
|
<ActionContainer>
|
|
298
313
|
<SkipButton
|
|
299
|
-
onPress={() =>
|
|
314
|
+
onPress={() => skipOrderReview()}
|
|
300
315
|
>
|
|
301
316
|
<OText weight={700} size={18} color={theme.colors.textNormal}>{t('FRONT_VISUALS_SKIP', 'Skip')}</OText>
|
|
302
317
|
</SkipButton>
|
|
@@ -318,7 +333,7 @@ export const ReviewOrder = (props: ReviewOrderParams) => {
|
|
|
318
333
|
const reviewOrderProps = {
|
|
319
334
|
...props,
|
|
320
335
|
UIComponent: ReviewOrderUI,
|
|
321
|
-
defaultStar: 5
|
|
336
|
+
defaultStar: props?.defaultStar || 5
|
|
322
337
|
}
|
|
323
338
|
return <ReviewOrderController {...reviewOrderProps} />
|
|
324
339
|
}
|
|
@@ -67,14 +67,14 @@ const ReviewProductsUI = (props: ReviewProductParams) => {
|
|
|
67
67
|
<NavBar
|
|
68
68
|
title={t('REVIEW_PRODUCT', 'Review product')}
|
|
69
69
|
titleAlign={'center'}
|
|
70
|
-
onActionLeft={() => onNavigationRedirect('
|
|
70
|
+
onActionLeft={() => onNavigationRedirect('BottomTab')}
|
|
71
71
|
showCall={false}
|
|
72
72
|
btnStyle={{ paddingLeft: 0 }}
|
|
73
73
|
style={{ flexDirection: 'column', alignItems: 'flex-start' }}
|
|
74
74
|
titleWrapStyle={{ paddingHorizontal: 0 }}
|
|
75
75
|
titleStyle={{ marginRight: 0, marginLeft: 0 }}
|
|
76
76
|
/>
|
|
77
|
-
{order?.products?.map((product: any) => (
|
|
77
|
+
{order?.products?.map((product: any) => !product?.deleted && (
|
|
78
78
|
<SingleProductReview
|
|
79
79
|
key={product.id}
|
|
80
80
|
product={product}
|