ordering-ui-react-native 0.15.69 → 0.15.71-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 -3
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/ActiveOrders/index.tsx +61 -63
- package/src/components/ActiveOrders/styles.tsx +1 -1
- package/src/components/AddressForm/index.tsx +18 -2
- package/src/components/BusinessBasicInformation/index.tsx +11 -19
- package/src/components/BusinessController/index.tsx +16 -8
- package/src/components/BusinessInformation/index.tsx +14 -0
- package/src/components/BusinessTypeFilter/index.tsx +1 -2
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +23 -2
- package/src/components/DriverTips/index.tsx +11 -6
- package/src/components/LanguageSelector/index.tsx +6 -2
- package/src/components/LoginForm/index.tsx +120 -30
- package/src/components/LoginForm/styles.tsx +6 -0
- package/src/components/NotificationSetting/index.tsx +85 -0
- package/src/components/OrderDetails/index.tsx +7 -21
- package/src/components/PaymentOptions/index.tsx +67 -50
- package/src/components/PaymentOptionsWebView/index.tsx +120 -121
- package/src/components/ReviewDriver/index.tsx +1 -1
- package/src/components/ReviewOrder/index.tsx +2 -1
- package/src/components/ReviewProducts/index.tsx +11 -0
- package/src/components/SignupForm/index.tsx +145 -61
- package/src/components/SingleProductCard/index.tsx +16 -4
- package/src/components/SingleProductReview/index.tsx +1 -1
- package/src/components/StripeMethodForm/index.tsx +22 -24
- package/src/components/UpsellingProducts/index.tsx +1 -1
- package/src/components/UserProfileForm/index.tsx +63 -6
- package/src/components/UserProfileForm/styles.tsx +8 -0
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OBottomPopup.tsx +6 -2
- package/src/components/shared/OModal.tsx +1 -1
- package/src/hooks/useCountdownTimer.tsx +26 -0
- package/src/index.tsx +2 -0
- package/src/navigators/CheckoutNavigator.tsx +6 -0
- package/src/navigators/HomeNavigator.tsx +12 -0
- package/src/pages/BusinessesListing.tsx +7 -6
- package/src/pages/MultiCheckout.tsx +31 -0
- package/src/pages/MultiOrdersDetails.tsx +27 -0
- package/src/pages/OrderDetails.tsx +1 -1
- package/src/pages/ReviewDriver.tsx +2 -2
- package/src/pages/ReviewOrder.tsx +2 -2
- package/src/pages/Sessions.tsx +22 -0
- package/src/theme.json +0 -1
- package/src/types/index.tsx +18 -11
- package/src/utils/index.tsx +68 -2
- package/themes/business/index.tsx +4 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +103 -15
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -0
- package/themes/business/src/components/Chat/index.tsx +51 -91
- package/themes/business/src/components/DriverMap/index.tsx +6 -5
- package/themes/business/src/components/DriverSchedule/index.tsx +71 -0
- package/themes/business/src/components/DriverSchedule/styles.tsx +6 -0
- package/themes/business/src/components/LoginForm/index.tsx +89 -2
- package/themes/business/src/components/LoginForm/styles.tsx +6 -0
- package/themes/business/src/components/LogoutButton/index.tsx +1 -1
- package/themes/business/src/components/NewOrderNotification/index.tsx +26 -13
- package/themes/business/src/components/OrderDetails/Business.tsx +2 -2
- package/themes/business/src/components/OrderDetails/Delivery.tsx +28 -11
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +14 -7
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +6 -0
- package/themes/business/src/components/OrdersListManager/index.tsx +11 -4
- package/themes/business/src/components/OrdersOption/index.tsx +16 -4
- package/themes/business/src/components/PreviousOrders/index.tsx +7 -7
- package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
- package/themes/business/src/components/ScheduleBlocked/index.tsx +53 -0
- package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
- package/themes/business/src/components/UserProfileForm/index.tsx +28 -4
- package/themes/business/src/components/shared/OModal.tsx +41 -38
- package/themes/business/src/types/index.tsx +14 -7
- 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/BusinessMenu/index.tsx +39 -28
- package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -3
- package/themes/kiosk/src/components/Cart/index.tsx +11 -12
- package/themes/kiosk/src/components/CartBottomSheet/index.tsx +9 -2
- package/themes/kiosk/src/components/CartContent/index.tsx +0 -11
- package/themes/kiosk/src/components/CartItem/index.tsx +4 -3
- package/themes/kiosk/src/components/CategoriesMenu/index.tsx +107 -62
- package/themes/kiosk/src/components/Checkout/index.tsx +40 -22
- package/themes/kiosk/src/components/CustomerName/index.tsx +0 -6
- package/themes/kiosk/src/components/DrawerView/index.tsx +1 -0
- package/themes/kiosk/src/components/DrawerView/styles.tsx +2 -2
- package/themes/kiosk/src/components/NavBar/index.tsx +29 -20
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderDetails/index.tsx +32 -27
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +9 -11
- package/themes/kiosk/src/components/PaymentOptions/index.tsx +56 -54
- package/themes/kiosk/src/components/ProductForm/index.tsx +7 -8
- package/themes/kiosk/src/components/ProductItemAccordion/index.tsx +2 -2
- package/themes/kiosk/src/components/ProductOption/index.tsx +1 -1
- package/themes/kiosk/src/components/ProductOptionSubOption/index.tsx +3 -1
- package/themes/kiosk/src/components/UpsellingProducts/index.tsx +16 -5
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/types/index.d.ts +1 -0
- package/themes/original/index.tsx +24 -0
- package/themes/original/src/components/ActiveOrders/index.tsx +15 -132
- package/themes/original/src/components/ActiveOrders/styles.tsx +0 -54
- package/themes/original/src/components/AddressForm/index.tsx +7 -6
- package/themes/original/src/components/AddressList/index.tsx +30 -18
- package/themes/original/src/components/AppleLogin/index.tsx +6 -8
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +287 -150
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +6 -2
- package/themes/original/src/components/BusinessController/index.tsx +201 -96
- package/themes/original/src/components/BusinessController/styles.tsx +5 -0
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +8 -5
- package/themes/original/src/components/BusinessItemAccordion/styles.tsx +3 -1
- package/themes/original/src/components/BusinessListingSearch/index.tsx +231 -63
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +22 -2
- package/themes/original/src/components/BusinessPreorder/index.tsx +1 -1
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +2 -2
- package/themes/original/src/components/BusinessProductsList/CategoryDescription/index.tsx +44 -0
- package/themes/original/src/components/BusinessProductsList/index.tsx +70 -52
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +339 -153
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +33 -0
- package/themes/original/src/components/BusinessReviews/index.tsx +6 -1
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +106 -39
- package/themes/original/src/components/BusinessTypeFilter/styles.tsx +2 -0
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +560 -0
- package/themes/original/src/components/BusinessesListing/{styles.tsx → Layout/Appointment/styles.tsx} +24 -2
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +671 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +137 -0
- package/themes/original/src/components/BusinessesListing/index.tsx +103 -458
- package/themes/original/src/components/Cart/index.tsx +93 -43
- package/themes/original/src/components/Cart/styles.tsx +4 -0
- package/themes/original/src/components/Checkout/index.tsx +90 -39
- package/themes/original/src/components/DriverTips/index.tsx +17 -12
- package/themes/original/src/components/Favorite/index.tsx +92 -0
- package/themes/original/src/components/Favorite/styles.tsx +22 -0
- package/themes/original/src/components/FavoriteList/index.tsx +298 -0
- package/themes/original/src/components/FavoriteList/styles.tsx +5 -0
- package/themes/original/src/components/ForgotPasswordForm/index.tsx +84 -4
- package/themes/original/src/components/GPSButton/index.tsx +15 -8
- package/themes/original/src/components/GoogleMap/index.tsx +11 -11
- package/themes/original/src/components/Help/index.tsx +21 -4
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +18 -1
- package/themes/original/src/components/LastOrders/index.tsx +12 -1
- package/themes/original/src/components/LoginForm/Otp/index.tsx +91 -0
- package/themes/original/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/original/src/components/LoginForm/index.tsx +332 -164
- package/themes/original/src/components/LoginForm/styles.tsx +1 -3
- package/themes/original/src/components/MessageListing/index.tsx +10 -1
- package/themes/original/src/components/Messages/index.tsx +1 -1
- package/themes/original/src/components/MomentSelector/index.tsx +197 -0
- package/themes/original/src/components/MomentSelector/styles.tsx +6 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +243 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/styles.tsx +46 -0
- package/themes/original/src/components/MultiCheckout/index.tsx +298 -0
- package/themes/original/src/components/MultiCheckout/styles.tsx +59 -0
- package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +372 -0
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +258 -0
- package/themes/original/src/components/MultiOrdersDetails/styles.tsx +50 -0
- package/themes/original/src/components/MyOrders/index.tsx +120 -32
- package/themes/original/src/components/MyOrders/styles.tsx +8 -1
- package/themes/original/src/components/NavBar/index.tsx +4 -4
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +167 -0
- package/themes/original/src/components/OrderDetails/index.tsx +148 -63
- package/themes/original/src/components/OrderDetails/styles.tsx +1 -2
- package/themes/original/src/components/OrderItAgain/index.tsx +72 -0
- package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
- package/themes/original/src/components/OrderSummary/index.tsx +5 -5
- package/themes/original/src/components/OrderTypeSelector/index.tsx +79 -35
- package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +153 -0
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +6 -0
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +53 -0
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +6 -0
- package/themes/original/src/components/OrdersOption/index.tsx +137 -38
- package/themes/original/src/components/OrdersOption/styles.tsx +4 -1
- package/themes/original/src/components/PaymentOptionCash/index.tsx +2 -2
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +17 -23
- package/themes/original/src/components/PaymentOptionWallet/styles.tsx +1 -1
- package/themes/original/src/components/PaymentOptions/index.tsx +58 -37
- package/themes/original/src/components/PhoneInputNumber/index.tsx +5 -11
- package/themes/original/src/components/PreviousOrders/index.tsx +18 -147
- package/themes/original/src/components/ProductForm/index.tsx +718 -679
- package/themes/original/src/components/ProductForm/styles.tsx +9 -7
- package/themes/original/src/components/ProductItemAccordion/index.tsx +2 -2
- package/themes/original/src/components/ProductOption/index.tsx +1 -1
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -12
- package/themes/original/src/components/ProfessionalFilter/index.tsx +128 -0
- package/themes/original/src/components/ProfessionalFilter/styles.tsx +0 -0
- package/themes/original/src/components/ProfessionalProfile/index.tsx +298 -0
- package/themes/original/src/components/ProfessionalProfile/styles.tsx +46 -0
- package/themes/original/src/components/Promotions/index.tsx +151 -133
- package/themes/original/src/components/Promotions/styles.tsx +2 -1
- package/themes/original/src/components/ReviewDriver/index.tsx +6 -6
- package/themes/original/src/components/ReviewOrder/index.tsx +1 -1
- 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 +13 -5
- package/themes/original/src/components/ServiceForm/index.tsx +579 -0
- package/themes/original/src/components/ServiceForm/styles.tsx +50 -0
- package/themes/original/src/components/Sessions/index.tsx +160 -0
- package/themes/original/src/components/Sessions/styles.tsx +15 -0
- package/themes/original/src/components/SignupForm/index.tsx +237 -126
- package/themes/original/src/components/SingleOrderCard/index.tsx +316 -0
- package/themes/original/src/components/SingleOrderCard/styles.tsx +54 -0
- package/themes/original/src/components/SingleProductCard/index.tsx +214 -90
- package/themes/original/src/components/SingleProductCard/styles.tsx +2 -2
- package/themes/original/src/components/StripeElementsForm/index.tsx +16 -8
- package/themes/original/src/components/StripeElementsForm/naked.tsx +2 -2
- package/themes/original/src/components/UpsellingProducts/index.tsx +86 -74
- package/themes/original/src/components/UserDetails/index.tsx +32 -18
- package/themes/original/src/components/UserFormDetails/index.tsx +102 -66
- package/themes/original/src/components/UserProfile/index.tsx +10 -1
- package/themes/original/src/components/UserProfileForm/index.tsx +32 -25
- package/themes/original/src/components/UserVerification/index.tsx +178 -192
- package/themes/original/src/components/Wallets/index.tsx +25 -12
- package/themes/original/src/components/shared/OBottomPopup.tsx +44 -13
- package/themes/original/src/components/shared/OButton.tsx +2 -0
- package/themes/original/src/components/shared/OInput.tsx +3 -2
- package/themes/original/src/components/shared/OModal.tsx +4 -2
- package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
- package/themes/original/src/types/index.tsx +203 -35
- package/themes/original/src/utils/index.tsx +94 -1
- package/themes/single-business/src/components/OrderTypeSelector/index.tsx +1 -1
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
|
-
import { PromotionsController, useLanguage, useUtils
|
|
2
|
+
import { PromotionsController, useLanguage, useUtils } from 'ordering-components/native'
|
|
3
3
|
import {
|
|
4
4
|
PromotionsContainer,
|
|
5
5
|
SingleOfferContainer,
|
|
@@ -17,15 +17,18 @@ import { useTheme } from 'styled-components/native';
|
|
|
17
17
|
import { OButton, OIcon, OModal, OText } from '../shared'
|
|
18
18
|
import { Placeholder, PlaceholderLine } from 'rn-placeholder'
|
|
19
19
|
import { NotFoundSource } from '../NotFoundSource'
|
|
20
|
-
import { View, StyleSheet, ScrollView } from 'react-native'
|
|
20
|
+
import { View, StyleSheet, ScrollView, Platform, RefreshControl } from 'react-native'
|
|
21
21
|
import FastImage from 'react-native-fast-image'
|
|
22
22
|
import { PromotionParams } from '../../types'
|
|
23
|
-
|
|
23
|
+
import { Container } from '../../layouts/Container'
|
|
24
|
+
|
|
25
|
+
const PromotionsUI = (props: PromotionParams) => {
|
|
24
26
|
const {
|
|
25
27
|
navigation,
|
|
26
28
|
offersState,
|
|
27
29
|
handleSearchValue,
|
|
28
30
|
searchValue,
|
|
31
|
+
loadOffers,
|
|
29
32
|
offerSelected,
|
|
30
33
|
setOfferSelected
|
|
31
34
|
} = props
|
|
@@ -65,20 +68,26 @@ const PromotionsUI = (props : PromotionParams) => {
|
|
|
65
68
|
|
|
66
69
|
const [, t] = useLanguage()
|
|
67
70
|
const [{ parseDate, parsePrice, optimizeImage }] = useUtils()
|
|
68
|
-
const [events] = useEvent()
|
|
69
71
|
const [openModal, setOpenModal] = useState(false)
|
|
72
|
+
const [refreshing] = useState(false);
|
|
70
73
|
|
|
71
|
-
const handleClickOffer = (offer
|
|
74
|
+
const handleClickOffer = (offer: any) => {
|
|
72
75
|
setOpenModal(true)
|
|
73
76
|
setOfferSelected(offer)
|
|
74
77
|
}
|
|
75
78
|
|
|
76
|
-
const handleBusinessClick = (
|
|
77
|
-
|
|
79
|
+
const handleBusinessClick = (store: any) => {
|
|
80
|
+
setOpenModal(false)
|
|
81
|
+
navigation.navigate('Business', { store: store.slug })
|
|
78
82
|
}
|
|
79
83
|
|
|
80
|
-
const
|
|
84
|
+
const handleOnRefresh = () => {
|
|
85
|
+
if (!offersState.loading) {
|
|
86
|
+
loadOffers();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
81
89
|
|
|
90
|
+
const filteredOffers = offersState?.offers?.filter((offer: any) => offer.name.toLowerCase().includes(searchValue.toLowerCase()))
|
|
82
91
|
const targetString = offerSelected?.target === 1
|
|
83
92
|
? t('SUBTOTAL', 'Subtotal')
|
|
84
93
|
: offerSelected?.target === 2
|
|
@@ -86,141 +95,150 @@ const PromotionsUI = (props : PromotionParams) => {
|
|
|
86
95
|
: t('SERVICE_FEE', 'Service fee')
|
|
87
96
|
|
|
88
97
|
return (
|
|
89
|
-
<
|
|
98
|
+
<Container
|
|
99
|
+
noPadding
|
|
100
|
+
refreshControl={
|
|
101
|
+
<RefreshControl
|
|
102
|
+
refreshing={refreshing}
|
|
103
|
+
onRefresh={() => handleOnRefresh()}
|
|
104
|
+
/>
|
|
105
|
+
}
|
|
106
|
+
>
|
|
90
107
|
<NavBar
|
|
91
|
-
onActionLeft={() => navigation.goBack()}
|
|
92
|
-
btnStyle={{ paddingLeft: 0 }}
|
|
93
|
-
paddingTop={20}
|
|
94
|
-
style={{ paddingBottom: 0, flexDirection: 'column', alignItems: 'flex-start' }}
|
|
95
108
|
title={t('PROMOTIONS', 'Promotions')}
|
|
96
109
|
titleAlign={'center'}
|
|
97
|
-
|
|
98
|
-
|
|
110
|
+
onActionLeft={() => navigation.goBack()}
|
|
111
|
+
showCall={false}
|
|
112
|
+
style={{ paddingVertical: Platform.OS === 'ios' ? 0 : 20, marginLeft: 20 }}
|
|
99
113
|
/>
|
|
100
|
-
<
|
|
101
|
-
<
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
114
|
+
<PromotionsContainer>
|
|
115
|
+
<SearchBarContainer>
|
|
116
|
+
<SearchBar
|
|
117
|
+
placeholder={t('SEARCH_OFFERS', 'Search offers')}
|
|
118
|
+
onSearch={handleSearchValue}
|
|
119
|
+
/>
|
|
120
|
+
</SearchBarContainer>
|
|
106
121
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
122
|
+
{offersState?.loading && (
|
|
123
|
+
<>
|
|
124
|
+
{[...Array(5).keys()].map((key, i) => (
|
|
125
|
+
<Placeholder key={i} style={{ flexDirection: 'row', marginBottom: 20 }}>
|
|
126
|
+
<PlaceholderLine height={10} width={45} />
|
|
127
|
+
<PlaceholderLine height={10} width={60} />
|
|
128
|
+
<PlaceholderLine height={10} width={75} />
|
|
129
|
+
</Placeholder>
|
|
130
|
+
))}
|
|
131
|
+
</>
|
|
132
|
+
)}
|
|
133
|
+
{((!offersState?.loading && filteredOffers?.length === 0) || offersState?.error) && (
|
|
134
|
+
<NotFoundSource
|
|
135
|
+
content={offersState?.error || t('NOT_FOUND_OFFERS', 'Not found offers')}
|
|
136
|
+
/>
|
|
137
|
+
)}
|
|
138
|
+
<ScrollView>
|
|
139
|
+
{!offersState?.loading && offersState.offers?.length > 0 && filteredOffers?.map((offer: any) => (
|
|
140
|
+
<SingleOfferContainer key={offer.id}>
|
|
141
|
+
<OfferInformation>
|
|
142
|
+
<OText style={styles.offerTitle} numberOfLines={2}>{offer?.name}</OText>
|
|
143
|
+
{!!offer?.description && (
|
|
144
|
+
<OText style={styles.offerDescription} numberOfLines={2}>{offer?.description}</OText>
|
|
145
|
+
)}
|
|
146
|
+
<OText style={styles.offerExtraInfo}>
|
|
147
|
+
{t('EXPIRES', 'Expires')} {parseDate(offer?.end, { outputFormat: 'MMM DD, YYYY' })}
|
|
148
|
+
</OText>
|
|
149
|
+
<AvailableBusinesses>
|
|
150
|
+
<OText style={styles.offerExtraInfo} numberOfLines={1}>
|
|
151
|
+
{t('APPLY_FOR', 'Apply for')}:
|
|
152
|
+
{offer.businesses.map((business: any, i: number) => (
|
|
153
|
+
<React.Fragment key={i}>{' '}{business?.name}{i + 1 < offer.businesses?.length ? ',' : ''}</React.Fragment>
|
|
154
|
+
))}
|
|
155
|
+
</OText>
|
|
156
|
+
</AvailableBusinesses>
|
|
157
|
+
</OfferInformation>
|
|
158
|
+
<OButton
|
|
159
|
+
onClick={() => handleClickOffer(offer)}
|
|
160
|
+
text={t('VIEW', 'View')}
|
|
161
|
+
style={styles.buttonStyle}
|
|
162
|
+
textStyle={{ fontSize: 10, color: '#fff', flexWrap: 'nowrap' }}
|
|
163
|
+
/>
|
|
164
|
+
</SingleOfferContainer>
|
|
115
165
|
))}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
/>
|
|
122
|
-
)}
|
|
123
|
-
<ScrollView>
|
|
124
|
-
{!offersState?.loading && offersState.offers?.length > 0 && filteredOffers?.map((offer : any) => (
|
|
125
|
-
<SingleOfferContainer key={offer.id}>
|
|
126
|
-
<OfferInformation>
|
|
127
|
-
<OText style={styles.offerTitle}>{offer?.name}</OText>
|
|
128
|
-
{offer?.description && (
|
|
129
|
-
<OText style={styles.offerDescription}>{offer?.description}</OText>
|
|
130
|
-
)}
|
|
131
|
-
<OText style={styles.offerExtraInfo}>
|
|
132
|
-
{t('EXPIRES', 'Expires')} {parseDate(offer?.end, { outputFormat: 'MMM DD, YYYY' })}
|
|
133
|
-
</OText>
|
|
134
|
-
<AvailableBusinesses>
|
|
135
|
-
<OText style={styles.offerExtraInfo}>{t('APPLY_FOR', 'Apply for')}:</OText>
|
|
136
|
-
{offer.businesses.map((business: any, i: number) => (
|
|
137
|
-
<OText style={styles.offerExtraInfo} key={business?.id}>{' '}{business?.name}{i + 1 < offer.businesses?.length ? ',' : ''}</OText>
|
|
138
|
-
))}
|
|
139
|
-
</AvailableBusinesses>
|
|
140
|
-
</OfferInformation>
|
|
141
|
-
<OButton
|
|
142
|
-
onClick={() => handleClickOffer(offer)}
|
|
143
|
-
text={t('VIEW', 'View')}
|
|
144
|
-
style={styles.buttonStyle}
|
|
145
|
-
textStyle={{ fontSize: 10, color: '#fff', flexWrap: 'nowrap' }}
|
|
146
|
-
/>
|
|
147
|
-
</SingleOfferContainer>
|
|
148
|
-
))}
|
|
149
|
-
</ScrollView>
|
|
150
|
-
<OModal
|
|
151
|
-
open={openModal}
|
|
152
|
-
onClose={() => setOpenModal(false)}
|
|
153
|
-
entireModal
|
|
166
|
+
</ScrollView>
|
|
167
|
+
<OModal
|
|
168
|
+
open={openModal}
|
|
169
|
+
onClose={() => setOpenModal(false)}
|
|
170
|
+
entireModal
|
|
154
171
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
172
|
+
title={``}
|
|
173
|
+
>
|
|
174
|
+
<View style={{ padding: 20 }}>
|
|
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>
|
|
220
238
|
)
|
|
221
239
|
}
|
|
222
240
|
|
|
223
|
-
export const Promotions = (props
|
|
241
|
+
export const Promotions = (props: PromotionParams) => {
|
|
224
242
|
const PromotionsProps = {
|
|
225
243
|
...props,
|
|
226
244
|
UIComponent: PromotionsUI
|
|
@@ -2,12 +2,13 @@ import styled, { css } from 'styled-components/native'
|
|
|
2
2
|
|
|
3
3
|
export const PromotionsContainer = styled.View`
|
|
4
4
|
width: 100%;
|
|
5
|
+
padding-left: 40px;
|
|
6
|
+
padding-right: 40px;
|
|
5
7
|
`
|
|
6
8
|
|
|
7
9
|
export const SingleOfferContainer = styled.View`
|
|
8
10
|
flex-direction: row;
|
|
9
11
|
width: 100%;
|
|
10
|
-
height: 80px;
|
|
11
12
|
justify-content: space-between;
|
|
12
13
|
align-items: center;
|
|
13
14
|
margin-bottom: 20px;
|
|
@@ -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')
|
|
@@ -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>
|
|
@@ -318,7 +318,7 @@ export const ReviewOrder = (props: ReviewOrderParams) => {
|
|
|
318
318
|
const reviewOrderProps = {
|
|
319
319
|
...props,
|
|
320
320
|
UIComponent: ReviewOrderUI,
|
|
321
|
-
defaultStar: 5
|
|
321
|
+
defaultStar: props?.defaultStar || 5
|
|
322
322
|
}
|
|
323
323
|
return <ReviewOrderController {...reviewOrderProps} />
|
|
324
324
|
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import FontAwesome from 'react-native-vector-icons/FontAwesome';
|
|
3
|
+
import { useLanguage, useUtils } from 'ordering-components/native'
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
ReviewOrderContainer,
|
|
7
|
+
BusinessLogo,
|
|
8
|
+
FormReviews,
|
|
9
|
+
ActionContainer,
|
|
10
|
+
RatingStarContainer,
|
|
11
|
+
PlacedDate
|
|
12
|
+
} from './styles'
|
|
13
|
+
import { OButton, OIcon, OText } from '../shared'
|
|
14
|
+
import { StyleSheet, View, I18nManager } from 'react-native';
|
|
15
|
+
import { FloatingBottomContainer } from '../../layouts/FloatingBottomContainer'
|
|
16
|
+
|
|
17
|
+
import { useTheme } from 'styled-components/native'
|
|
18
|
+
|
|
19
|
+
export const ReviewTrigger = (props: any) => {
|
|
20
|
+
const {
|
|
21
|
+
order,
|
|
22
|
+
handleOpenOrderReview
|
|
23
|
+
} = props
|
|
24
|
+
|
|
25
|
+
const theme = useTheme()
|
|
26
|
+
|
|
27
|
+
const styles = StyleSheet.create({
|
|
28
|
+
logoWrapper: {
|
|
29
|
+
shadowColor: theme.colors.black,
|
|
30
|
+
shadowRadius: 3,
|
|
31
|
+
shadowOffset: { width: 1, height: 4 },
|
|
32
|
+
elevation: 3,
|
|
33
|
+
borderRadius: 8,
|
|
34
|
+
shadowOpacity: 0.1,
|
|
35
|
+
overflow: 'hidden'
|
|
36
|
+
},
|
|
37
|
+
inputTextArea: {
|
|
38
|
+
borderColor: theme.colors.lightGray,
|
|
39
|
+
borderRadius: 8,
|
|
40
|
+
marginTop: 10,
|
|
41
|
+
marginBottom: 40,
|
|
42
|
+
height: 100,
|
|
43
|
+
alignItems: 'flex-start'
|
|
44
|
+
},
|
|
45
|
+
statusBar: {
|
|
46
|
+
transform: [{ scaleX: I18nManager.isRTL ? -1 : 1 }],
|
|
47
|
+
height: 10,
|
|
48
|
+
borderRadius: 5,
|
|
49
|
+
marginTop: 5
|
|
50
|
+
},
|
|
51
|
+
ratingItemContainer: {
|
|
52
|
+
position: 'absolute',
|
|
53
|
+
top: -20
|
|
54
|
+
},
|
|
55
|
+
ratingItem: {
|
|
56
|
+
left: '-50%',
|
|
57
|
+
flexDirection: 'column',
|
|
58
|
+
alignItems: 'center'
|
|
59
|
+
},
|
|
60
|
+
ratingLineStyle: {
|
|
61
|
+
height: 10,
|
|
62
|
+
width: 1,
|
|
63
|
+
marginBottom: 10,
|
|
64
|
+
backgroundColor: theme.colors.dusk
|
|
65
|
+
},
|
|
66
|
+
reviewedStyle: {
|
|
67
|
+
flexDirection: 'row',
|
|
68
|
+
justifyContent: 'center',
|
|
69
|
+
marginVertical: 20
|
|
70
|
+
},
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
const [, t] = useLanguage()
|
|
74
|
+
const [{ parseDate }] = useUtils()
|
|
75
|
+
const placedOnDate = parseDate(order?.delivery_datetime, { utc: true, outputFormat: 'dddd MMMM DD, YYYY' })
|
|
76
|
+
const [star, setStar] = useState(5)
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<>
|
|
80
|
+
<ReviewOrderContainer>
|
|
81
|
+
<BusinessLogo>
|
|
82
|
+
<View style={styles.logoWrapper}>
|
|
83
|
+
<OIcon
|
|
84
|
+
url={order?.logo}
|
|
85
|
+
width={80}
|
|
86
|
+
height={80}
|
|
87
|
+
/>
|
|
88
|
+
</View>
|
|
89
|
+
</BusinessLogo>
|
|
90
|
+
{!!order?.business_name && <OText style={{ textAlign: 'center', marginTop: 15 }} color={theme.colors.textNormal}>{order?.business_name}</OText>}
|
|
91
|
+
<View style={{ flex: 1, justifyContent: 'flex-end' }}>
|
|
92
|
+
<FormReviews>
|
|
93
|
+
<RatingStarContainer>
|
|
94
|
+
{[...Array(5).keys()].map((index: number) => (<FontAwesome name={(index <= (star - 1)) ? 'star' : 'star-o'} size={28} key={`star-symbol-${index}`} onPress={() => setStar(index + 1)} color={theme?.colors?.primary} />)
|
|
95
|
+
)}
|
|
96
|
+
</RatingStarContainer>
|
|
97
|
+
<PlacedDate>
|
|
98
|
+
<OText color={theme.colors.textNormal}>{t('DONOT_FORGET_RATE_YOUR_ORDER', 'Do not forget to rate your order placed on ')}</OText>
|
|
99
|
+
<OText color={theme.colors.textNormal} style={{ fontWeight: "bold" }}>{placedOnDate}</OText>
|
|
100
|
+
</PlacedDate>
|
|
101
|
+
</FormReviews>
|
|
102
|
+
</View>
|
|
103
|
+
</ReviewOrderContainer>
|
|
104
|
+
<FloatingBottomContainer borderTopWidth={0} borderRadius={10}>
|
|
105
|
+
<ActionContainer>
|
|
106
|
+
<OButton
|
|
107
|
+
textStyle={{ color: theme.colors.white, paddingRight: 10 }}
|
|
108
|
+
text={t('GOTO_REVIEW', 'Go to review')}
|
|
109
|
+
style={{ borderRadius: 8 }}
|
|
110
|
+
imgRightSrc={theme.images.general.arrow_right}
|
|
111
|
+
imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
|
|
112
|
+
onClick={() => handleOpenOrderReview(star)}
|
|
113
|
+
/>
|
|
114
|
+
</ActionContainer>
|
|
115
|
+
</FloatingBottomContainer>
|
|
116
|
+
</>
|
|
117
|
+
)
|
|
118
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import styled from 'styled-components/native'
|
|
2
|
+
|
|
3
|
+
export const ReviewOrderContainer = styled.ScrollView`
|
|
4
|
+
padding: 0 25px;
|
|
5
|
+
margin-bottom: 100px;
|
|
6
|
+
`
|
|
7
|
+
|
|
8
|
+
export const BusinessLogo = styled.View`
|
|
9
|
+
margin-vertical: 5px;
|
|
10
|
+
align-items: center;
|
|
11
|
+
`
|
|
12
|
+
|
|
13
|
+
export const FormReviews = styled.View`
|
|
14
|
+
flex: 1;
|
|
15
|
+
height: 100%;
|
|
16
|
+
margin-top: 10px;
|
|
17
|
+
`
|
|
18
|
+
|
|
19
|
+
export const ActionContainer = styled.View`
|
|
20
|
+
flex-direction: row;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
padding: 3px 30px;
|
|
24
|
+
`
|
|
25
|
+
|
|
26
|
+
export const RatingStarContainer = styled.View`
|
|
27
|
+
flex-direction: row;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: space-between;
|
|
30
|
+
margin-top: 10px;
|
|
31
|
+
`
|
|
32
|
+
export const PlacedDate = styled.View`
|
|
33
|
+
margin-top: 30px;
|
|
34
|
+
`
|
|
@@ -20,7 +20,13 @@ export const SearchBar = (props: any) => {
|
|
|
20
20
|
inputStyle,
|
|
21
21
|
onPress,
|
|
22
22
|
isDisabled,
|
|
23
|
-
iconCustomRight
|
|
23
|
+
iconCustomRight,
|
|
24
|
+
onSubmitEditing,
|
|
25
|
+
blurOnSubmit,
|
|
26
|
+
inputContainerStyles,
|
|
27
|
+
containerStyles,
|
|
28
|
+
hideIcon,
|
|
29
|
+
autoFocus
|
|
24
30
|
} = props
|
|
25
31
|
|
|
26
32
|
const theme = useTheme();
|
|
@@ -75,19 +81,21 @@ export const SearchBar = (props: any) => {
|
|
|
75
81
|
}
|
|
76
82
|
|
|
77
83
|
return (
|
|
78
|
-
<Pressable style={[styles.container, { height: height }]}>
|
|
84
|
+
<Pressable style={[styles.container, containerStyles, { height: height }]}>
|
|
79
85
|
<OInput
|
|
86
|
+
autoFocus={autoFocus}
|
|
80
87
|
value={searchValue}
|
|
81
88
|
onChange={onChangeSearch}
|
|
82
|
-
style={styles.inputStyle}
|
|
89
|
+
style={{ ...styles.inputStyle, ...inputContainerStyles }}
|
|
83
90
|
placeholder={placeholder}
|
|
84
|
-
icon={theme.images.general.search}
|
|
91
|
+
icon={!hideIcon && theme.images.general.search}
|
|
85
92
|
isDisabled={isDisabled}
|
|
86
93
|
iconStyle={{ width: 12 }}
|
|
87
94
|
returnKeyType='done'
|
|
88
|
-
inputStyle={{padding: 0, paddingTop: Platform.OS == 'android' ? 2 : 0, ...inputStyle}}
|
|
95
|
+
inputStyle={{ padding: 0, paddingTop: Platform.OS == 'android' ? 2 : 0, ...inputStyle }}
|
|
89
96
|
onPress={() => onPress && onPress()}
|
|
90
97
|
iconCustomRight={iconCustomRight}
|
|
98
|
+
onSubmitEditing={() => onSubmitEditing && onSubmitEditing()}
|
|
91
99
|
/>
|
|
92
100
|
{isCancelButtonShow && (
|
|
93
101
|
<OButton
|