ordering-ui-react-native 0.17.99-release → 0.18.0-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 +1 -1
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +7 -6
- package/themes/original/src/components/AddressForm/index.tsx +2 -2
- package/themes/original/src/components/AddressForm/styles.tsx +1 -1
- package/themes/original/src/components/AddressList/styles.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +2 -2
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
- package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +4 -3
- package/themes/original/src/components/BusinessListingSearch/index.tsx +4 -5
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
- package/themes/original/src/components/BusinessProductsListing/index.tsx +31 -12
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
- package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +7 -7
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
- package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +1 -1
- package/themes/original/src/components/Checkout/styles.tsx +17 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
- package/themes/original/src/components/Favorite/index.tsx +3 -4
- package/themes/original/src/components/Favorite/styles.tsx +0 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/index.tsx +1 -1
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
- package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
- package/themes/original/src/components/Home/index.tsx +1 -1
- package/themes/original/src/components/Messages/styles.tsx +1 -1
- package/themes/original/src/components/MultiCart/index.tsx +1 -1
- package/themes/original/src/components/MultiCheckout/index.tsx +4 -4
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +1 -1
- package/themes/original/src/components/MyOrders/index.tsx +5 -5
- package/themes/original/src/components/NetworkError/styles.tsx +2 -2
- package/themes/original/src/components/Notifications/index.tsx +2 -4
- package/themes/original/src/components/Notifications/styles.tsx +0 -1
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +1 -1
- package/themes/original/src/components/OrderDetails/index.tsx +702 -663
- package/themes/original/src/components/OrderDetails/styles.tsx +24 -7
- package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/index.tsx +1 -1
- package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
- package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
- package/themes/original/src/components/ProductForm/index.tsx +51 -146
- package/themes/original/src/components/ProductItemAccordion/index.tsx +5 -0
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +1 -1
- package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
- package/themes/original/src/components/Promotions/index.tsx +4 -4
- package/themes/original/src/components/Promotions/styles.tsx +0 -2
- package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
- package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
- package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
- package/themes/original/src/components/ServiceForm/index.tsx +1 -1
- package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
- package/themes/original/src/components/StripeElementsForm/index.tsx +1 -1
- package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
- package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +86 -0
- package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
- package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
- package/themes/original/src/components/UserFormDetails/index.tsx +16 -3
- package/themes/original/src/components/UserProfile/index.tsx +1 -1
- package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
- package/themes/original/src/components/Wallets/index.tsx +1 -3
- package/themes/original/src/components/Wallets/styles.tsx +1 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
- package/themes/original/src/components/shared/OModal.tsx +12 -14
- package/themes/original/src/layouts/Container.tsx +1 -1
|
@@ -9,7 +9,7 @@ export const NavBack = styled.TouchableOpacity`
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
export const Header = styled.View`
|
|
12
|
-
padding: 10px
|
|
12
|
+
padding: 10px 20px;
|
|
13
13
|
flex: 1;
|
|
14
14
|
`
|
|
15
15
|
|
|
@@ -23,7 +23,7 @@ export const OrderContent = styled.View`
|
|
|
23
23
|
export const OrderBusiness = styled.View`
|
|
24
24
|
position: relative;
|
|
25
25
|
padding-vertical: 10px;
|
|
26
|
-
padding-horizontal:
|
|
26
|
+
padding-horizontal: 20px;
|
|
27
27
|
background-color: ${(props: any) => props.theme.colors.white};
|
|
28
28
|
align-items: flex-start;
|
|
29
29
|
`
|
|
@@ -63,7 +63,7 @@ export const SectionTitle = styled.View`
|
|
|
63
63
|
`
|
|
64
64
|
|
|
65
65
|
export const OrderCustomer = styled.View`
|
|
66
|
-
padding: 20px
|
|
66
|
+
padding: 20px 20px 10px;
|
|
67
67
|
background-color: ${(props: any) => props.theme.colors.white};
|
|
68
68
|
`
|
|
69
69
|
|
|
@@ -85,7 +85,7 @@ export const InfoBlock = styled.View`
|
|
|
85
85
|
export const HeaderInfo = styled.View`
|
|
86
86
|
flex: 1;
|
|
87
87
|
background-color: ${(props: any) => props.theme.colors.backgroundGray100};
|
|
88
|
-
padding: 20px
|
|
88
|
+
padding: 20px 20px;
|
|
89
89
|
`
|
|
90
90
|
|
|
91
91
|
export const OrderProducts = styled(OrderCustomer)``
|
|
@@ -99,7 +99,7 @@ export const Table = styled.View`
|
|
|
99
99
|
`
|
|
100
100
|
|
|
101
101
|
export const OrderBill = styled.View`
|
|
102
|
-
padding-horizontal:
|
|
102
|
+
padding-horizontal: 20px;
|
|
103
103
|
padding-vertical: 10px;
|
|
104
104
|
flex: 1;
|
|
105
105
|
background-color: ${(props: any) => props.theme.colors.white};
|
|
@@ -129,7 +129,7 @@ export const OrderAction = styled.View`
|
|
|
129
129
|
`
|
|
130
130
|
|
|
131
131
|
export const PlaceSpotWrapper = styled.View`
|
|
132
|
-
padding-horizontal:
|
|
132
|
+
padding-horizontal: 20px;
|
|
133
133
|
`
|
|
134
134
|
|
|
135
135
|
export const ProfessionalPhoto = styled.ImageBackground`
|
|
@@ -140,4 +140,21 @@ export const ProfessionalPhoto = styled.ImageBackground`
|
|
|
140
140
|
width: 80px;
|
|
141
141
|
resize-mode: cover;
|
|
142
142
|
margin-right: 10px;
|
|
143
|
-
`;
|
|
143
|
+
`;
|
|
144
|
+
|
|
145
|
+
export const TopActions = styled.TouchableOpacity`
|
|
146
|
+
height: 60px;
|
|
147
|
+
justify-content: center;
|
|
148
|
+
min-width: 30px;
|
|
149
|
+
padding-right: 15px;
|
|
150
|
+
`;
|
|
151
|
+
|
|
152
|
+
export const TopHeader = styled.View`
|
|
153
|
+
width: 100%;
|
|
154
|
+
flex-direction: row;
|
|
155
|
+
align-items: center;
|
|
156
|
+
justify-content: space-between;
|
|
157
|
+
z-index: 1;
|
|
158
|
+
height: 60px;
|
|
159
|
+
min-height: 60px;
|
|
160
|
+
`
|
|
@@ -2,5 +2,5 @@ import styled, { css } from 'styled-components/native'
|
|
|
2
2
|
|
|
3
3
|
export const ListWrapper = styled.View`
|
|
4
4
|
background-color: ${(props: any) => props.theme.colors.backgroundLight};
|
|
5
|
-
padding-horizontal: ${(props : any) => props.isBusinessesSearchList ? '0' : '
|
|
5
|
+
padding-horizontal: ${(props : any) => props.isBusinessesSearchList ? '0' : '20px'};
|
|
6
6
|
`;
|
|
@@ -2,5 +2,5 @@ import styled from 'styled-components/native'
|
|
|
2
2
|
|
|
3
3
|
export const ListWrapper = styled.View`
|
|
4
4
|
background-color: ${(props: any) => props.theme.colors.backgroundLight};
|
|
5
|
-
padding-horizontal: ${(props : any) => props.isBusinessesSearchList ? '0' : '
|
|
5
|
+
padding-horizontal: ${(props : any) => props.isBusinessesSearchList ? '0' : '20px'};
|
|
6
6
|
`;
|
|
@@ -3,7 +3,7 @@ import styled, { css } from 'styled-components/native'
|
|
|
3
3
|
export const OptionTitle = styled.View`
|
|
4
4
|
margin-top: 24px;
|
|
5
5
|
${(props : any) => props.titleContent && css`
|
|
6
|
-
margin-left: ${() => props.isBusinessesSearchList ? '0' : '
|
|
6
|
+
margin-left: ${() => props.isBusinessesSearchList ? '0' : '20px'};
|
|
7
7
|
`}
|
|
8
8
|
`
|
|
9
9
|
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { TouchableOpacity } from 'react-native';
|
|
3
|
+
import { useTheme } from 'styled-components/native';
|
|
4
|
+
import { OText } from '../shared';
|
|
5
|
+
|
|
6
|
+
export const ExtraOptions = (props : any) => {
|
|
7
|
+
const {
|
|
8
|
+
options,
|
|
9
|
+
setSelectedOpt,
|
|
10
|
+
scrollViewRef,
|
|
11
|
+
optionLayout,
|
|
12
|
+
editionsLayoutY,
|
|
13
|
+
styles,
|
|
14
|
+
selOpt
|
|
15
|
+
} = props
|
|
16
|
+
|
|
17
|
+
const theme = useTheme()
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<>
|
|
21
|
+
{options.map(({ id, name, respect_to, suboptions }: any) => (
|
|
22
|
+
<React.Fragment key={`cont_key_${id}`}>
|
|
23
|
+
{respect_to == null && suboptions?.length > 0 && (
|
|
24
|
+
<TouchableOpacity
|
|
25
|
+
key={`eopt_key_${id}`}
|
|
26
|
+
onPress={() => {
|
|
27
|
+
setSelectedOpt(id)
|
|
28
|
+
scrollViewRef?.current?.scrollTo && scrollViewRef.current.scrollTo({
|
|
29
|
+
y: optionLayout[`id:${id}`]?.y + editionsLayoutY - 50,
|
|
30
|
+
animated: true
|
|
31
|
+
})
|
|
32
|
+
}}
|
|
33
|
+
style={[
|
|
34
|
+
styles.extraItem,
|
|
35
|
+
{
|
|
36
|
+
borderBottomColor:
|
|
37
|
+
selOpt == id ? theme.colors.textNormal : theme.colors.backgroundPage,
|
|
38
|
+
},
|
|
39
|
+
]}>
|
|
40
|
+
<OText
|
|
41
|
+
color={
|
|
42
|
+
selOpt == id ? theme.colors.textNormal : theme.colors.textSecondary
|
|
43
|
+
}
|
|
44
|
+
size={12}
|
|
45
|
+
weight={selOpt == id ? '600' : 'normal'}
|
|
46
|
+
style={{ maxWidth: 150 }}
|
|
47
|
+
numberOfLines={1}>
|
|
48
|
+
{name}
|
|
49
|
+
</OText>
|
|
50
|
+
</TouchableOpacity>
|
|
51
|
+
)}
|
|
52
|
+
</React.Fragment>
|
|
53
|
+
))}
|
|
54
|
+
</>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
@@ -55,9 +55,13 @@ import { ProductOptionSubOption } from '../ProductOptionSubOption';
|
|
|
55
55
|
import { NotFoundSource } from '../NotFoundSource';
|
|
56
56
|
import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
|
|
57
57
|
import NavBar from '../NavBar';
|
|
58
|
-
import { orderTypeList
|
|
58
|
+
import { orderTypeList } from '../../utils';
|
|
59
|
+
import { ActionButton } from './ActionButton'
|
|
60
|
+
import { ExtraOptions } from './ExtraOptions'
|
|
59
61
|
const windowWidth = Dimensions.get('window').width;
|
|
60
62
|
|
|
63
|
+
|
|
64
|
+
|
|
61
65
|
export const ProductOptionsUI = (props: any) => {
|
|
62
66
|
const {
|
|
63
67
|
navigation,
|
|
@@ -79,11 +83,10 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
79
83
|
actionStatus,
|
|
80
84
|
handleCreateGuestUser
|
|
81
85
|
} = props;
|
|
82
|
-
|
|
83
86
|
const theme = useTheme();
|
|
84
87
|
const [, { showToast }] = useToast()
|
|
85
88
|
const [events] = useEvent()
|
|
86
|
-
|
|
89
|
+
const commentRef = useRef()
|
|
87
90
|
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
88
91
|
|
|
89
92
|
const styles = StyleSheet.create({
|
|
@@ -138,7 +141,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
138
141
|
slide1: {
|
|
139
142
|
flex: 1,
|
|
140
143
|
alignItems: 'center',
|
|
141
|
-
width: '100%'
|
|
144
|
+
width: '100%'
|
|
142
145
|
},
|
|
143
146
|
mainSwiper: {
|
|
144
147
|
height: 258,
|
|
@@ -177,7 +180,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
177
180
|
marginTop: 10
|
|
178
181
|
},
|
|
179
182
|
wrapperNavbar: {
|
|
180
|
-
paddingHorizontal:
|
|
183
|
+
paddingHorizontal: 20,
|
|
181
184
|
paddingTop: 0,
|
|
182
185
|
}
|
|
183
186
|
});
|
|
@@ -208,7 +211,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
208
211
|
const [editionsLayoutY, setEditionsLayoutY] = useState(null)
|
|
209
212
|
const [viewedProduct, setViewedProduct] = useState<any>(null)
|
|
210
213
|
const [showTitle, setShowTitle] = useState(false)
|
|
211
|
-
|
|
214
|
+
const productOptionsMounted = useRef(false)
|
|
212
215
|
const guestCheckoutEnabled = configs?.guest_checkout_enabled?.value === '1'
|
|
213
216
|
const orderTypeEnabled = !orderTypeList[orderState?.options?.type - 1] || configs?.allowed_order_types_guest_checkout?.value?.includes(orderTypeList[orderState?.options?.type - 1])
|
|
214
217
|
|
|
@@ -323,57 +326,15 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
323
326
|
|
|
324
327
|
let _optionLayout: any = {}
|
|
325
328
|
|
|
326
|
-
const handleOnLayout = (event: any, optionId: any) => {
|
|
327
|
-
|
|
329
|
+
const handleOnLayout = (event: any, optionId: any, lastMounts: boolean) => {
|
|
330
|
+
_optionLayout = { ..._optionLayout }
|
|
328
331
|
const optionKey = 'id:' + optionId
|
|
329
332
|
_optionLayout[optionKey] = { y: event.nativeEvent.layout?.y }
|
|
330
|
-
|
|
333
|
+
if (lastMounts) {
|
|
334
|
+
setOptionLayout(_optionLayout)
|
|
335
|
+
}
|
|
331
336
|
}
|
|
332
337
|
|
|
333
|
-
const saveErrors =
|
|
334
|
-
orderState.loading ||
|
|
335
|
-
maxProductQuantity === 0 ||
|
|
336
|
-
Object.keys(errors)?.length > 0;
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
const ExtraOptions = ({ eID, options }: any) => (
|
|
340
|
-
<>
|
|
341
|
-
{options.map(({ id, name, respect_to, suboptions }: any) => (
|
|
342
|
-
<React.Fragment key={`cont_key_${id}`}>
|
|
343
|
-
{respect_to == null && suboptions?.length > 0 && (
|
|
344
|
-
<TouchableOpacity
|
|
345
|
-
key={`eopt_key_${id}`}
|
|
346
|
-
onPress={() => {
|
|
347
|
-
setSelectedOpt(id)
|
|
348
|
-
scrollViewRef?.current?.scrollTo && scrollViewRef.current.scrollTo({
|
|
349
|
-
y: optionLayout[`id:${id}`]?.y + editionsLayoutY - 50,
|
|
350
|
-
animated: true
|
|
351
|
-
})
|
|
352
|
-
}}
|
|
353
|
-
style={[
|
|
354
|
-
styles.extraItem,
|
|
355
|
-
{
|
|
356
|
-
borderBottomColor:
|
|
357
|
-
selOpt == id ? theme.colors.textNormal : theme.colors.backgroundPage,
|
|
358
|
-
},
|
|
359
|
-
]}>
|
|
360
|
-
<OText
|
|
361
|
-
color={
|
|
362
|
-
selOpt == id ? theme.colors.textNormal : theme.colors.textSecondary
|
|
363
|
-
}
|
|
364
|
-
size={12}
|
|
365
|
-
weight={selOpt == id ? '600' : 'normal'}
|
|
366
|
-
style={{ maxWidth: 150 }}
|
|
367
|
-
numberOfLines={1}>
|
|
368
|
-
{name}
|
|
369
|
-
</OText>
|
|
370
|
-
</TouchableOpacity>
|
|
371
|
-
)}
|
|
372
|
-
</React.Fragment>
|
|
373
|
-
))}
|
|
374
|
-
</>
|
|
375
|
-
);
|
|
376
|
-
|
|
377
338
|
const handleScroll = ({ nativeEvent: { contentOffset } }: any) => {
|
|
378
339
|
setShowTitle(contentOffset.y > 30)
|
|
379
340
|
}
|
|
@@ -433,90 +394,6 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
433
394
|
}
|
|
434
395
|
}, [product])
|
|
435
396
|
|
|
436
|
-
const ActionButton = () => {
|
|
437
|
-
return (
|
|
438
|
-
<View
|
|
439
|
-
style={{
|
|
440
|
-
width: isHaveWeight ? '100%' : ((isSoldOut || maxProductQuantity <= 0) ? '60%' : '40%'),
|
|
441
|
-
}}>
|
|
442
|
-
{((productCart &&
|
|
443
|
-
auth &&
|
|
444
|
-
orderState.options?.address_id) || (isSoldOut || maxProductQuantity <= 0)) && (
|
|
445
|
-
<OButton
|
|
446
|
-
onClick={() => handleSaveProduct()}
|
|
447
|
-
imgRightSrc=""
|
|
448
|
-
text={`${orderState.loading
|
|
449
|
-
? t('LOADING', 'Loading')
|
|
450
|
-
: (isSoldOut || maxProductQuantity <= 0)
|
|
451
|
-
? t('SOLD_OUT', 'Sold out')
|
|
452
|
-
: editMode
|
|
453
|
-
? t('UPDATE', 'Update')
|
|
454
|
-
: t('ADD', 'Add')
|
|
455
|
-
}`}
|
|
456
|
-
isDisabled={isSoldOut || maxProductQuantity <= 0 || (product?.minimum_per_order && ((productCart?.quantity + productAddedToCartLength) < product?.minimum_per_order)) || (product?.maximum_per_order && ((productCart?.quantity + productAddedToCartLength) > product?.maximum_per_order))}
|
|
457
|
-
textStyle={{
|
|
458
|
-
color: saveErrors || isSoldOut || maxProductQuantity <= 0 ? theme.colors.primary : theme.colors.white,
|
|
459
|
-
fontSize: orderState.loading || editMode ? 10 : 14
|
|
460
|
-
}}
|
|
461
|
-
style={{
|
|
462
|
-
backgroundColor: saveErrors || isSoldOut || maxProductQuantity <= 0 || (product?.minimum_per_order && ((productCart?.quantity + productAddedToCartLength) < product?.minimum_per_order)) || (product?.maximum_per_order && ((productCart?.quantity + productAddedToCartLength) > product?.maximum_per_order)) ? theme.colors.lightGray : theme.colors.primary,
|
|
463
|
-
borderColor: saveErrors || isSoldOut || maxProductQuantity <= 0 || (product?.minimum_per_order && ((productCart?.quantity + productAddedToCartLength) < product?.minimum_per_order)) || (product?.maximum_per_order && ((productCart?.quantity + productAddedToCartLength) > product?.maximum_per_order)) ? theme.colors.white : theme.colors.primary,
|
|
464
|
-
opacity: saveErrors || isSoldOut || maxProductQuantity <= 0 ? 0.3 : 1,
|
|
465
|
-
borderRadius: 7.6,
|
|
466
|
-
height: 44,
|
|
467
|
-
shadowOpacity: 0,
|
|
468
|
-
borderWidth: 1,
|
|
469
|
-
marginTop: isHaveWeight ? 10 : 0
|
|
470
|
-
}}
|
|
471
|
-
/>
|
|
472
|
-
)}
|
|
473
|
-
{auth &&
|
|
474
|
-
!orderState.options?.address_id &&
|
|
475
|
-
(orderState.loading ? (
|
|
476
|
-
<OButton
|
|
477
|
-
isDisabled
|
|
478
|
-
text={t('LOADING', 'Loading')}
|
|
479
|
-
imgRightSrc=""
|
|
480
|
-
textStyle={{ fontSize: 10 }}
|
|
481
|
-
/>
|
|
482
|
-
) : (
|
|
483
|
-
<OButton onClick={navigation.navigate('AddressList')} />
|
|
484
|
-
))}
|
|
485
|
-
{!auth && (
|
|
486
|
-
<OButton
|
|
487
|
-
isDisabled={isSoldOut || maxProductQuantity <= 0}
|
|
488
|
-
onClick={() => handleRedirectLogin()}
|
|
489
|
-
text={
|
|
490
|
-
isSoldOut || maxProductQuantity <= 0
|
|
491
|
-
? t('SOLD_OUT', 'Sold out')
|
|
492
|
-
: t('LOGIN_SIGNUP', 'Login / Sign Up')
|
|
493
|
-
}
|
|
494
|
-
imgRightSrc=""
|
|
495
|
-
textStyle={{ color: theme.colors.primary, fontSize: 13, textAlign: 'center' }}
|
|
496
|
-
style={{
|
|
497
|
-
height: 42,
|
|
498
|
-
borderColor: theme.colors.primary,
|
|
499
|
-
backgroundColor: theme.colors.white,
|
|
500
|
-
paddingLeft: 0,
|
|
501
|
-
paddingRight: 0
|
|
502
|
-
}}
|
|
503
|
-
/>
|
|
504
|
-
)}
|
|
505
|
-
{!auth && guestCheckoutEnabled && orderTypeEnabled && (
|
|
506
|
-
<TouchableOpacity style={{ marginTop: 10 }} onPress={handleUpdateGuest}>
|
|
507
|
-
{actionStatus?.loading ? (
|
|
508
|
-
<Placeholder Animation={Fade}>
|
|
509
|
-
<PlaceholderLine height={20} />
|
|
510
|
-
</Placeholder>
|
|
511
|
-
) : (
|
|
512
|
-
<OText color={theme.colors.primary} size={13} style={{ textAlign: 'center' }}>{t('AS_GUEST_USER', 'As guest user')}</OText>
|
|
513
|
-
)}
|
|
514
|
-
</TouchableOpacity>
|
|
515
|
-
)}
|
|
516
|
-
</View>
|
|
517
|
-
)
|
|
518
|
-
}
|
|
519
|
-
|
|
520
397
|
useEffect(() => {
|
|
521
398
|
const keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', () => {
|
|
522
399
|
scrollViewRef.current.scrollToEnd({ animated: true })
|
|
@@ -532,6 +409,33 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
532
409
|
events.emit('product_viewed', product)
|
|
533
410
|
}, [product?.id, viewedProduct])
|
|
534
411
|
|
|
412
|
+
const actionButtonProps = {
|
|
413
|
+
navigation,
|
|
414
|
+
isHaveWeight,
|
|
415
|
+
isSoldOut,
|
|
416
|
+
maxProductQuantity,
|
|
417
|
+
productCart,
|
|
418
|
+
handleSaveProduct,
|
|
419
|
+
editMode,
|
|
420
|
+
product,
|
|
421
|
+
errors,
|
|
422
|
+
productAddedToCartLength,
|
|
423
|
+
handleRedirectLogin,
|
|
424
|
+
guestCheckoutEnabled,
|
|
425
|
+
orderTypeEnabled,
|
|
426
|
+
handleUpdateGuest,
|
|
427
|
+
actionStatus
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
const extraOptionsProps = {
|
|
431
|
+
setSelectedOpt,
|
|
432
|
+
scrollViewRef,
|
|
433
|
+
optionLayout,
|
|
434
|
+
editionsLayoutY,
|
|
435
|
+
styles,
|
|
436
|
+
selOpt
|
|
437
|
+
}
|
|
438
|
+
|
|
535
439
|
return (
|
|
536
440
|
<SafeAreaView style={{ flex: 1 }}>
|
|
537
441
|
<View style={styles.wrapperNavbar}>
|
|
@@ -637,7 +541,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
637
541
|
<ScrollView
|
|
638
542
|
horizontal
|
|
639
543
|
contentContainerStyle={{
|
|
640
|
-
paddingHorizontal:
|
|
544
|
+
paddingHorizontal: 20,
|
|
641
545
|
paddingVertical: 15
|
|
642
546
|
}}
|
|
643
547
|
>
|
|
@@ -690,7 +594,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
690
594
|
)}
|
|
691
595
|
</WrapHeader>
|
|
692
596
|
<ProductSummary
|
|
693
|
-
ph={
|
|
597
|
+
ph={20}
|
|
694
598
|
onLayout={(event: any) => setSummaryRefHeight(event.nativeEvent.layout?.height)}
|
|
695
599
|
>
|
|
696
600
|
<ProductTitle>
|
|
@@ -824,7 +728,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
824
728
|
</TouchableOpacity>
|
|
825
729
|
)}
|
|
826
730
|
{product?.extras?.map((extra: any) =>
|
|
827
|
-
<ExtraOptions key={extra.id} options={extra.options} />
|
|
731
|
+
<ExtraOptions key={extra.id} options={extra.options} {...extraOptionsProps} />
|
|
828
732
|
)}
|
|
829
733
|
</ExtraOptionWrap>
|
|
830
734
|
)}
|
|
@@ -868,14 +772,14 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
868
772
|
</>
|
|
869
773
|
) : (
|
|
870
774
|
<ProductEditions
|
|
871
|
-
style={{ paddingHorizontal:
|
|
775
|
+
style={{ paddingHorizontal: 20 }}
|
|
872
776
|
onLayout={(event: any) => {
|
|
873
777
|
setEditionsLayoutY(event.nativeEvent.layout?.y)
|
|
874
778
|
}}
|
|
875
779
|
>
|
|
876
780
|
<>
|
|
877
781
|
{product?.ingredients?.length > 0 && (
|
|
878
|
-
<View style={styles.optionContainer} onLayout={(event: any) => handleOnLayout(event, 0)}>
|
|
782
|
+
<View style={styles.optionContainer} onLayout={(event: any) => handleOnLayout(event, 0, true)}>
|
|
879
783
|
<SectionTitle>
|
|
880
784
|
<OText size={16}>
|
|
881
785
|
{t('INGREDIENTS', 'Ingredients')}
|
|
@@ -897,13 +801,13 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
897
801
|
</View>
|
|
898
802
|
)}
|
|
899
803
|
{product?.extras?.sort((a: any, b: any) => a.rank - b.rank).map((extra: any) =>
|
|
900
|
-
extra.options?.sort((a: any, b: any) => a.rank - b.rank).map((option: any) => {
|
|
804
|
+
extra.options?.sort((a: any, b: any) => a.rank - b.rank).map((option: any, i: number) => {
|
|
901
805
|
const currentState =
|
|
902
806
|
productCart.options[`id:${option.id}`] || {};
|
|
903
807
|
return (
|
|
904
808
|
<React.Fragment key={`popt_${option.id}`}>
|
|
905
809
|
{showOption(option) && (
|
|
906
|
-
<View style={styles.optionContainer} onLayout={(event: any) => handleOnLayout(event, option?.id)}>
|
|
810
|
+
<View style={styles.optionContainer} onLayout={(event: any) => handleOnLayout(event, option?.id, extra.options?.length <= i + 2)}>
|
|
907
811
|
<ProductOption
|
|
908
812
|
option={option}
|
|
909
813
|
currentState={currentState}
|
|
@@ -969,6 +873,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
969
873
|
!(productCart && !isSoldOut && maxProductQuantity)
|
|
970
874
|
}
|
|
971
875
|
style={styles.comment}
|
|
876
|
+
forwardRef={commentRef}
|
|
972
877
|
/>
|
|
973
878
|
</ProductComment>
|
|
974
879
|
)}
|
|
@@ -1088,9 +993,9 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
1088
993
|
)}
|
|
1089
994
|
</>
|
|
1090
995
|
)}
|
|
1091
|
-
{!isHaveWeight && <ActionButton />}
|
|
996
|
+
{!isHaveWeight && <ActionButton {...actionButtonProps} />}
|
|
1092
997
|
</View>
|
|
1093
|
-
{isHaveWeight && <ActionButton />}
|
|
998
|
+
{isHaveWeight && <ActionButton {...actionButtonProps} />}
|
|
1094
999
|
</ProductActions>
|
|
1095
1000
|
)}
|
|
1096
1001
|
</SafeAreaView>
|
|
@@ -215,6 +215,11 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
215
215
|
style={pickerStyle}
|
|
216
216
|
useNativeAndroidPickerStyle={false}
|
|
217
217
|
placeholder={{}}
|
|
218
|
+
touchableWrapperProps={{
|
|
219
|
+
style: {
|
|
220
|
+
width: 40,
|
|
221
|
+
}
|
|
222
|
+
}}
|
|
218
223
|
Icon={() => <View style={pickerStyle.icon}><OIcon src={theme.images.general.arrow_down} color={theme.colors.textNormal} width={8} /></View>}
|
|
219
224
|
disabled={orderState.loading}
|
|
220
225
|
/>
|
|
@@ -82,7 +82,7 @@ export const ProductOptionSubOptionUI = (props: any) => {
|
|
|
82
82
|
|
|
83
83
|
return (
|
|
84
84
|
<View>
|
|
85
|
-
<Container onPress={!(option?.with_half_option || option?.allow_suboption_quantity) ? () => handleSuboptionClick() : null}>
|
|
85
|
+
<Container onPress={!((option?.with_half_option || option?.allow_suboption_quantity) && state?.selected) ? () => handleSuboptionClick() : null}>
|
|
86
86
|
<IconControl disabled={disabled} onPress={() => handleSuboptionClick()}>
|
|
87
87
|
{((option?.min === 0 && option?.max === 1) || option?.max > 1) ? (
|
|
88
88
|
state?.selected ? (
|
|
@@ -12,7 +12,7 @@ export const ProfessionalPhoto = styled.ImageBackground`
|
|
|
12
12
|
|
|
13
13
|
export const InfoWrapper = styled.View`
|
|
14
14
|
margin-vertical: 30px;
|
|
15
|
-
padding-horizontal:
|
|
15
|
+
padding-horizontal: 20px;
|
|
16
16
|
`
|
|
17
17
|
|
|
18
18
|
export const Divider = styled.View`
|
|
@@ -22,7 +22,7 @@ export const Divider = styled.View`
|
|
|
22
22
|
`
|
|
23
23
|
|
|
24
24
|
export const ScheduleWrapper = styled.View`
|
|
25
|
-
padding-horizontal:
|
|
25
|
+
padding-horizontal: 20px;
|
|
26
26
|
margin-top: 30px;
|
|
27
27
|
`
|
|
28
28
|
|
|
@@ -43,4 +43,4 @@ export const CalendarWrapper = styled.View`
|
|
|
43
43
|
border-color: ${(props: any) => props.theme.colors.backgroundGray200};
|
|
44
44
|
border-radius: 7.6px;
|
|
45
45
|
padding: 15px;
|
|
46
|
-
`
|
|
46
|
+
`
|
|
@@ -19,7 +19,7 @@ import { useTheme } from 'styled-components/native';
|
|
|
19
19
|
import { OButton, OIcon, OModal, OText } from '../shared'
|
|
20
20
|
import { Placeholder, PlaceholderLine } from 'rn-placeholder'
|
|
21
21
|
import { NotFoundSource } from '../NotFoundSource'
|
|
22
|
-
import { View, StyleSheet, ScrollView, RefreshControl } from 'react-native'
|
|
22
|
+
import { View, StyleSheet, ScrollView, RefreshControl, Platform } from 'react-native'
|
|
23
23
|
import { PromotionParams } from '../../types'
|
|
24
24
|
import { Container } from '../../layouts/Container'
|
|
25
25
|
|
|
@@ -98,8 +98,6 @@ const PromotionsUI = (props: PromotionParams) => {
|
|
|
98
98
|
|
|
99
99
|
return (
|
|
100
100
|
<Container
|
|
101
|
-
noPadding
|
|
102
|
-
pt={20}
|
|
103
101
|
refreshControl={
|
|
104
102
|
<RefreshControl
|
|
105
103
|
refreshing={refreshing}
|
|
@@ -112,7 +110,9 @@ const PromotionsUI = (props: PromotionParams) => {
|
|
|
112
110
|
titleAlign={'center'}
|
|
113
111
|
onActionLeft={() => navigation.goBack()}
|
|
114
112
|
showCall={false}
|
|
115
|
-
|
|
113
|
+
paddingTop={Platform.OS === 'ios' ? 20 : 10}
|
|
114
|
+
style={{ paddingVertical: 0 }}
|
|
115
|
+
btnStyle={{ paddingLeft: 0 }}
|
|
116
116
|
/>
|
|
117
117
|
<PromotionsContainer>
|
|
118
118
|
<SearchBarContainer>
|
|
@@ -11,7 +11,7 @@ export const ProfessionalPhoto = styled.ImageBackground`
|
|
|
11
11
|
`;
|
|
12
12
|
|
|
13
13
|
export const InfoWrapper = styled.View`
|
|
14
|
-
padding-horizontal:
|
|
14
|
+
padding-horizontal: 20px;
|
|
15
15
|
margin-vertical: 30px;
|
|
16
16
|
`
|
|
17
17
|
|
|
@@ -22,7 +22,7 @@ export const Divider = styled.View`
|
|
|
22
22
|
`
|
|
23
23
|
|
|
24
24
|
export const ProfessionalWrapper = styled.View`
|
|
25
|
-
padding-horizontal:
|
|
25
|
+
padding-horizontal: 20px;
|
|
26
26
|
margin-top: 30px;
|
|
27
27
|
`
|
|
28
28
|
|
|
@@ -41,10 +41,10 @@ export const ButtonWrapper = styled.View`
|
|
|
41
41
|
align-items: center;
|
|
42
42
|
flex-direction: row;
|
|
43
43
|
padding-vertical: 13px;
|
|
44
|
-
padding-horizontal:
|
|
44
|
+
padding-horizontal: 20px;
|
|
45
45
|
margin-top: 30px;
|
|
46
46
|
margin-bottom: 40px;
|
|
47
47
|
width: 100%;
|
|
48
48
|
border-top-width: 1px;
|
|
49
49
|
border-top-color: ${(props: any) => props.theme.colors.backgroundGray200};
|
|
50
|
-
`
|
|
50
|
+
`
|