ordering-ui-react-native 0.14.32 → 0.14.33-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 +2 -2
- package/src/components/BusinessItemAccordion/index.tsx +2 -2
- package/src/components/BusinessProductsListing/index.tsx +10 -26
- package/src/components/Cart/index.tsx +136 -62
- package/src/components/Cart/styles.tsx +7 -0
- package/src/components/Checkout/index.tsx +10 -6
- package/src/components/LogoutButton/index.tsx +14 -0
- package/src/components/OrderDetails/index.tsx +102 -34
- package/src/components/OrderDetails/styles.tsx +7 -0
- package/src/components/OrderSummary/index.tsx +142 -58
- package/src/components/OrderSummary/styles.tsx +10 -2
- package/src/components/ProductForm/index.tsx +47 -10
- package/src/components/ProductForm/styles.tsx +1 -1
- package/src/components/SingleProductCard/index.tsx +1 -1
- package/src/components/StripeElementsForm/index.tsx +28 -13
- package/src/components/TaxInformation/index.tsx +58 -26
- package/src/components/UpsellingProducts/index.tsx +13 -31
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/navigators/HomeNavigator.tsx +6 -0
- package/src/pages/ProductDetails.tsx +55 -0
- package/src/types/index.tsx +2 -0
- package/src/types/react-native-color-matrix-image-filters/index.d.ts +1 -0
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/doordash/src/components/ProductForm/index.tsx +41 -2
- package/themes/doordash/src/components/ProductForm/styles.tsx +1 -1
- package/themes/instacart/src/components/ProductForm/index.tsx +40 -1
- package/themes/instacart/src/components/ProductForm/styles.tsx +1 -1
- package/themes/kiosk/src/components/Cart/index.tsx +14 -21
- package/themes/kiosk/src/components/CartItem/index.tsx +9 -7
- package/themes/kiosk/src/components/CustomerName/index.tsx +2 -1
- package/themes/kiosk/src/components/Intro/index.tsx +4 -4
- package/themes/kiosk/src/components/OptionCard/index.tsx +11 -6
- package/themes/kiosk/src/components/PaymentOptions/index.tsx +46 -44
- package/themes/original/index.tsx +4 -0
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -9
- package/themes/original/src/components/BusinessItemAccordion/styles.tsx +3 -2
- package/themes/original/src/components/BusinessPreorder/index.tsx +37 -35
- package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +35 -0
- package/themes/original/src/components/BusinessProductsListing/index.tsx +16 -47
- package/themes/original/src/components/BusinessesListing/index.tsx +100 -75
- package/themes/original/src/components/Cart/index.tsx +10 -31
- package/themes/original/src/components/Checkout/index.tsx +2 -0
- package/themes/original/src/components/Checkout/styles.tsx +1 -0
- package/themes/original/src/components/FacebookLogin/index.tsx +20 -5
- package/themes/original/src/components/Help/index.tsx +1 -1
- package/themes/original/src/components/Home/index.tsx +5 -3
- package/themes/original/src/components/LoginForm/index.tsx +50 -49
- package/themes/original/src/components/MessageListing/index.tsx +4 -2
- package/themes/original/src/components/OrderDetails/index.tsx +3 -1
- package/themes/original/src/components/OrderSummary/index.tsx +11 -30
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +10 -6
- package/themes/original/src/components/PaymentOptionWallet/styles.tsx +1 -0
- package/themes/original/src/components/ProductForm/index.tsx +101 -74
- package/themes/original/src/components/ProductForm/styles.tsx +10 -3
- package/themes/original/src/components/SingleProductCard/index.tsx +21 -11
- package/themes/original/src/components/SingleProductCard/styles.tsx +4 -0
- package/themes/original/src/components/StripeElementsForm/index.tsx +28 -13
- package/themes/original/src/components/UpsellingProducts/index.tsx +85 -83
- package/themes/original/src/types/index.tsx +6 -0
- package/themes/uber-eats/src/components/ProductForm/index.tsx +43 -2
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from 'ordering-components/native';
|
|
8
8
|
import { useTheme } from 'styled-components/native';
|
|
9
9
|
import { SingleProductCardParams } from '../../types';
|
|
10
|
-
import { CardContainer, CardInfo, SoldOut, QuantityContainer } from './styles';
|
|
10
|
+
import { CardContainer, CardInfo, SoldOut, QuantityContainer, PricesContainer } from './styles';
|
|
11
11
|
import { StyleSheet } from 'react-native';
|
|
12
12
|
import { OText, OIcon } from '../shared';
|
|
13
13
|
import FastImage from 'react-native-fast-image'
|
|
@@ -51,6 +51,13 @@ export const SingleProductCard = (props: SingleProductCardParams) => {
|
|
|
51
51
|
textAlign: 'center',
|
|
52
52
|
borderRadius: 25,
|
|
53
53
|
alignItems: 'center'
|
|
54
|
+
},
|
|
55
|
+
regularPriceStyle: {
|
|
56
|
+
fontSize: 12,
|
|
57
|
+
color: '#808080',
|
|
58
|
+
textDecorationLine: 'line-through',
|
|
59
|
+
marginLeft: 7,
|
|
60
|
+
marginRight: 7
|
|
54
61
|
}
|
|
55
62
|
});
|
|
56
63
|
|
|
@@ -97,13 +104,13 @@ export const SingleProductCard = (props: SingleProductCardParams) => {
|
|
|
97
104
|
(isSoldOut || maxProductQuantity <= 0) && styles.soldOutBackgroundStyle,
|
|
98
105
|
]}
|
|
99
106
|
onPress={() => onProductClick?.(product)}>
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
+
{productAddedToCartLength > 0 && (
|
|
108
|
+
<QuantityContainer style={[styles.quantityContainer, {
|
|
109
|
+
transform: [{ translateX: 10 }, { translateY: -10 }],
|
|
110
|
+
}]}>
|
|
111
|
+
<OText size={12} color={theme.colors.white}>{productAddedToCartLength.toString()}</OText>
|
|
112
|
+
</QuantityContainer>
|
|
113
|
+
)}
|
|
107
114
|
<CardInfo>
|
|
108
115
|
<OText
|
|
109
116
|
size={12}
|
|
@@ -113,9 +120,12 @@ export const SingleProductCard = (props: SingleProductCardParams) => {
|
|
|
113
120
|
style={styles.line18}>
|
|
114
121
|
{product?.name}
|
|
115
122
|
</OText>
|
|
116
|
-
<
|
|
117
|
-
{parsePrice(product?.price)}
|
|
118
|
-
|
|
123
|
+
<PricesContainer>
|
|
124
|
+
<OText color={theme.colors.primary}>{parsePrice(product?.price)}</OText>
|
|
125
|
+
{product?.offer_price !== null && product?.in_offer && (
|
|
126
|
+
<OText style={styles.regularPriceStyle}>{parsePrice(product?.offer_price)}</OText>
|
|
127
|
+
)}
|
|
128
|
+
</PricesContainer>
|
|
119
129
|
<OText
|
|
120
130
|
size={10}
|
|
121
131
|
numberOfLines={2}
|
|
@@ -37,19 +37,33 @@ const StripeElementsFormUI = (props: any) => {
|
|
|
37
37
|
const { top, bottom } = useSafeAreaInsets();
|
|
38
38
|
const [isKeyboardShow, setIsKeyboardShow] = useState(false);
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
let billingDetails: any = {}
|
|
41
|
+
|
|
42
|
+
if (user?.name || user?.lastname) {
|
|
43
|
+
if (user?.name) {
|
|
44
|
+
billingDetails.name = user?.name
|
|
45
|
+
}
|
|
46
|
+
if (user?.lastname) {
|
|
47
|
+
billingDetails.name = `${billingDetails?.name} ${user?.lastname}`
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (user?.email) {
|
|
52
|
+
billingDetails.email = user?.email
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (user?.address) {
|
|
56
|
+
billingDetails.addressLine1 = user?.address
|
|
57
|
+
}
|
|
45
58
|
|
|
46
59
|
const createPayMethod = async () => {
|
|
60
|
+
const params: any = { type: 'Card' }
|
|
61
|
+
if (Object.keys(billingDetails).length > 0) {
|
|
62
|
+
params.billingDetails = billingDetails
|
|
63
|
+
}
|
|
47
64
|
try {
|
|
48
65
|
setCreatePmLoading(true)
|
|
49
|
-
const { paymentMethod } = await createPaymentMethod(
|
|
50
|
-
type: 'Card',
|
|
51
|
-
billingDetails,
|
|
52
|
-
});
|
|
66
|
+
const { paymentMethod } = await createPaymentMethod(params);
|
|
53
67
|
|
|
54
68
|
setCreatePmLoading(false)
|
|
55
69
|
handleSource && handleSource({
|
|
@@ -79,11 +93,12 @@ const StripeElementsFormUI = (props: any) => {
|
|
|
79
93
|
createPayMethod();
|
|
80
94
|
return
|
|
81
95
|
}
|
|
96
|
+
const params: any = { type: 'Card' }
|
|
97
|
+
if (Object.keys(billingDetails).length > 0) {
|
|
98
|
+
params.billingDetails = billingDetails
|
|
99
|
+
}
|
|
82
100
|
try {
|
|
83
|
-
const { setupIntent, error } = await confirmSetupIntent(requirements,
|
|
84
|
-
type: 'Card',
|
|
85
|
-
billingDetails,
|
|
86
|
-
});
|
|
101
|
+
const { setupIntent, error } = await confirmSetupIntent(requirements, params);
|
|
87
102
|
|
|
88
103
|
if (setupIntent?.status === 'Succeeded') {
|
|
89
104
|
stripeTokenHandler(setupIntent?.paymentMethodId, user, businessId);
|
|
@@ -4,9 +4,10 @@ import {
|
|
|
4
4
|
UpsellingPage as UpsellingPageController,
|
|
5
5
|
useUtils,
|
|
6
6
|
useLanguage,
|
|
7
|
+
useOrder
|
|
7
8
|
} from 'ordering-components/native'
|
|
8
9
|
import { useTheme } from 'styled-components/native';
|
|
9
|
-
import { OText, OIcon,
|
|
10
|
+
import { OText, OIcon, OBottomPopup, OButton } from '../shared'
|
|
10
11
|
import { UpsellingProductsParams } from '../../types'
|
|
11
12
|
import {
|
|
12
13
|
Container,
|
|
@@ -14,11 +15,9 @@ import {
|
|
|
14
15
|
Item,
|
|
15
16
|
Details,
|
|
16
17
|
AddButton,
|
|
17
|
-
CloseUpselling,
|
|
18
18
|
TopBar,
|
|
19
19
|
TopActions
|
|
20
20
|
} from './styles'
|
|
21
|
-
import { ProductForm } from '../ProductForm';
|
|
22
21
|
import { OrderSummary } from '../OrderSummary';
|
|
23
22
|
import { ScrollView } from 'react-native-gesture-handler';
|
|
24
23
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
@@ -28,18 +27,18 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
|
|
|
28
27
|
isCustomMode,
|
|
29
28
|
upsellingProducts,
|
|
30
29
|
business,
|
|
31
|
-
cart,
|
|
32
30
|
handleUpsellingPage,
|
|
33
31
|
handleCloseUpsellingPage,
|
|
34
32
|
openUpselling,
|
|
35
33
|
canOpenUpselling,
|
|
36
34
|
setCanOpenUpselling,
|
|
37
|
-
isFromCart
|
|
35
|
+
isFromCart,
|
|
36
|
+
onNavigationRedirect,
|
|
37
|
+
onGoBack
|
|
38
38
|
} = props
|
|
39
39
|
|
|
40
40
|
const theme = useTheme();
|
|
41
41
|
|
|
42
|
-
|
|
43
42
|
const styles = StyleSheet.create({
|
|
44
43
|
imageStyle: {
|
|
45
44
|
width: 73,
|
|
@@ -66,14 +65,25 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
|
|
|
66
65
|
}
|
|
67
66
|
})
|
|
68
67
|
|
|
69
|
-
const [actualProduct, setActualProduct] = useState<any>(null)
|
|
70
68
|
const [modalIsOpen, setModalIsOpen] = useState(false)
|
|
69
|
+
const [{ carts }] = useOrder()
|
|
71
70
|
const [{ parsePrice }] = useUtils()
|
|
72
71
|
const [, t] = useLanguage()
|
|
73
72
|
const { bottom } = useSafeAreaInsets()
|
|
74
73
|
|
|
74
|
+
const cart = carts?.[`businessId:${props.businessId}`] ?? {}
|
|
75
|
+
const cartProducts = cart?.products?.length
|
|
76
|
+
? cart?.products.map((product: any) => product.id)
|
|
77
|
+
: []
|
|
78
|
+
|
|
79
|
+
const productsList = !upsellingProducts.loading && !upsellingProducts.error
|
|
80
|
+
? upsellingProducts?.products?.length
|
|
81
|
+
? upsellingProducts?.products.filter((product: any) => !cartProducts.includes(product.id))
|
|
82
|
+
: (props?.products ?? []).filter((product: any) => !cartProducts.includes(product.id)) ?? []
|
|
83
|
+
: []
|
|
84
|
+
|
|
75
85
|
useEffect(() => {
|
|
76
|
-
if (!isCustomMode) {
|
|
86
|
+
if (!isCustomMode && !props.products) {
|
|
77
87
|
if (!upsellingProducts.loading) {
|
|
78
88
|
if (upsellingProducts?.products?.length && !isFromCart) {
|
|
79
89
|
setCanOpenUpselling && setCanOpenUpselling(true)
|
|
@@ -81,25 +91,19 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
|
|
|
81
91
|
handleUpsellingPage && handleUpsellingPage()
|
|
82
92
|
}
|
|
83
93
|
}
|
|
84
|
-
// if ((!upsellingProducts?.products?.length && !upsellingProducts.loading && !canOpenUpselling && openUpselling) ||
|
|
85
|
-
// (!upsellingProducts?.products?.length && !upsellingProducts.loading && openUpselling)) {
|
|
86
|
-
// handleUpsellingPage && handleUpsellingPage()
|
|
87
|
-
// }
|
|
88
94
|
}
|
|
89
95
|
}, [upsellingProducts.loading, upsellingProducts?.products.length])
|
|
90
96
|
|
|
91
97
|
useEffect(() => {
|
|
92
|
-
|
|
98
|
+
Object.keys(cart).length === 0 && onNavigationRedirect && onNavigationRedirect('MyOrders')
|
|
93
99
|
}, [cart])
|
|
94
100
|
|
|
95
101
|
const handleFormProduct = (product: any) => {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
setActualProduct(null)
|
|
102
|
-
setModalIsOpen(false)
|
|
102
|
+
onNavigationRedirect && onNavigationRedirect('ProductDetails', {
|
|
103
|
+
product: product,
|
|
104
|
+
businessId: product?.api?.businessId,
|
|
105
|
+
businessSlug: business.slug,
|
|
106
|
+
})
|
|
103
107
|
}
|
|
104
108
|
|
|
105
109
|
const UpsellingLayout = () => {
|
|
@@ -114,7 +118,7 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
|
|
|
114
118
|
!upsellingProducts.loading && (
|
|
115
119
|
<>
|
|
116
120
|
{
|
|
117
|
-
!upsellingProducts.error ?
|
|
121
|
+
!upsellingProducts.error ? productsList.map((product: any) => (
|
|
118
122
|
<Item key={product.id}>
|
|
119
123
|
<View style={{ flexBasis: '57%' }}>
|
|
120
124
|
<Details>
|
|
@@ -125,7 +129,7 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
|
|
|
125
129
|
<OText size={10} color={theme.colors.primary}>{t('ADD', 'Add')}</OText>
|
|
126
130
|
</AddButton>
|
|
127
131
|
</View>
|
|
128
|
-
<View
|
|
132
|
+
<View>
|
|
129
133
|
<OIcon url={product.images} style={styles.imageStyle} />
|
|
130
134
|
</View>
|
|
131
135
|
</Item>
|
|
@@ -143,75 +147,73 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
|
|
|
143
147
|
)
|
|
144
148
|
}
|
|
145
149
|
|
|
150
|
+
const UpsellingContent = () => {
|
|
151
|
+
return (
|
|
152
|
+
<>
|
|
153
|
+
<TopBar style={{ paddingTop: Platform.OS == 'ios' ? 10 : 30 }}>
|
|
154
|
+
<TopActions onPress={() => onGoBack()}>
|
|
155
|
+
<OIcon src={theme.images.general.arrow_left} width={15} />
|
|
156
|
+
</TopActions>
|
|
157
|
+
<TopActions style={styles.cancelBtn} onPress={() => handleUpsellingPage()}>
|
|
158
|
+
<OText size={12} color={theme.colors.textSecondary}>{t('CANCEL', 'Cancel')}</OText>
|
|
159
|
+
</TopActions>
|
|
160
|
+
</TopBar>
|
|
161
|
+
<ScrollView style={{ marginBottom: props.isPage ? 40 : bottom + (Platform.OS == 'ios' ? 96 : 130) }} showsVerticalScrollIndicator={false}>
|
|
162
|
+
{productsList.length > 0 &&
|
|
163
|
+
<View style={{ paddingHorizontal: 40, overflow: 'visible' }}>
|
|
164
|
+
<OText size={16} lineHeight={24} weight={'500'}>{t('WANT_SOMETHING_ELSE', 'Do you want something else?')}</OText>
|
|
165
|
+
<UpsellingLayout />
|
|
166
|
+
</View>
|
|
167
|
+
}
|
|
168
|
+
<View style={{ paddingHorizontal: 40 }}>
|
|
169
|
+
<OText size={20} lineHeight={30} weight={600} style={{ marginTop: 10, marginBottom: 17 }}>{t('YOUR_CART', 'Your cart')}</OText>
|
|
170
|
+
<OrderSummary
|
|
171
|
+
cart={cart}
|
|
172
|
+
isCartPending={cart?.status === 2}
|
|
173
|
+
onNavigationRedirect={onNavigationRedirect}
|
|
174
|
+
/>
|
|
175
|
+
</View>
|
|
176
|
+
</ScrollView>
|
|
177
|
+
<View
|
|
178
|
+
style={{
|
|
179
|
+
alignItems: 'center',
|
|
180
|
+
bottom: props.isPage ? 20 : Platform.OS === 'ios' ? bottom + 59 : bottom + 125
|
|
181
|
+
}}
|
|
182
|
+
>
|
|
183
|
+
<OButton
|
|
184
|
+
imgRightSrc=''
|
|
185
|
+
text={t('CHECKOUT', 'Checkout')}
|
|
186
|
+
style={{...styles.closeUpsellingButton}}
|
|
187
|
+
textStyle={{ color: theme.colors.white, fontSize: 14 }}
|
|
188
|
+
onClick={() => handleUpsellingPage()}
|
|
189
|
+
/>
|
|
190
|
+
</View>
|
|
191
|
+
</>
|
|
192
|
+
)
|
|
193
|
+
}
|
|
194
|
+
|
|
146
195
|
return (
|
|
147
196
|
<>
|
|
148
197
|
{isCustomMode ? (
|
|
149
198
|
<UpsellingLayout />
|
|
150
199
|
) : (
|
|
151
200
|
<>
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
<OText size={12} color={theme.colors.textSecondary}>{t('CANCEL', 'Cancel')}</OText>
|
|
167
|
-
</TopActions>
|
|
168
|
-
</TopBar>
|
|
169
|
-
<ScrollView style={{ marginBottom: bottom + (Platform.OS == 'ios' ? 96 : 130) }} showsVerticalScrollIndicator={false}>
|
|
170
|
-
{upsellingProducts?.products?.length > 0 &&
|
|
171
|
-
<View style={{ paddingHorizontal: 40, overflow: 'visible' }}>
|
|
172
|
-
<OText size={16} lineHeight={24} weight={'500'}>{t('WANT_SOMETHING_ELSE', 'Do you want something else?')}</OText>
|
|
173
|
-
<UpsellingLayout />
|
|
174
|
-
</View>
|
|
175
|
-
}
|
|
176
|
-
<View style={{ paddingHorizontal: 40 }}>
|
|
177
|
-
<OText size={20} lineHeight={30} weight={600} style={{ marginTop: 10, marginBottom: 17 }}>{t('YOUR_CART', 'Your cart')}</OText>
|
|
178
|
-
<OrderSummary
|
|
179
|
-
cart={cart}
|
|
180
|
-
isCartPending={cart?.status === 2}
|
|
181
|
-
/>
|
|
182
|
-
</View>
|
|
183
|
-
</ScrollView>
|
|
184
|
-
<View style={{alignItems: 'center', bottom: Platform.OS === 'ios' ? bottom + 59 : bottom + 125}}>
|
|
185
|
-
<OButton
|
|
186
|
-
imgRightSrc=''
|
|
187
|
-
text={t('CHECKOUT', 'Checkout')}
|
|
188
|
-
style={{...styles.closeUpsellingButton}}
|
|
189
|
-
textStyle={{ color: theme.colors.white, fontSize: 14 }}
|
|
190
|
-
onClick={() => handleUpsellingPage()}
|
|
191
|
-
/>
|
|
192
|
-
</View>
|
|
193
|
-
</OBottomPopup>
|
|
194
|
-
)}
|
|
195
|
-
</>
|
|
196
|
-
)}
|
|
201
|
+
{props.isPage ? (
|
|
202
|
+
<UpsellingContent />
|
|
203
|
+
) : (
|
|
204
|
+
canOpenUpselling && !modalIsOpen && (
|
|
205
|
+
<OBottomPopup
|
|
206
|
+
title={''}
|
|
207
|
+
open={openUpselling}
|
|
208
|
+
onClose={() => handleUpsellingPage()}
|
|
209
|
+
isStatusBar
|
|
210
|
+
>
|
|
211
|
+
<UpsellingContent />
|
|
212
|
+
</OBottomPopup>
|
|
213
|
+
)
|
|
214
|
+
)}
|
|
197
215
|
</>
|
|
198
216
|
)}
|
|
199
|
-
<OModal
|
|
200
|
-
open={modalIsOpen}
|
|
201
|
-
onClose={() => setModalIsOpen(false)}
|
|
202
|
-
entireModal
|
|
203
|
-
customClose
|
|
204
|
-
>
|
|
205
|
-
{actualProduct && (
|
|
206
|
-
<ProductForm
|
|
207
|
-
product={actualProduct}
|
|
208
|
-
businessId={actualProduct?.api?.businessId}
|
|
209
|
-
businessSlug={business.slug}
|
|
210
|
-
onSave={() => handleSaveProduct()}
|
|
211
|
-
onClose={() => setModalIsOpen(false)}
|
|
212
|
-
/>
|
|
213
|
-
)}
|
|
214
|
-
</OModal>
|
|
215
217
|
</>
|
|
216
218
|
)
|
|
217
219
|
}
|
|
@@ -253,6 +253,7 @@ export interface NotFoundSourceParams {
|
|
|
253
253
|
}
|
|
254
254
|
export interface OrdersOptionParams {
|
|
255
255
|
orderList?: any,
|
|
256
|
+
franchiseId?: any,
|
|
256
257
|
activeOrders?: boolean,
|
|
257
258
|
pagination?: any,
|
|
258
259
|
titleContent?: string,
|
|
@@ -438,6 +439,10 @@ export interface UpsellingProductsParams {
|
|
|
438
439
|
cart?: any;
|
|
439
440
|
handleCloseUpsellingPage: () => void;
|
|
440
441
|
isFromCart?: boolean;
|
|
442
|
+
isPage?: boolean;
|
|
443
|
+
products?: any;
|
|
444
|
+
onNavigationRedirect?: any;
|
|
445
|
+
onGoBack?: any;
|
|
441
446
|
}
|
|
442
447
|
|
|
443
448
|
export interface GoogleMapsParams {
|
|
@@ -478,4 +483,5 @@ export interface HelpAccountAndPaymentParams {
|
|
|
478
483
|
|
|
479
484
|
export interface MessageListingParams {
|
|
480
485
|
navigation: any;
|
|
486
|
+
franchiseId?: any;
|
|
481
487
|
}
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
WrapperArrowIcon
|
|
30
30
|
|
|
31
31
|
} from './styles'
|
|
32
|
-
import { OButton, OInput, OText } from '../shared'
|
|
32
|
+
import { OButton, OInput, OText, OIcon } from '../shared'
|
|
33
33
|
import { ProductOptionSubOption } from '../ProductOptionSubOption'
|
|
34
34
|
import { NotFoundSource } from '../NotFoundSource'
|
|
35
35
|
import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder'
|
|
@@ -119,10 +119,24 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
119
119
|
backgroundColor: theme.colors.lightGray,
|
|
120
120
|
padding: 2,
|
|
121
121
|
borderRadius: 20
|
|
122
|
+
},
|
|
123
|
+
productTagWrapper: {
|
|
124
|
+
flexDirection: 'row',
|
|
125
|
+
alignItems: 'center'
|
|
126
|
+
},
|
|
127
|
+
productTagImageStyle: {
|
|
128
|
+
width: 32,
|
|
129
|
+
height: 32,
|
|
130
|
+
borderRadius: 8,
|
|
131
|
+
resizeMode: 'cover'
|
|
132
|
+
},
|
|
133
|
+
productTagNameStyle: {
|
|
134
|
+
paddingHorizontal: 6,
|
|
135
|
+
marginRight: 5
|
|
122
136
|
}
|
|
123
137
|
})
|
|
124
138
|
|
|
125
|
-
const [{ parsePrice }] = useUtils()
|
|
139
|
+
const [{ optimizeImage, parsePrice }] = useUtils()
|
|
126
140
|
const [, t] = useLanguage()
|
|
127
141
|
const [orderState] = useOrder()
|
|
128
142
|
const [{ auth }] = useSession()
|
|
@@ -242,6 +256,33 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
242
256
|
<OText color={theme.colors.gray} style={{ textAlign: 'left', marginBottom: 10 }}>{product?.description || productCart?.description}</OText>
|
|
243
257
|
</ProductDescription>
|
|
244
258
|
)}
|
|
259
|
+
<View style={{ marginHorizontal: 30 }}>
|
|
260
|
+
<ScrollView
|
|
261
|
+
horizontal
|
|
262
|
+
showsHorizontalScrollIndicator={false}
|
|
263
|
+
contentContainerStyle={{ paddingBottom: 20 }}
|
|
264
|
+
>
|
|
265
|
+
{product?.tags?.map((tag: any) => (
|
|
266
|
+
<View
|
|
267
|
+
key={tag.id}
|
|
268
|
+
style={styles.productTagWrapper}
|
|
269
|
+
>
|
|
270
|
+
{tag?.image ? (
|
|
271
|
+
<OIcon
|
|
272
|
+
url={optimizeImage(tag?.image, 'h_40,c_limit')}
|
|
273
|
+
style={styles.productTagImageStyle}
|
|
274
|
+
/>
|
|
275
|
+
) : (
|
|
276
|
+
<OIcon
|
|
277
|
+
src={theme.images?.dummies?.product}
|
|
278
|
+
style={styles.productTagImageStyle}
|
|
279
|
+
/>
|
|
280
|
+
)}
|
|
281
|
+
<OText size={14} style={styles.productTagNameStyle}>{tag.name}</OText>
|
|
282
|
+
</View>
|
|
283
|
+
))}
|
|
284
|
+
</ScrollView>
|
|
285
|
+
</View>
|
|
245
286
|
{loading && !product ? (
|
|
246
287
|
<>
|
|
247
288
|
{[...Array(2)].map((item, i) => (
|