ordering-ui-react-native 0.17.37 → 0.17.38-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 +8 -7
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/OrderCreating/index.tsx +1 -21
- package/src/components/PaymentOptionsWebView/index.tsx +29 -8
- package/src/components/StripeMethodForm/index.tsx +103 -79
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +4 -4
- package/src/types/index.tsx +5 -0
- package/src/utils/index.tsx +7 -1
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
- package/themes/business/src/components/BusinessController/index.tsx +0 -1
- package/themes/business/src/components/Chat/index.tsx +118 -107
- package/themes/business/src/components/DriverMap/index.tsx +17 -6
- package/themes/business/src/components/GoogleMap/index.tsx +58 -57
- package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
- package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/business/src/components/LoginForm/index.tsx +238 -80
- package/themes/business/src/components/LoginForm/styles.tsx +10 -0
- package/themes/business/src/components/MapView/index.tsx +10 -10
- package/themes/business/src/components/NewOrderNotification/index.tsx +43 -50
- package/themes/business/src/components/OrderDetails/Delivery.tsx +4 -3
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +90 -47
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +59 -62
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
- package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
- package/themes/business/src/components/OrderMessage/index.tsx +18 -17
- package/themes/business/src/components/OrderSummary/index.tsx +113 -121
- package/themes/business/src/components/OrdersOption/index.tsx +32 -75
- 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 +445 -243
- package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
- package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
- package/themes/business/src/components/ReviewCustomer/index.tsx +41 -24
- package/themes/business/src/components/StoresList/index.tsx +2 -2
- package/themes/business/src/components/shared/OLink.tsx +33 -13
- package/themes/business/src/components/shared/OModal.tsx +16 -9
- package/themes/business/src/components/shared/OText.tsx +8 -2
- package/themes/business/src/types/index.tsx +32 -2
- package/themes/business/src/utils/index.tsx +44 -1
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
- package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/kiosk/src/components/LoginForm/index.tsx +473 -151
- package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
- package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +3 -2
- package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
- package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
- package/themes/kiosk/src/layouts/Container.tsx +7 -1
- package/themes/kiosk/src/types/index.d.ts +13 -0
- package/themes/kiosk/src/utils/index.tsx +15 -0
- package/themes/original/index.tsx +6 -0
- package/themes/original/src/components/AddressDetails/index.tsx +29 -11
- package/themes/original/src/components/AddressForm/index.tsx +79 -44
- package/themes/original/src/components/AddressList/index.tsx +26 -21
- package/themes/original/src/components/AddressList/styles.tsx +4 -2
- package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +159 -90
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +9 -7
- package/themes/original/src/components/BusinessController/index.tsx +154 -68
- package/themes/original/src/components/BusinessController/styles.tsx +22 -9
- package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
- package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
- package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +23 -22
- package/themes/original/src/components/BusinessListingSearch/index.tsx +351 -326
- package/themes/original/src/components/BusinessPreorder/index.tsx +97 -16
- package/themes/original/src/components/BusinessProductsList/index.tsx +20 -11
- package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
- package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
- package/themes/original/src/components/BusinessProductsListing/index.tsx +684 -524
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +4 -6
- package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +106 -79
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
- package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
- package/themes/original/src/components/Cart/index.tsx +102 -69
- package/themes/original/src/components/CartContent/index.tsx +115 -19
- package/themes/original/src/components/CartContent/styles.tsx +17 -7
- package/themes/original/src/components/Checkout/index.tsx +375 -179
- package/themes/original/src/components/Checkout/styles.tsx +4 -2
- package/themes/original/src/components/CitiesControl/index.tsx +89 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
- package/themes/original/src/components/CouponControl/index.tsx +10 -3
- package/themes/original/src/components/DriverTips/index.tsx +52 -34
- 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 +51 -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 +6 -4
- package/themes/original/src/components/GPSButton/styles.ts +3 -3
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +96 -0
- package/themes/original/src/components/GiftCard/GiftCardUI/styles.tsx +5 -0
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +100 -0
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +8 -0
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +191 -0
- package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +8 -0
- package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +165 -0
- package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +9 -0
- package/themes/original/src/components/GoogleMap/index.tsx +15 -4
- package/themes/original/src/components/Help/index.tsx +8 -8
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +11 -22
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
- package/themes/original/src/components/HelpGuide/index.tsx +12 -16
- package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
- package/themes/original/src/components/HelpOrder/index.tsx +12 -25
- package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
- package/themes/original/src/components/Home/index.tsx +13 -4
- package/themes/original/src/components/LastOrder/index.tsx +1 -34
- package/themes/original/src/components/LoginForm/Otp/index.tsx +139 -75
- package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
- package/themes/original/src/components/LoginForm/index.tsx +71 -28
- package/themes/original/src/components/LottieAnimation/index.tsx +103 -0
- package/themes/original/src/components/MessageListing/index.tsx +16 -42
- package/themes/original/src/components/Messages/index.tsx +32 -10
- package/themes/original/src/components/MomentOption/index.tsx +195 -88
- package/themes/original/src/components/MultiCart/index.tsx +50 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +219 -117
- package/themes/original/src/components/MultiCheckout/index.tsx +298 -88
- package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
- package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +68 -21
- package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
- package/themes/original/src/components/MyOrders/index.tsx +53 -51
- package/themes/original/src/components/NavBar/index.tsx +18 -18
- package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
- package/themes/original/src/components/Notifications/index.tsx +46 -50
- package/themes/original/src/components/Notifications/styles.tsx +6 -3
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +15 -3
- package/themes/original/src/components/OrderDetails/index.tsx +199 -359
- package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
- package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
- package/themes/original/src/components/OrderProgress/index.tsx +93 -114
- package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
- package/themes/original/src/components/OrderSummary/index.tsx +87 -59
- package/themes/original/src/components/OrderTypeSelector/index.tsx +1 -1
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +24 -19
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +14 -14
- package/themes/original/src/components/OrdersOption/index.tsx +70 -65
- package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
- package/themes/original/src/components/PageBanner/index.tsx +171 -0
- package/themes/original/src/components/PageBanner/styles.tsx +11 -0
- package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +64 -7
- package/themes/original/src/components/PhoneInputNumber/index.tsx +3 -3
- package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
- package/themes/original/src/components/ProductForm/index.tsx +223 -232
- package/themes/original/src/components/ProductForm/styles.tsx +5 -8
- package/themes/original/src/components/ProductItemAccordion/index.tsx +59 -29
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +19 -11
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
- package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
- package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
- package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
- package/themes/original/src/components/Promotions/index.tsx +234 -220
- package/themes/original/src/components/Promotions/styles.tsx +10 -3
- package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
- package/themes/original/src/components/ReviewOrder/index.tsx +26 -9
- package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
- package/themes/original/src/components/ReviewProducts/index.tsx +23 -11
- 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 +74 -19
- package/themes/original/src/components/Sessions/index.tsx +11 -8
- package/themes/original/src/components/Sessions/styles.tsx +5 -0
- package/themes/original/src/components/SignupForm/index.tsx +42 -19
- package/themes/original/src/components/SingleOrderCard/index.tsx +156 -65
- package/themes/original/src/components/SingleOrderCard/styles.tsx +11 -9
- package/themes/original/src/components/SingleProductCard/index.tsx +100 -56
- package/themes/original/src/components/SingleProductCard/styles.tsx +22 -13
- package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
- package/themes/original/src/components/StripeCardsList/index.tsx +13 -3
- package/themes/original/src/components/StripeElementsForm/index.tsx +28 -15
- package/themes/original/src/components/UpsellingProducts/index.tsx +238 -224
- package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
- package/themes/original/src/components/UserDetails/index.tsx +8 -4
- package/themes/original/src/components/UserFormDetails/index.tsx +47 -7
- package/themes/original/src/components/UserProfile/index.tsx +5 -7
- package/themes/original/src/components/UserProfileForm/index.tsx +25 -28
- package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
- package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
- package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
- package/themes/original/src/components/Wallets/index.tsx +79 -36
- package/themes/original/src/components/Wallets/styles.tsx +5 -4
- package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
- package/themes/original/src/components/shared/OBottomPopup.tsx +1 -1
- package/themes/original/src/components/shared/OButton.tsx +6 -2
- package/themes/original/src/components/shared/OInput.tsx +16 -2
- package/themes/original/src/components/shared/OModal.tsx +3 -3
- package/themes/original/src/layouts/Container.tsx +13 -9
- package/themes/original/src/types/index.tsx +38 -9
- package/themes/original/src/utils/index.tsx +364 -58
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -8,8 +8,8 @@ export const WrapHeader = styled.View`
|
|
|
8
8
|
export const TopActions = styled.TouchableOpacity`
|
|
9
9
|
height: 60px;
|
|
10
10
|
justify-content: center;
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
min-width: 30px;
|
|
12
|
+
padding-right: 15px;
|
|
13
13
|
`;
|
|
14
14
|
|
|
15
15
|
export const TopHeader = styled.View`
|
|
@@ -44,12 +44,10 @@ export const ProductTitle = styled.View`
|
|
|
44
44
|
padding-bottom: 7px;
|
|
45
45
|
`
|
|
46
46
|
|
|
47
|
-
export const ProductDescription = styled.View
|
|
48
|
-
margin-bottom: 20px;
|
|
49
|
-
`
|
|
47
|
+
export const ProductDescription = styled.View``
|
|
50
48
|
|
|
51
49
|
export const ProductEditions = styled.View`
|
|
52
|
-
padding: 0
|
|
50
|
+
padding-vertical: 0;
|
|
53
51
|
`
|
|
54
52
|
|
|
55
53
|
export const SectionTitle = styled.View`
|
|
@@ -82,7 +80,6 @@ export const ProductActions = styled.View`
|
|
|
82
80
|
border-top-color: ${(props: any) => props.theme.colors.border};
|
|
83
81
|
`
|
|
84
82
|
export const ExtraOptionWrap = styled.ScrollView`
|
|
85
|
-
margin-horizontal: 30px;
|
|
86
83
|
`;
|
|
87
84
|
|
|
88
85
|
export const WeightUnitSwitch = styled.View`
|
|
@@ -97,7 +94,7 @@ export const WeightUnitItem = styled.View`
|
|
|
97
94
|
`}
|
|
98
95
|
`
|
|
99
96
|
export const ProductSummary = styled.View`
|
|
100
|
-
padding: 26px
|
|
97
|
+
padding: 26px ${(props: any) => props.ph}px 0;
|
|
101
98
|
position: relative;
|
|
102
99
|
background-color: white;
|
|
103
100
|
z-index: 100;
|
|
@@ -5,6 +5,7 @@ import { useTheme } from 'styled-components/native';
|
|
|
5
5
|
import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons'
|
|
6
6
|
import RNPickerSelect from 'react-native-picker-select'
|
|
7
7
|
import { ServiceForm } from '../ServiceForm';
|
|
8
|
+
import FastImage from 'react-native-fast-image'
|
|
8
9
|
|
|
9
10
|
import {
|
|
10
11
|
Accordion,
|
|
@@ -26,6 +27,7 @@ import { ProductItemAccordionParams } from '../../types'
|
|
|
26
27
|
export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
27
28
|
|
|
28
29
|
const {
|
|
30
|
+
isDisabledEdit,
|
|
29
31
|
isCartPending,
|
|
30
32
|
isCartProduct,
|
|
31
33
|
product,
|
|
@@ -157,9 +159,37 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
157
159
|
{(product?.images || theme?.images?.dummies?.product) && (
|
|
158
160
|
<ProductImage>
|
|
159
161
|
{isFromCheckout ? (
|
|
160
|
-
|
|
162
|
+
product?.images ? (
|
|
163
|
+
<FastImage
|
|
164
|
+
style={{ ...styles.productImage, ...{ width: 82, height: 82 } }}
|
|
165
|
+
source={{
|
|
166
|
+
uri: optimizeImage(product?.images, 'h_100,c_limit'),
|
|
167
|
+
priority: FastImage.priority.normal,
|
|
168
|
+
}}
|
|
169
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
170
|
+
/>
|
|
171
|
+
) : (
|
|
172
|
+
<OIcon
|
|
173
|
+
src={theme?.images?.dummies?.product}
|
|
174
|
+
style={{ ...styles.productImage, ...{ width: 82, height: 82 } }}
|
|
175
|
+
/>
|
|
176
|
+
)
|
|
161
177
|
) : (
|
|
162
|
-
|
|
178
|
+
product?.images ? (
|
|
179
|
+
<FastImage
|
|
180
|
+
style={styles.productImage}
|
|
181
|
+
source={{
|
|
182
|
+
uri: optimizeImage(product?.images, 'h_100,c_limit'),
|
|
183
|
+
priority: FastImage.priority.normal,
|
|
184
|
+
}}
|
|
185
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
186
|
+
/>
|
|
187
|
+
) : (
|
|
188
|
+
<OIcon
|
|
189
|
+
src={theme?.images?.dummies?.product}
|
|
190
|
+
style={styles.productImage}
|
|
191
|
+
/>
|
|
192
|
+
)
|
|
163
193
|
)}
|
|
164
194
|
</ProductImage>
|
|
165
195
|
)}
|
|
@@ -172,9 +202,9 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
172
202
|
{parseDate(product?.calendar_event?.start, { outputFormat: 'hh:mm a' })} - {parseDate(product?.calendar_event?.end, { outputFormat: 'hh:mm a' })}
|
|
173
203
|
</OText>
|
|
174
204
|
</View>
|
|
175
|
-
): (
|
|
205
|
+
) : (
|
|
176
206
|
<>
|
|
177
|
-
{isCartProduct && !isCartPending && getProductMax && (
|
|
207
|
+
{!isDisabledEdit && isCartProduct && !isCartPending && getProductMax && (
|
|
178
208
|
<ProductInfo>
|
|
179
209
|
<RNPickerSelect
|
|
180
210
|
items={productOptions}
|
|
@@ -196,23 +226,23 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
196
226
|
</ProductQuantity>
|
|
197
227
|
)}
|
|
198
228
|
<View style={{ flex: 1 }}>
|
|
199
|
-
<OText size={12} lineHeight={18} weight={'400'}>{product.name}</OText>
|
|
229
|
+
<OText size={12} lineHeight={18} weight={'400'} mLeft={8}>{product.name}</OText>
|
|
200
230
|
</View>
|
|
201
231
|
</>
|
|
202
232
|
)}
|
|
203
233
|
<View style={{ display: 'flex', flexDirection: 'column', flex: 1, alignItems: 'flex-end', maxWidth: 100 }}>
|
|
204
234
|
<View style={{ flexDirection: 'row' }}>
|
|
205
235
|
<OText size={12} lineHeight={18} weight={'400'}>{parsePrice(product.total || product.price)}</OText>
|
|
206
|
-
{(productInfo().ingredients.length > 0 || productInfo().options.length > 0 || product.comment) && (
|
|
236
|
+
{(productInfo().ingredients.length > 0 || productInfo().options.length > 0 || !!product.comment) && (
|
|
207
237
|
<MaterialCommunityIcon name='chevron-down' size={18} />
|
|
208
238
|
)}
|
|
209
239
|
</View>
|
|
210
|
-
<View style={{ display: 'flex', flexDirection: 'row', justifyContent: 'flex-start' }}>
|
|
211
|
-
{onEditProduct && isCartProduct && !isCartPending && product?.valid_menu && (
|
|
212
|
-
<TouchableOpacity onPress={() => handleEditProduct(product)} style={{
|
|
213
|
-
<
|
|
214
|
-
|
|
215
|
-
|
|
240
|
+
<View style={{ display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', height: 20 }}>
|
|
241
|
+
{!isDisabledEdit && onEditProduct && isCartProduct && !isCartPending && product?.valid_menu && (
|
|
242
|
+
<TouchableOpacity onPress={() => handleEditProduct(product)} style={{ marginRight: 5 }}>
|
|
243
|
+
<MaterialCommunityIcon
|
|
244
|
+
name='pencil-outline'
|
|
245
|
+
size={20}
|
|
216
246
|
color={theme.colors.textSecondary}
|
|
217
247
|
/>
|
|
218
248
|
</TouchableOpacity>
|
|
@@ -223,9 +253,9 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
223
253
|
message={t('QUESTION_DELETE_PRODUCT', 'Are you sure that you want to delete the product?')}
|
|
224
254
|
onAccept={() => onDeleteProduct(product)}
|
|
225
255
|
>
|
|
226
|
-
<
|
|
227
|
-
|
|
228
|
-
|
|
256
|
+
<MaterialCommunityIcon
|
|
257
|
+
name='trash-can-outline'
|
|
258
|
+
size={20}
|
|
229
259
|
color={theme.colors.textSecondary}
|
|
230
260
|
/>
|
|
231
261
|
</OAlert>
|
|
@@ -276,7 +306,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
276
306
|
))}
|
|
277
307
|
</ProductOptionsList>
|
|
278
308
|
)}
|
|
279
|
-
{product.comment && (
|
|
309
|
+
{!!product.comment && (
|
|
280
310
|
<ProductComment>
|
|
281
311
|
<OText size={10} color={theme.colors.textSecondary}>{t('SPECIAL_COMMENT', 'Special Comment')}</OText>
|
|
282
312
|
<OText size={10} color={theme.colors.textThird}>{product.comment}</OText>
|
|
@@ -287,22 +317,22 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
287
317
|
</View>
|
|
288
318
|
</AccordionSection>
|
|
289
319
|
<OModal
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
320
|
+
open={isServiceOpen}
|
|
321
|
+
onClose={() => setIsServiceOpen(false)}
|
|
322
|
+
entireModal
|
|
323
|
+
>
|
|
324
|
+
<ServiceForm
|
|
325
|
+
isCartProduct
|
|
326
|
+
isService
|
|
327
|
+
businessId={product?.business_id}
|
|
298
328
|
categoryId={product?.category_id}
|
|
299
329
|
productId={product?.id}
|
|
300
330
|
productCart={product}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
331
|
+
onSave={() => setIsServiceOpen(false)}
|
|
332
|
+
onClose={() => setIsServiceOpen(false)}
|
|
333
|
+
professionalSelected={product?.calendar_event?.professional}
|
|
334
|
+
/>
|
|
335
|
+
</OModal>
|
|
306
336
|
</>
|
|
307
337
|
)
|
|
308
338
|
}
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
} from 'ordering-components/native'
|
|
7
7
|
import { useTheme } from 'styled-components/native';
|
|
8
8
|
import { StyleSheet, View } from 'react-native'
|
|
9
|
+
import IconAntDesign from 'react-native-vector-icons/AntDesign';
|
|
9
10
|
|
|
10
11
|
import {
|
|
11
12
|
Container,
|
|
@@ -31,15 +32,18 @@ export const ProductOptionSubOptionUI = (props: any) => {
|
|
|
31
32
|
setIsScrollAvailable
|
|
32
33
|
} = props
|
|
33
34
|
|
|
34
|
-
const disableIncrement = option?.limit_suboptions_by_max ? balance === option?.max : state.quantity === suboption?.max || (!state.selected && balance === option?.max)
|
|
35
|
+
const disableIncrement = option?.limit_suboptions_by_max ? balance === option?.max || state.quantity === suboption?.max : state.quantity === suboption?.max || (!state.selected && balance === option?.max)
|
|
35
36
|
const price = option?.with_half_option && suboption?.half_price && state.position !== 'whole' ? suboption?.half_price : suboption?.price
|
|
36
|
-
|
|
37
|
+
|
|
37
38
|
const theme = useTheme();
|
|
38
39
|
const [, t] = useLanguage()
|
|
39
40
|
const [{ parsePrice }] = useUtils()
|
|
40
41
|
const [showMessage, setShowMessage] = useState(false)
|
|
41
42
|
const [isDirty, setIsDirty] = useState(false)
|
|
42
43
|
|
|
44
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
45
|
+
const iconsSize = isChewLayout ? 20 : 16
|
|
46
|
+
|
|
43
47
|
const handleSuboptionClick = () => {
|
|
44
48
|
toggleSelect()
|
|
45
49
|
setIsDirty(true)
|
|
@@ -64,7 +68,7 @@ export const ProductOptionSubOptionUI = (props: any) => {
|
|
|
64
68
|
|
|
65
69
|
return (
|
|
66
70
|
<View>
|
|
67
|
-
<Container onPress={() => handleSuboptionClick()}>
|
|
71
|
+
<Container onPress={!(option?.with_half_option || option?.allow_suboption_quantity) ? () => handleSuboptionClick() : null}>
|
|
68
72
|
<IconControl disabled={disabled} onPress={() => handleSuboptionClick()}>
|
|
69
73
|
{((option?.min === 0 && option?.max === 1) || option?.max > 1) ? (
|
|
70
74
|
state?.selected ? (
|
|
@@ -87,9 +91,9 @@ export const ProductOptionSubOptionUI = (props: any) => {
|
|
|
87
91
|
{option?.allow_suboption_quantity && state?.selected && (
|
|
88
92
|
<>
|
|
89
93
|
<Checkbox disabled={disabled || state.quantity === 0} onPress={decrement}>
|
|
90
|
-
<
|
|
91
|
-
|
|
92
|
-
|
|
94
|
+
<IconAntDesign
|
|
95
|
+
name='minuscircleo'
|
|
96
|
+
size={iconsSize}
|
|
93
97
|
color={state.quantity === 0 || disabled ? theme.colors.disabled : theme.colors.primary}
|
|
94
98
|
/>
|
|
95
99
|
</Checkbox>
|
|
@@ -97,9 +101,9 @@ export const ProductOptionSubOptionUI = (props: any) => {
|
|
|
97
101
|
{state.quantity}
|
|
98
102
|
</OText>
|
|
99
103
|
<Checkbox disabled={disabled || disableIncrement} onPress={increment}>
|
|
100
|
-
<
|
|
101
|
-
|
|
102
|
-
|
|
104
|
+
<IconAntDesign
|
|
105
|
+
name='pluscircleo'
|
|
106
|
+
size={iconsSize}
|
|
103
107
|
color={disableIncrement || disabled ? theme.colors.disabled : theme.colors.primary}
|
|
104
108
|
/>
|
|
105
109
|
</Checkbox>
|
|
@@ -135,12 +139,16 @@ export const ProductOptionSubOptionUI = (props: any) => {
|
|
|
135
139
|
)}
|
|
136
140
|
</PositionControl>
|
|
137
141
|
{price > 0 && (
|
|
138
|
-
<OText size={12} lineHeight={18} color={theme.colors.textSecondary}>
|
|
142
|
+
<OText size={12} lineHeight={18} color={theme.colors.textSecondary} style={{ paddingRight: 10 }}>
|
|
139
143
|
+ {parsePrice(price)}
|
|
140
144
|
</OText>
|
|
141
145
|
)}
|
|
142
146
|
</Container>
|
|
143
|
-
{showMessage &&
|
|
147
|
+
{showMessage && (
|
|
148
|
+
<OText size={10} mLeft={4} mRight={4} style={{ flex: 1, textAlign: 'center' }} color={theme.colors.primary}>
|
|
149
|
+
{`${t('OPTIONS_MAX_LIMIT', 'Maximum options to choose')}: ${option?.max}`}
|
|
150
|
+
</OText>
|
|
151
|
+
)}
|
|
144
152
|
</View>
|
|
145
153
|
)
|
|
146
154
|
}
|
|
@@ -4,12 +4,12 @@ export const Container = styled.TouchableOpacity`
|
|
|
4
4
|
flex-direction: row;
|
|
5
5
|
align-items: center;
|
|
6
6
|
justify-content: space-between;
|
|
7
|
-
padding: 10px;
|
|
8
7
|
width: 100%;
|
|
9
8
|
`
|
|
10
9
|
|
|
11
10
|
export const IconControl = styled.TouchableOpacity`
|
|
12
11
|
flex-direction: row;
|
|
12
|
+
padding: 10px;
|
|
13
13
|
width: 45%;
|
|
14
14
|
align-items: center;
|
|
15
15
|
`
|
|
@@ -21,7 +21,6 @@ export const QuantityControl = styled.View`
|
|
|
21
21
|
margin-horizontal: 5px;
|
|
22
22
|
flex: 1;
|
|
23
23
|
width: 60px;
|
|
24
|
-
|
|
25
24
|
`
|
|
26
25
|
|
|
27
26
|
export const PositionControl = styled.View`
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {
|
|
3
|
+
useSession,
|
|
4
|
+
useUtils,
|
|
5
|
+
SingleProfessionalCard as SingleProfessionalCardController
|
|
6
|
+
} from 'ordering-components/native'
|
|
7
|
+
import { useTheme } from 'styled-components/native'
|
|
8
|
+
import { StyleSheet, TouchableOpacity, View } from 'react-native'
|
|
9
|
+
import FastImage from 'react-native-fast-image'
|
|
10
|
+
import { OIcon, OText } from '../../shared'
|
|
11
|
+
import IconAntDesign from 'react-native-vector-icons/AntDesign';
|
|
12
|
+
|
|
13
|
+
const SingleProfessionalCardUI = (props) => {
|
|
14
|
+
const {
|
|
15
|
+
professional,
|
|
16
|
+
handleFavoriteProfessional,
|
|
17
|
+
active,
|
|
18
|
+
handleProfessionalClick
|
|
19
|
+
} = props
|
|
20
|
+
|
|
21
|
+
const theme = useTheme()
|
|
22
|
+
const [{ auth }] = useSession()
|
|
23
|
+
const [{ optimizeImage }] = useUtils()
|
|
24
|
+
|
|
25
|
+
const handleChangeFavorite = () => {
|
|
26
|
+
if (auth) {
|
|
27
|
+
handleFavoriteProfessional && handleFavoriteProfessional(!professional?.favorite)
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const styles = StyleSheet.create({
|
|
32
|
+
professionalItem: {
|
|
33
|
+
flexDirection: 'row',
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
borderRadius: 7.6,
|
|
36
|
+
padding: 11,
|
|
37
|
+
borderWidth: 1,
|
|
38
|
+
marginRight: 12,
|
|
39
|
+
minHeight: 64
|
|
40
|
+
},
|
|
41
|
+
photoStyle: {
|
|
42
|
+
width: 42,
|
|
43
|
+
height: 42,
|
|
44
|
+
borderRadius: 7.6
|
|
45
|
+
},
|
|
46
|
+
favoriteIconStyle: {
|
|
47
|
+
width: 16,
|
|
48
|
+
height: 16,
|
|
49
|
+
},
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<TouchableOpacity
|
|
54
|
+
onPress={() => handleProfessionalClick(professional)}
|
|
55
|
+
>
|
|
56
|
+
<View
|
|
57
|
+
style={{
|
|
58
|
+
...styles.professionalItem,
|
|
59
|
+
borderColor: active
|
|
60
|
+
? theme.colors.primary
|
|
61
|
+
: theme.colors.border
|
|
62
|
+
}}
|
|
63
|
+
>
|
|
64
|
+
{professional?.photo ? (
|
|
65
|
+
<FastImage
|
|
66
|
+
style={styles.photoStyle}
|
|
67
|
+
source={{
|
|
68
|
+
uri: optimizeImage(professional?.photo, 'h_250,c_limit'),
|
|
69
|
+
priority: FastImage.priority.normal,
|
|
70
|
+
}}
|
|
71
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
72
|
+
/>
|
|
73
|
+
) : (
|
|
74
|
+
<OIcon
|
|
75
|
+
src={theme?.images?.general?.user}
|
|
76
|
+
cover={false}
|
|
77
|
+
style={styles.photoStyle}
|
|
78
|
+
/>
|
|
79
|
+
)}
|
|
80
|
+
<View style={{ marginLeft: 12 }}>
|
|
81
|
+
<OText
|
|
82
|
+
size={12}
|
|
83
|
+
weight={'400'}
|
|
84
|
+
>
|
|
85
|
+
{professional?.name} {professional?.lastname}
|
|
86
|
+
</OText>
|
|
87
|
+
|
|
88
|
+
<TouchableOpacity
|
|
89
|
+
onPress={() => handleChangeFavorite()}
|
|
90
|
+
>
|
|
91
|
+
{professional?.favorite
|
|
92
|
+
? <IconAntDesign name='heart' size={16} color={theme.colors.danger5} />
|
|
93
|
+
: <IconAntDesign name='hearto' size={16} color={theme.colors.danger5} />
|
|
94
|
+
}
|
|
95
|
+
</TouchableOpacity>
|
|
96
|
+
</View>
|
|
97
|
+
</View>
|
|
98
|
+
</TouchableOpacity>
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export const SingleProfessionalCard = (props) => {
|
|
103
|
+
const singleProfessionalCardProps = {
|
|
104
|
+
...props,
|
|
105
|
+
UIComponent: SingleProfessionalCardUI
|
|
106
|
+
}
|
|
107
|
+
return <SingleProfessionalCardController {...singleProfessionalCardProps} />
|
|
108
|
+
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
|
-
import { ScrollView, TouchableOpacity, View, StyleSheet
|
|
3
|
-
import {
|
|
2
|
+
import { ScrollView, TouchableOpacity, View, StyleSheet } from 'react-native'
|
|
3
|
+
import { useLanguage } from 'ordering-components/native'
|
|
4
4
|
import { useTheme } from 'styled-components/native'
|
|
5
|
-
import
|
|
6
|
-
import { OIcon, OText, OModal } from '../shared'
|
|
5
|
+
import { OText, OModal } from '../shared'
|
|
7
6
|
import { ProfessionalProfile } from '../ProfessionalProfile'
|
|
8
7
|
import { ProfessionalFilterParams } from '../../types'
|
|
8
|
+
import { SingleProfessionalCard } from './SingleProfessionalCard'
|
|
9
9
|
|
|
10
10
|
export const ProfessionalFilter = (props: ProfessionalFilterParams) => {
|
|
11
11
|
const {
|
|
12
12
|
professionals,
|
|
13
13
|
professionalSelected,
|
|
14
|
-
handleChangeProfessionalSelected
|
|
14
|
+
handleChangeProfessionalSelected,
|
|
15
|
+
handleUpdateProfessionals
|
|
15
16
|
} = props
|
|
16
17
|
|
|
17
18
|
const theme = useTheme()
|
|
18
|
-
const [{ optimizeImage }] = useUtils()
|
|
19
19
|
const [, t] = useLanguage()
|
|
20
20
|
const [open, setOpen] = useState(false)
|
|
21
21
|
const [currentProfessional, setCurrentProfessional] = useState(null)
|
|
@@ -30,6 +30,11 @@ export const ProfessionalFilter = (props: ProfessionalFilterParams) => {
|
|
|
30
30
|
setOpen(false)
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
const onUpdateProfessionals = (id, changes) => {
|
|
34
|
+
const updatedProfessional = professionals.find(professional => professional.id === id)
|
|
35
|
+
handleUpdateProfessionals({ ...updatedProfessional, ...changes })
|
|
36
|
+
}
|
|
37
|
+
|
|
33
38
|
const styles = StyleSheet.create({
|
|
34
39
|
professionalItem: {
|
|
35
40
|
flexDirection: 'row',
|
|
@@ -39,12 +44,7 @@ export const ProfessionalFilter = (props: ProfessionalFilterParams) => {
|
|
|
39
44
|
borderWidth: 1,
|
|
40
45
|
marginRight: 12,
|
|
41
46
|
minHeight: 64
|
|
42
|
-
}
|
|
43
|
-
photoStyle: {
|
|
44
|
-
width: 42,
|
|
45
|
-
height: 42,
|
|
46
|
-
borderRadius: 7.6
|
|
47
|
-
}
|
|
47
|
+
}
|
|
48
48
|
})
|
|
49
49
|
|
|
50
50
|
return (
|
|
@@ -73,44 +73,14 @@ export const ProfessionalFilter = (props: ProfessionalFilterParams) => {
|
|
|
73
73
|
</OText>
|
|
74
74
|
</View>
|
|
75
75
|
</TouchableOpacity>
|
|
76
|
-
{professionals.map((professional: any
|
|
77
|
-
<
|
|
78
|
-
key={
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
borderColor: (professional?.id === professionalSelected?.id)
|
|
85
|
-
? theme.colors.primary
|
|
86
|
-
: theme.colors.border
|
|
87
|
-
}}
|
|
88
|
-
>
|
|
89
|
-
{professional?.photo ? (
|
|
90
|
-
<FastImage
|
|
91
|
-
style={styles.photoStyle}
|
|
92
|
-
source={{
|
|
93
|
-
uri: optimizeImage(professional?.photo, 'h_250,c_limit'),
|
|
94
|
-
priority: FastImage.priority.normal,
|
|
95
|
-
}}
|
|
96
|
-
resizeMode={FastImage.resizeMode.cover}
|
|
97
|
-
/>
|
|
98
|
-
) : (
|
|
99
|
-
<OIcon
|
|
100
|
-
src={theme?.images?.general?.user}
|
|
101
|
-
cover={false}
|
|
102
|
-
style={styles.photoStyle}
|
|
103
|
-
/>
|
|
104
|
-
)}
|
|
105
|
-
<OText
|
|
106
|
-
size={12}
|
|
107
|
-
style={{ marginLeft: 12 }}
|
|
108
|
-
weight={'400'}
|
|
109
|
-
>
|
|
110
|
-
{professional?.name} {professional?.lastname}
|
|
111
|
-
</OText>
|
|
112
|
-
</View>
|
|
113
|
-
</TouchableOpacity>
|
|
76
|
+
{professionals.map((professional: any) => (
|
|
77
|
+
<SingleProfessionalCard
|
|
78
|
+
key={professional.id}
|
|
79
|
+
professional={professional}
|
|
80
|
+
active={professional?.id === professionalSelected?.id}
|
|
81
|
+
handleProfessionalClick={handleOpenProfile}
|
|
82
|
+
handleUpdateProfessionals={onUpdateProfessionals}
|
|
83
|
+
/>
|
|
114
84
|
))}
|
|
115
85
|
</ScrollView>
|
|
116
86
|
<OModal
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef } from 'react'
|
|
2
|
-
import { StyleSheet, Platform, View, Dimensions } from 'react-native'
|
|
2
|
+
import { StyleSheet, Platform, View, Dimensions, Text } from 'react-native'
|
|
3
3
|
import { useUtils, useLanguage, useConfig } from 'ordering-components/native'
|
|
4
4
|
import { useTheme } from 'styled-components/native'
|
|
5
5
|
import CalendarPicker from 'react-native-calendar-picker'
|
|
@@ -60,7 +60,12 @@ export const ProfessionalProfile = (props: ProfessionalProfileParams) => {
|
|
|
60
60
|
},
|
|
61
61
|
photoStyle: {
|
|
62
62
|
alignSelf: 'center'
|
|
63
|
-
}
|
|
63
|
+
},
|
|
64
|
+
dropDownRow: {
|
|
65
|
+
color: theme.colors.primary,
|
|
66
|
+
fontSize: 14,
|
|
67
|
+
marginHorizontal: 0
|
|
68
|
+
},
|
|
64
69
|
})
|
|
65
70
|
|
|
66
71
|
const onDateChange = (date: any) => {
|
|
@@ -92,6 +97,28 @@ export const ProfessionalProfile = (props: ProfessionalProfileParams) => {
|
|
|
92
97
|
setIsEnabled(menu?.schedule?.[day]?.enabled || false)
|
|
93
98
|
}
|
|
94
99
|
|
|
100
|
+
const getMomentTime = (time) => {
|
|
101
|
+
const _moment = moment(`${moment(selectDate).format('YYYY-MM-DD')} ${time}`, 'YYYY-MM-DD HH:mm').toDate()
|
|
102
|
+
return _moment
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const isBusyTime = (professional, selectedMoment) => {
|
|
106
|
+
if (!selectedMoment) return false
|
|
107
|
+
const startDay = moment(selectedMoment).utc().format('d')
|
|
108
|
+
const isStartScheduleEnabled = professional?.schedule?.[startDay]?.enabled
|
|
109
|
+
if (!isStartScheduleEnabled) return true
|
|
110
|
+
|
|
111
|
+
if (professional?.busy_times?.length === 0) return false
|
|
112
|
+
|
|
113
|
+
const busyTimes = professional?.busy_times
|
|
114
|
+
|
|
115
|
+
const valid = busyTimes.some(item => {
|
|
116
|
+
return (moment.utc(item?.start).local().valueOf() <= moment(selectedMoment).valueOf() &&
|
|
117
|
+
moment(selectedMoment).valueOf() < moment.utc(item?.end).local().valueOf())
|
|
118
|
+
})
|
|
119
|
+
return valid
|
|
120
|
+
}
|
|
121
|
+
|
|
95
122
|
const getTimes = (curdate: any, menu: any) => {
|
|
96
123
|
validateSelectedDate(curdate, menu)
|
|
97
124
|
const date = new Date()
|
|
@@ -147,7 +174,7 @@ export const ProfessionalProfile = (props: ProfessionalProfileParams) => {
|
|
|
147
174
|
}
|
|
148
175
|
|
|
149
176
|
useEffect(() => {
|
|
150
|
-
if (selectDate === null) return
|
|
177
|
+
if (selectDate === null || !professional?.schedule) return
|
|
151
178
|
const _times = getTimes(selectDate, professional)
|
|
152
179
|
setTimeList(_times)
|
|
153
180
|
}, [selectDate, professional])
|
|
@@ -238,10 +265,12 @@ export const ProfessionalProfile = (props: ProfessionalProfileParams) => {
|
|
|
238
265
|
paddingTop: 8,
|
|
239
266
|
paddingHorizontal: 12
|
|
240
267
|
}}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
268
|
+
renderCustomizedRowChild={(item, index) => {
|
|
269
|
+
return (
|
|
270
|
+
<Text style={[styles.dropDownRow, { color: isBusyTime(professional, getMomentTime(item.value)) ? theme.colors.lightGray : theme.colors.primary } ]}>
|
|
271
|
+
{item.text}
|
|
272
|
+
</Text>
|
|
273
|
+
)
|
|
245
274
|
}}
|
|
246
275
|
renderDropdownIcon={() => dropDownIcon()}
|
|
247
276
|
dropdownOverlayColor='transparent'
|