ordering-ui-react-native 0.14.30 → 0.14.32-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/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 -34
- package/themes/original/src/components/BusinessProductsList/index.tsx +3 -3
- 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/DriverTips/index.tsx +3 -3
- package/themes/original/src/components/DriverTips/styles.tsx +5 -5
- 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 +113 -88
- package/themes/original/src/components/ProductForm/styles.tsx +10 -3
- package/themes/original/src/components/ProductItemAccordion/index.tsx +2 -2
- package/themes/original/src/components/SingleProductCard/index.tsx +22 -13
- package/themes/original/src/components/SingleProductCard/styles.tsx +6 -0
- package/themes/original/src/components/UpsellingProducts/index.tsx +85 -83
- package/themes/original/src/types/index.tsx +7 -1
- package/themes/uber-eats/src/components/ProductForm/index.tsx +43 -2
|
@@ -5,13 +5,20 @@ export const WrapHeader = styled.View`
|
|
|
5
5
|
z-index: 1;
|
|
6
6
|
`
|
|
7
7
|
|
|
8
|
+
export const TopActions = styled.TouchableOpacity`
|
|
9
|
+
height: 44px;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
padding-horizontal: 30px;
|
|
12
|
+
`;
|
|
13
|
+
|
|
8
14
|
export const TopHeader = styled.View`
|
|
9
15
|
width: 100%;
|
|
10
16
|
flex-direction: row;
|
|
11
17
|
align-items: center;
|
|
12
18
|
justify-content: space-between;
|
|
13
19
|
z-index: 1;
|
|
14
|
-
|
|
20
|
+
height: 60px;
|
|
21
|
+
min-height: 60px;
|
|
15
22
|
`
|
|
16
23
|
|
|
17
24
|
export const ProductHeader = styled.ImageBackground`
|
|
@@ -37,7 +44,7 @@ export const ProductTitle = styled.View`
|
|
|
37
44
|
`
|
|
38
45
|
|
|
39
46
|
export const ProductDescription = styled.View`
|
|
40
|
-
margin-bottom:
|
|
47
|
+
margin-bottom: 20px;
|
|
41
48
|
`
|
|
42
49
|
|
|
43
50
|
export const ProductEditions = styled.View`
|
|
@@ -89,4 +96,4 @@ export const WeightUnitItem = styled.View`
|
|
|
89
96
|
${({ active }: any) => active && css`
|
|
90
97
|
background-color: ${(props: any) => props.theme.colors.primary}20;
|
|
91
98
|
`}
|
|
92
|
-
`
|
|
99
|
+
`
|
|
@@ -212,8 +212,8 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
212
212
|
</View>
|
|
213
213
|
{((isCartProduct && !isCartPending && product?.valid_menu && !product?.valid_quantity) ||
|
|
214
214
|
(!product?.valid_menu && isCartProduct && !isCartPending)) && (
|
|
215
|
-
<View style={{ alignItems: 'flex-end', width: '100%' }}>
|
|
216
|
-
<OText size={14} color={theme.colors.red} style={{ textAlign: 'right',
|
|
215
|
+
<View style={{ alignItems: 'flex-end', width: '100%', }}>
|
|
216
|
+
<OText size={14} color={theme.colors.red} style={{ textAlign: 'right', marginTop: 5 }}>
|
|
217
217
|
{t('NOT_AVAILABLE', 'Not available')}
|
|
218
218
|
</OText>
|
|
219
219
|
</View>
|
|
@@ -7,13 +7,13 @@ 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'
|
|
14
14
|
|
|
15
15
|
export const SingleProductCard = (props: SingleProductCardParams) => {
|
|
16
|
-
const { businessId, product, isSoldOut, onProductClick,
|
|
16
|
+
const { businessId, product, isSoldOut, onProductClick, productAddedToCartLength } = props;
|
|
17
17
|
|
|
18
18
|
const theme = useTheme();
|
|
19
19
|
|
|
@@ -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
|
|
|
@@ -90,7 +97,6 @@ export const SingleProductCard = (props: SingleProductCardParams) => {
|
|
|
90
97
|
maxCartProductConfig,
|
|
91
98
|
maxCartProductInventory,
|
|
92
99
|
);
|
|
93
|
-
|
|
94
100
|
return (
|
|
95
101
|
<CardContainer
|
|
96
102
|
style={[
|
|
@@ -98,13 +104,13 @@ export const SingleProductCard = (props: SingleProductCardParams) => {
|
|
|
98
104
|
(isSoldOut || maxProductQuantity <= 0) && styles.soldOutBackgroundStyle,
|
|
99
105
|
]}
|
|
100
106
|
onPress={() => onProductClick?.(product)}>
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
+
)}
|
|
108
114
|
<CardInfo>
|
|
109
115
|
<OText
|
|
110
116
|
size={12}
|
|
@@ -114,9 +120,12 @@ export const SingleProductCard = (props: SingleProductCardParams) => {
|
|
|
114
120
|
style={styles.line18}>
|
|
115
121
|
{product?.name}
|
|
116
122
|
</OText>
|
|
117
|
-
<
|
|
118
|
-
{parsePrice(product?.price)}
|
|
119
|
-
|
|
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>
|
|
120
129
|
<OText
|
|
121
130
|
size={10}
|
|
122
131
|
numberOfLines={2}
|
|
@@ -24,4 +24,10 @@ export const SoldOut = styled.View`
|
|
|
24
24
|
|
|
25
25
|
export const QuantityContainer = styled.View`
|
|
26
26
|
background: ${({ theme } : any) => theme.colors.primary};
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
`
|
|
30
|
+
export const PricesContainer = styled.View`
|
|
31
|
+
flex-direction: row;
|
|
32
|
+
align-items: center;
|
|
27
33
|
`
|
|
@@ -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
|
}
|
|
@@ -221,7 +221,7 @@ export interface SingleProductCardParams {
|
|
|
221
221
|
product: any;
|
|
222
222
|
isSoldOut: boolean;
|
|
223
223
|
onProductClick: any;
|
|
224
|
-
|
|
224
|
+
productAddedToCartLength: number
|
|
225
225
|
}
|
|
226
226
|
export interface BusinessInformationParams {
|
|
227
227
|
navigation?: any,
|
|
@@ -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) => (
|