ordering-ui-react-native 0.14.28 → 0.14.30-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 -3
- package/src/components/ProductForm/index.tsx +27 -19
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessProductsList/styles.tsx +1 -1
- package/themes/instacart/src/components/SingleProductCard/index.tsx +19 -24
- package/themes/instacart/src/components/SingleProductCard/styles.tsx +6 -4
- package/themes/original/index.tsx +0 -4
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +31 -50
- package/themes/original/src/components/BusinessItemAccordion/styles.tsx +0 -7
- package/themes/original/src/components/BusinessProductsList/index.tsx +3 -3
- package/themes/original/src/components/BusinessesListing/index.tsx +19 -25
- package/themes/original/src/components/Cart/index.tsx +9 -29
- package/themes/original/src/components/CartContent/index.tsx +0 -1
- package/themes/original/src/components/Checkout/index.tsx +4 -15
- package/themes/original/src/components/Checkout/styles.tsx +1 -5
- package/themes/original/src/components/FacebookLogin/index.tsx +20 -5
- package/themes/original/src/components/Help/index.tsx +2 -2
- package/themes/original/src/components/Home/index.tsx +5 -3
- package/themes/original/src/components/OrderDetails/index.tsx +3 -55
- package/themes/original/src/components/OrderProgress/index.tsx +2 -2
- package/themes/original/src/components/OrderSummary/index.tsx +3 -21
- package/themes/original/src/components/ProductForm/index.tsx +57 -41
- package/themes/original/src/components/ProductIngredient/index.tsx +4 -5
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +9 -9
- package/themes/original/src/components/UserProfile/index.tsx +0 -5
- package/themes/original/src/types/index.tsx +2 -4
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +0 -163
- package/themes/original/src/components/PaymentOptionWallet/styles.tsx +0 -38
- package/themes/original/src/components/WalletTransactionItem/index.tsx +0 -68
- package/themes/original/src/components/WalletTransactionItem/styles.tsx +0 -37
- package/themes/original/src/components/Wallets/index.tsx +0 -204
- package/themes/original/src/components/Wallets/styles.tsx +0 -43
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-react-native",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.30-release",
|
|
4
4
|
"description": "Reusable components made in react native",
|
|
5
5
|
"main": "src/index.tsx",
|
|
6
6
|
"author": "ordering.inc",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@types/styled-components": "^5.1.3",
|
|
56
56
|
"axios": "^0.21.0",
|
|
57
57
|
"moment": "^2.29.1",
|
|
58
|
-
"ordering-components": "github:Ordering-Inc/ordering-components#
|
|
58
|
+
"ordering-components": "github:Ordering-Inc/ordering-components#release",
|
|
59
59
|
"patch-package": "^6.4.7",
|
|
60
60
|
"postinstall-postinstall": "^2.1.0",
|
|
61
61
|
"prop-types": "^15.7.2",
|
|
@@ -70,7 +70,6 @@
|
|
|
70
70
|
"react-native-bootsplash": "^3.2.3",
|
|
71
71
|
"react-native-calendar-picker": "^7.1.2",
|
|
72
72
|
"react-native-calendar-strip": "^2.2.5",
|
|
73
|
-
"react-native-color-matrix-image-filters": "^5.2.10",
|
|
74
73
|
"react-native-country-picker-modal": "^2.0.0",
|
|
75
74
|
"react-native-credit-card-input": "^0.4.1",
|
|
76
75
|
"react-native-document-picker": "^5.2.0",
|
|
@@ -132,7 +132,18 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
132
132
|
) : (
|
|
133
133
|
<>
|
|
134
134
|
<View style={{ flexDirection: 'column', width: '100%' }}>
|
|
135
|
-
<
|
|
135
|
+
<View style={{ flexDirection: 'row', marginTop: 15 }}>
|
|
136
|
+
<OText size={20} style={{ flex: I18nManager.isRTL ? 0 : 1, marginBottom: 10 }}>{product?.name || productCart.name}{' '}</OText>
|
|
137
|
+
{product?.calories && (
|
|
138
|
+
<OText size={16} style={styles.caloriesStyle}>{product?.calories} cal</OText>
|
|
139
|
+
)}
|
|
140
|
+
</View>
|
|
141
|
+
<View style={{ flexDirection: 'row', marginBottom: 10 }}>
|
|
142
|
+
<OText size={16} style={{ flex: I18nManager.isRTL ? 1 : 0 }} color={theme.colors.primary}>{productCart.price ? parsePrice(productCart.price) : ''}</OText>
|
|
143
|
+
{product?.offer_price && (
|
|
144
|
+
<OText style={styles.regularPriceStyle}>{parsePrice(product?.offer_price)}</OText>
|
|
145
|
+
)}
|
|
146
|
+
</View>
|
|
136
147
|
{(product?.estimated_person || (product?.sku && product?.sku !== '-1' && product?.sku !== '1')) && (
|
|
137
148
|
<OText size={14} style={{ flex: I18nManager.isRTL ? 1 : 0, marginBottom: 10 }} color={'#909BA9'}>
|
|
138
149
|
{
|
|
@@ -147,12 +158,6 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
147
158
|
}
|
|
148
159
|
</OText>
|
|
149
160
|
)}
|
|
150
|
-
<View style={{ flexDirection: 'row', marginBottom: 10}}>
|
|
151
|
-
<OText size={16} style={{ flex: I18nManager.isRTL ? 1 : 0 }} color={theme.colors.primary}>{productCart.price ? parsePrice(productCart.price) : ''}</OText>
|
|
152
|
-
{product?.offer_price && (
|
|
153
|
-
<OText style={styles.regularPriceStyle}>{parsePrice(product?.offer_price)}</OText>
|
|
154
|
-
)}
|
|
155
|
-
</View>
|
|
156
161
|
</View>
|
|
157
162
|
</>
|
|
158
163
|
)}
|
|
@@ -162,17 +167,17 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
162
167
|
</ProductDescription>
|
|
163
168
|
{loading && !product ? (
|
|
164
169
|
<>
|
|
165
|
-
{[...Array(2)].map((item,i) => (
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
170
|
+
{[...Array(2)].map((item, i) => (
|
|
171
|
+
<Placeholder key={i} style={{ marginBottom: 20 }} Animation={Fade}>
|
|
172
|
+
<PlaceholderLine height={40} style={{ flex: 1, marginTop: 10 }} />
|
|
173
|
+
{[...Array(3)].map((item, i) => (
|
|
174
|
+
<View key={i} style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
|
|
175
|
+
<PlaceholderLine height={30} width={10} style={{ marginBottom: 20 }} />
|
|
176
|
+
<PlaceholderLine height={30} width={50} style={{ marginBottom: 20 }} />
|
|
177
|
+
<PlaceholderLine height={30} width={30} style={{ marginBottom: 20 }} />
|
|
178
|
+
</View>
|
|
179
|
+
))}
|
|
180
|
+
</Placeholder>
|
|
176
181
|
))}
|
|
177
182
|
</>
|
|
178
183
|
) : (
|
|
@@ -221,7 +226,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
221
226
|
state={currentState}
|
|
222
227
|
disabled={isSoldOut || maxProductQuantity <= 0}
|
|
223
228
|
/>
|
|
224
|
-
): null
|
|
229
|
+
) : null
|
|
225
230
|
})
|
|
226
231
|
}
|
|
227
232
|
</WrapperSubOption>
|
|
@@ -383,6 +388,9 @@ const styles = StyleSheet.create({
|
|
|
383
388
|
textDecorationLine: 'line-through',
|
|
384
389
|
marginLeft: 7,
|
|
385
390
|
marginRight: 7
|
|
391
|
+
},
|
|
392
|
+
caloriesStyle: {
|
|
393
|
+
color: '#808080'
|
|
386
394
|
}
|
|
387
395
|
})
|
|
388
396
|
|
|
@@ -2,7 +2,7 @@ import styled from 'styled-components/native';
|
|
|
2
2
|
|
|
3
3
|
export const Container = styled.View`
|
|
4
4
|
width: 100%;
|
|
5
|
-
padding: 0
|
|
5
|
+
padding: 0 30px;
|
|
6
6
|
`
|
|
7
7
|
|
|
8
8
|
export const CountDownContainer = styled.View`
|
|
@@ -20,7 +20,6 @@ export const ResendSection = styled.View`
|
|
|
20
20
|
display: flex;
|
|
21
21
|
flex-direction: row;
|
|
22
22
|
justify-content: center;
|
|
23
|
-
flex-wrap: wrap;
|
|
24
23
|
`
|
|
25
24
|
|
|
26
25
|
export const WrappCountdown = styled.View`
|
|
@@ -410,8 +410,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
410
410
|
textInputProps={{
|
|
411
411
|
returnKeyType: 'next',
|
|
412
412
|
onSubmitEditing: () => inputRef?.current?.focus?.(),
|
|
413
|
-
style: { borderWidth: 0, fontSize: 12 }
|
|
414
|
-
maxLength: 10
|
|
413
|
+
style: { borderWidth: 0, fontSize: 12 }
|
|
415
414
|
}}
|
|
416
415
|
textWrapStyle={{ borderColor: theme.colors.clear, borderWidth: 0, height: 40, paddingStart: 0 }}
|
|
417
416
|
/>
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
CardInfo,
|
|
7
7
|
SoldOut
|
|
8
8
|
} from './styles'
|
|
9
|
-
import { StyleSheet, TouchableOpacity, Dimensions
|
|
9
|
+
import { StyleSheet, TouchableOpacity, Dimensions } from 'react-native'
|
|
10
10
|
import { OText, OIcon } from '../shared'
|
|
11
11
|
import { useTheme } from 'styled-components/native'
|
|
12
12
|
|
|
@@ -23,7 +23,11 @@ export const SingleProductCard = (props: SingleProductCardParams) => {
|
|
|
23
23
|
|
|
24
24
|
const styles = StyleSheet.create({
|
|
25
25
|
container: {
|
|
26
|
-
width: (windowWidth - 80) / 2
|
|
26
|
+
width: (windowWidth - 80) / 2,
|
|
27
|
+
height: (windowWidth - 80) / 2 + 40
|
|
28
|
+
},
|
|
29
|
+
textStyle: {
|
|
30
|
+
flex: 1,
|
|
27
31
|
},
|
|
28
32
|
soldOutTextStyle : {
|
|
29
33
|
textTransform: 'capitalize',
|
|
@@ -31,14 +35,9 @@ export const SingleProductCard = (props: SingleProductCardParams) => {
|
|
|
31
35
|
fontSize: 12,
|
|
32
36
|
lineHeight: 18
|
|
33
37
|
},
|
|
34
|
-
|
|
38
|
+
productStyle: {
|
|
35
39
|
width: (windowWidth - 160) / 2,
|
|
36
40
|
height: (windowWidth - 160) / 2,
|
|
37
|
-
position: 'relative'
|
|
38
|
-
},
|
|
39
|
-
productStyle: {
|
|
40
|
-
width: '100%',
|
|
41
|
-
height: '100%',
|
|
42
41
|
borderRadius: 3,
|
|
43
42
|
marginTop: 5
|
|
44
43
|
},
|
|
@@ -75,30 +74,26 @@ export const SingleProductCard = (props: SingleProductCardParams) => {
|
|
|
75
74
|
onPress={() => onProductClick?.(product)}
|
|
76
75
|
activeOpacity={0.8}
|
|
77
76
|
>
|
|
78
|
-
<
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
src={!product?.images && theme.images.dummies.product}
|
|
84
|
-
style={{...styles.productStyle, opacity: (isSoldOut || maxProductQuantity <= 0) ? 0.4 : 1}}
|
|
85
|
-
/>
|
|
86
|
-
{(isSoldOut || maxProductQuantity <= 0) && (
|
|
87
|
-
<SoldOut>
|
|
88
|
-
<OText size={10} style={styles.soldOutTextStyle}>{t('SOLD_OUT', 'SOLD OUT')}</OText>
|
|
89
|
-
</SoldOut>
|
|
90
|
-
)}
|
|
91
|
-
</View>
|
|
77
|
+
<OIcon
|
|
78
|
+
url={optimizeImage(product?.images, 'h_200,c_limit')}
|
|
79
|
+
src={!product?.images && theme.images.dummies.product}
|
|
80
|
+
style={{...styles.productStyle, opacity: (isSoldOut || maxProductQuantity <= 0) ? 0.4 : 1}}
|
|
81
|
+
/>
|
|
92
82
|
<CardInfo>
|
|
93
83
|
<OText color={theme.colors.textPrimary} style={{...theme.labels.normal, marginTop: 9}}>{parsePrice(product?.price)}</OText>
|
|
94
|
-
<OText numberOfLines={1} ellipsizeMode='tail' style={{...theme.labels.small}}>{product?.name}</OText>
|
|
95
|
-
<OText color={theme.colors.textSecondary} size={9} numberOfLines={2} ellipsizeMode='tail' style={{...theme.labels.small}}>{product?.description}</OText>
|
|
84
|
+
<OText numberOfLines={1} ellipsizeMode='tail' style={{...styles.textStyle, ...theme.labels.small}}>{product?.name}</OText>
|
|
85
|
+
<OText color={theme.colors.textSecondary} size={9} numberOfLines={2} ellipsizeMode='tail' style={{...styles.textStyle, ...theme.labels.small}}>{product?.description}</OText>
|
|
96
86
|
</CardInfo>
|
|
97
87
|
|
|
98
88
|
<TouchableOpacity style={styles.addBtn} onPress={() => onProductClick?.(product)} activeOpacity={0.7}>
|
|
99
89
|
<OIcon src={theme.images.general.plus_circle} />
|
|
100
90
|
</TouchableOpacity>
|
|
101
91
|
|
|
92
|
+
{(isSoldOut || maxProductQuantity <= 0) && (
|
|
93
|
+
<SoldOut>
|
|
94
|
+
<OText size={10} style={styles.soldOutTextStyle}>{t('SOLD_OUT', 'SOLD OUT')}</OText>
|
|
95
|
+
</SoldOut>
|
|
96
|
+
)}
|
|
102
97
|
</CardContainer>
|
|
103
98
|
)
|
|
104
99
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import styled from 'styled-components/native'
|
|
2
2
|
|
|
3
3
|
export const CardContainer = styled.TouchableOpacity`
|
|
4
|
-
flex-
|
|
4
|
+
/* flex-grow: 1; */
|
|
5
|
+
align-items: flex-start;
|
|
5
6
|
padding: 10px;
|
|
6
7
|
position: relative;
|
|
8
|
+
/* margin-end: 10px; */
|
|
9
|
+
border-radius: 3px;
|
|
7
10
|
`
|
|
8
11
|
export const CardInfo = styled.View`
|
|
9
12
|
flex: 1;
|
|
@@ -13,7 +16,6 @@ export const SoldOut = styled.View`
|
|
|
13
16
|
position: absolute;
|
|
14
17
|
background: ${(props: any) => props.theme.colors.black} 0% 0% no-repeat padding-box;
|
|
15
18
|
padding: 3px 9px;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
border-radius: 3px;
|
|
19
|
+
top: 91px;
|
|
20
|
+
left: 10px;
|
|
19
21
|
`
|
|
@@ -28,8 +28,6 @@ import { HelpGuide } from './src/components/HelpGuide';
|
|
|
28
28
|
import { HelpOrder } from './src/components/HelpOrder';
|
|
29
29
|
import { NotFoundSource } from './src/components/NotFoundSource';
|
|
30
30
|
import { OrderTypeSelector } from './src/components/OrderTypeSelector';
|
|
31
|
-
import { Wallets } from './src/components/Wallets';
|
|
32
|
-
import { PaymentOptionWallet } from './src/components/PaymentOptionWallet';
|
|
33
31
|
|
|
34
32
|
import { Toast } from './src/components/shared/OToast';
|
|
35
33
|
import {
|
|
@@ -88,8 +86,6 @@ export {
|
|
|
88
86
|
HelpOrder,
|
|
89
87
|
NotFoundSource,
|
|
90
88
|
OrderTypeSelector,
|
|
91
|
-
Wallets,
|
|
92
|
-
PaymentOptionWallet,
|
|
93
89
|
|
|
94
90
|
// OComponents
|
|
95
91
|
Toast,
|
|
@@ -9,19 +9,15 @@ import {
|
|
|
9
9
|
BIInfo,
|
|
10
10
|
BIContentInfo,
|
|
11
11
|
BITotal,
|
|
12
|
-
BIActions
|
|
13
|
-
PriceContainer
|
|
12
|
+
BIActions
|
|
14
13
|
} from './styles';
|
|
15
|
-
import { OAlert,
|
|
14
|
+
import { OAlert, OIcon, OText } from '../shared';
|
|
16
15
|
|
|
17
16
|
export const BusinessItemAccordion = (props: any) => {
|
|
18
17
|
const {
|
|
19
18
|
cart,
|
|
20
19
|
moment,
|
|
21
|
-
|
|
22
|
-
handleClearProducts,
|
|
23
|
-
handleClickCheckout,
|
|
24
|
-
checkoutButtonDisabled
|
|
20
|
+
handleClearProducts
|
|
25
21
|
} = props
|
|
26
22
|
|
|
27
23
|
const [orderState] = useOrder();
|
|
@@ -33,7 +29,7 @@ export const BusinessItemAccordion = (props: any) => {
|
|
|
33
29
|
const isClosed = !cart?.valid_schedule
|
|
34
30
|
const isProducts = cart?.products?.length
|
|
35
31
|
|
|
36
|
-
const [isActive, setActiveState] = useState(
|
|
32
|
+
const [isActive, setActiveState] = useState(false)
|
|
37
33
|
|
|
38
34
|
useEffect(() => {
|
|
39
35
|
const cartsArray = Object.values(orderState?.carts)
|
|
@@ -44,7 +40,7 @@ export const BusinessItemAccordion = (props: any) => {
|
|
|
44
40
|
}, [orderState?.carts])
|
|
45
41
|
|
|
46
42
|
return (
|
|
47
|
-
<BIContainer isClosed={isClosed}
|
|
43
|
+
<BIContainer isClosed={isClosed}>
|
|
48
44
|
<BIHeader
|
|
49
45
|
isClosed={isClosed}
|
|
50
46
|
onPress={() => !isClosed ? setActiveState(!isActive) : isClosed}
|
|
@@ -74,39 +70,37 @@ export const BusinessItemAccordion = (props: any) => {
|
|
|
74
70
|
{props.onNavigationRedirect && !isClosed && (
|
|
75
71
|
<>
|
|
76
72
|
<TouchableOpacity onPress={() => props.onNavigationRedirect('Business', { store: cart?.business?.slug })}>
|
|
77
|
-
<OText color={theme.colors.
|
|
73
|
+
<OText color={theme.colors.textSecondary} size={12} lineHeight={18} style={{ textDecorationLine: 'underline' }}>{t('GO_TO_STORE', 'Go to store')}</OText>
|
|
78
74
|
</TouchableOpacity>
|
|
79
|
-
</>
|
|
80
|
-
)}
|
|
81
|
-
{!isCartPending && !isClosed && (
|
|
82
|
-
<>
|
|
83
75
|
<OText color={theme.colors.textSecondary}>{' \u2022 '}</OText>
|
|
84
|
-
<OAlert
|
|
85
|
-
title={t('DELETE_CART', 'Delete Cart')}
|
|
86
|
-
message={t('QUESTION_DELETE_CART', 'Are you sure to you wants delete the selected cart')}
|
|
87
|
-
onAccept={() => handleClearProducts()}
|
|
88
|
-
>
|
|
89
|
-
<OText size={12} lineHeight={18} color={theme.colors.primary} style={{ textDecorationLine: 'underline' }}>{t('CLEAR_CART', 'Clear cart')}</OText>
|
|
90
|
-
</OAlert>
|
|
91
76
|
</>
|
|
92
77
|
)}
|
|
93
|
-
{
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
lineHeight={18}
|
|
102
|
-
color={theme.colors.textSecondary}
|
|
103
|
-
style={{ textDecorationLine: 'underline' }}
|
|
104
|
-
>
|
|
105
|
-
{t('CHANGE_STORE', 'Change store')}
|
|
106
|
-
</OText>
|
|
107
|
-
</TouchableOpacity>
|
|
108
|
-
</>
|
|
78
|
+
{!isCartPending && !isClosed && (
|
|
79
|
+
<OAlert
|
|
80
|
+
title={t('DELETE_CART', 'Delete Cart')}
|
|
81
|
+
message={t('QUESTION_DELETE_CART', 'Are you sure to you wants delete the selected cart')}
|
|
82
|
+
onAccept={() => handleClearProducts()}
|
|
83
|
+
>
|
|
84
|
+
<OText size={12} lineHeight={18} color={theme.colors.textSecondary} style={{ textDecorationLine: 'underline' }}>{t('CLEAR_CART', 'Clear cart')}</OText>
|
|
85
|
+
</OAlert>
|
|
109
86
|
)}
|
|
87
|
+
{props.handleChangeStore && (
|
|
88
|
+
<>
|
|
89
|
+
<OText color={theme.colors.textSecondary}>{' \u2022 '}</OText>
|
|
90
|
+
<TouchableOpacity
|
|
91
|
+
onPress={props.handleChangeStore}
|
|
92
|
+
>
|
|
93
|
+
<OText
|
|
94
|
+
size={12}
|
|
95
|
+
lineHeight={18}
|
|
96
|
+
color={theme.colors.textSecondary}
|
|
97
|
+
style={{ textDecorationLine: 'underline' }}
|
|
98
|
+
>
|
|
99
|
+
{t('CHANGE_STORE', 'Change store')}
|
|
100
|
+
</OText>
|
|
101
|
+
</TouchableOpacity>
|
|
102
|
+
</>
|
|
103
|
+
)}
|
|
110
104
|
</View>
|
|
111
105
|
</BIContentInfo>
|
|
112
106
|
</BIInfo>
|
|
@@ -139,19 +133,6 @@ export const BusinessItemAccordion = (props: any) => {
|
|
|
139
133
|
)}
|
|
140
134
|
</BIActions>
|
|
141
135
|
</BIHeader>
|
|
142
|
-
{!isActive && !isClosed && !!isProducts && !checkoutButtonDisabled && (
|
|
143
|
-
<PriceContainer>
|
|
144
|
-
<OText>{parsePrice(cart?.total)}</OText>
|
|
145
|
-
<OButton
|
|
146
|
-
onClick={handleClickCheckout}
|
|
147
|
-
textStyle={{ color: 'white', textAlign: 'center', flex: 1 }}
|
|
148
|
-
style={{ width: 160, flexDirection: 'row', justifyContent: 'center', borderRadius: 7.6, shadowOpacity: 0 }}
|
|
149
|
-
text={t('CHECKOUT', 'Checkout')}
|
|
150
|
-
bgColor={(cart?.subtotal < cart?.minimum || !cart?.valid_address) ? theme.colors.secundary : theme.colors.primary}
|
|
151
|
-
borderColor={theme.colors.primary}
|
|
152
|
-
/>
|
|
153
|
-
</PriceContainer>
|
|
154
|
-
)}
|
|
155
136
|
|
|
156
137
|
<BIContent style={{ display: isActive ? 'flex' : 'none' }}>
|
|
157
138
|
{props.children}
|
|
@@ -42,7 +42,7 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
|
|
|
42
42
|
return (
|
|
43
43
|
<ProductsContainer>
|
|
44
44
|
{category.id &&
|
|
45
|
-
categoryState.products?.
|
|
45
|
+
categoryState.products?.map((product: any) => (
|
|
46
46
|
<SingleProductCard
|
|
47
47
|
key={'prod_' + product.id}
|
|
48
48
|
isSoldOut={product.inventoried && !product.quantity}
|
|
@@ -63,7 +63,7 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
|
|
|
63
63
|
{t('FEATURED', 'Featured')}
|
|
64
64
|
</OText>
|
|
65
65
|
<>
|
|
66
|
-
{categoryState.products?.
|
|
66
|
+
{categoryState.products?.map(
|
|
67
67
|
(product: any, i: any) =>
|
|
68
68
|
product.featured && (
|
|
69
69
|
<SingleProductCard
|
|
@@ -110,7 +110,7 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
|
|
|
110
110
|
</OText>
|
|
111
111
|
</View>
|
|
112
112
|
<>
|
|
113
|
-
{products.
|
|
113
|
+
{products.map((product: any, i: any) => (
|
|
114
114
|
<SingleProductCard
|
|
115
115
|
key={i}
|
|
116
116
|
isSoldOut={product.inventoried && !product.quantity}
|
|
@@ -57,7 +57,6 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
57
57
|
handleBusinessClick,
|
|
58
58
|
paginationProps,
|
|
59
59
|
handleChangeSearch,
|
|
60
|
-
businessId
|
|
61
60
|
} = props;
|
|
62
61
|
|
|
63
62
|
const theme = useTheme();
|
|
@@ -257,20 +256,17 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
257
256
|
/>
|
|
258
257
|
</WrapMomentOption>
|
|
259
258
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
/>
|
|
272
|
-
)}
|
|
273
|
-
|
|
259
|
+
<SearchBar
|
|
260
|
+
onSearch={handleChangeSearch}
|
|
261
|
+
searchValue={searchValue}
|
|
262
|
+
lazyLoad
|
|
263
|
+
isCancelXButtonShow={!!searchValue}
|
|
264
|
+
borderStyle={styles.borderStyle}
|
|
265
|
+
onCancel={() => handleChangeSearch('')}
|
|
266
|
+
placeholder={t('SEARCH', 'Search')}
|
|
267
|
+
height={26}
|
|
268
|
+
inputStyle={{ ...styles.searchInput, ...Platform.OS === 'ios' ? {} : { paddingBottom: 4 } }}
|
|
269
|
+
/>
|
|
274
270
|
</View>
|
|
275
271
|
</OrderControlContainer>
|
|
276
272
|
</HeaderWrapper>
|
|
@@ -281,7 +277,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
281
277
|
/>
|
|
282
278
|
</OrderProgressWrapper>
|
|
283
279
|
)}
|
|
284
|
-
{!
|
|
280
|
+
{!props.franchiseId && featuredBusiness && featuredBusiness.length > 0 && (
|
|
285
281
|
<FeaturedWrapper>
|
|
286
282
|
<OText size={16} style={{ marginLeft: 40 }} weight={Platform.OS === 'ios' ? '600' : 'bold'}>{t('FEATURED_BUSINESS', 'Featured business')}</OText>
|
|
287
283
|
<ScrollView
|
|
@@ -310,19 +306,17 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
310
306
|
</FeaturedWrapper>
|
|
311
307
|
)}
|
|
312
308
|
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100 }} />
|
|
313
|
-
{!
|
|
309
|
+
{!props.franchiseId && (
|
|
314
310
|
<HighestRatedBusinesses onBusinessClick={handleBusinessClick} navigation={navigation} />
|
|
315
311
|
)}
|
|
316
312
|
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100 }} />
|
|
317
313
|
<ListWrapper>
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
/>
|
|
325
|
-
)}
|
|
314
|
+
<BusinessTypeFilter
|
|
315
|
+
images={props.images}
|
|
316
|
+
businessTypes={props.businessTypes}
|
|
317
|
+
defaultBusinessType={props.defaultBusinessType}
|
|
318
|
+
handleChangeBusinessType={handleChangeBusinessType}
|
|
319
|
+
/>
|
|
326
320
|
{!businessesList.loading && businessesList.businesses.length === 0 && (
|
|
327
321
|
<NotFoundSource
|
|
328
322
|
content={t(
|
|
@@ -113,15 +113,6 @@ const CartUI = (props: any) => {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
const walletName: any = {
|
|
117
|
-
cash: {
|
|
118
|
-
name: t('PAY_WITH_CASH_WALLET', 'Pay with Cash Wallet'),
|
|
119
|
-
},
|
|
120
|
-
credit_point: {
|
|
121
|
-
name: t('PAY_WITH_CREDITS_POINTS_WALLET', 'Pay with Credit Points Wallet'),
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
116
|
return (
|
|
126
117
|
<CContainer>
|
|
127
118
|
{openUpselling && (
|
|
@@ -139,14 +130,11 @@ const CartUI = (props: any) => {
|
|
|
139
130
|
)}
|
|
140
131
|
<BusinessItemAccordion
|
|
141
132
|
cart={cart}
|
|
142
|
-
singleBusiness={props.singleBusiness}
|
|
143
133
|
moment={momentFormatted}
|
|
144
134
|
handleClearProducts={handleClearProducts}
|
|
145
135
|
handleCartOpen={handleCartOpen}
|
|
146
136
|
onNavigationRedirect={props.onNavigationRedirect}
|
|
147
137
|
handleChangeStore={props.isFranchiseApp ? () => setOpenChangeStore(true) : null}
|
|
148
|
-
handleClickCheckout={() => setOpenUpselling(true)}
|
|
149
|
-
checkoutButtonDisabled={(openUpselling && !canOpenUpselling) || cart?.subtotal < cart?.minimum || !cart?.valid_address}
|
|
150
138
|
>
|
|
151
139
|
{cart?.products?.length > 0 && cart?.products.map((product: any) => (
|
|
152
140
|
<ProductItemAccordion
|
|
@@ -203,7 +191,7 @@ const CartUI = (props: any) => {
|
|
|
203
191
|
cart?.fees?.length > 0 && cart?.fees?.filter((fee: any) => !(fee.fixed === 0 && fee.percentage === 0)).map((fee: any) => (
|
|
204
192
|
<OSTable key={fee?.id}>
|
|
205
193
|
<OSRow>
|
|
206
|
-
<OText numberOfLines={1}
|
|
194
|
+
<OText numberOfLines={1}>
|
|
207
195
|
{fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}{' '}
|
|
208
196
|
({parsePrice(fee?.fixed)} + {fee?.percentage}%){' '}
|
|
209
197
|
</OText>
|
|
@@ -215,15 +203,6 @@ const CartUI = (props: any) => {
|
|
|
215
203
|
</OSTable>
|
|
216
204
|
))
|
|
217
205
|
}
|
|
218
|
-
{cart?.service_fee > 0 && !cart?.fees?.length && (
|
|
219
|
-
<OSTable>
|
|
220
|
-
<OText size={12} lineHeight={18}>
|
|
221
|
-
{t('SERVICE_FEE', 'Service Fee')}
|
|
222
|
-
{`(${verifyDecimals(cart?.business?.service_fee, parseNumber)}%)`}
|
|
223
|
-
</OText>
|
|
224
|
-
<OText size={12} lineHeight={18}>{parsePrice(cart?.service_fee)}</OText>
|
|
225
|
-
</OSTable>
|
|
226
|
-
)}
|
|
227
206
|
{orderState?.options?.type === 1 && cart?.delivery_price > 0 && (
|
|
228
207
|
<OSTable>
|
|
229
208
|
<OText size={12} lineHeight={18}>{t('DELIVERY_FEE', 'Delivery Fee')}</OText>
|
|
@@ -244,14 +223,15 @@ const CartUI = (props: any) => {
|
|
|
244
223
|
<OText size={12} lineHeight={18}>{parsePrice(cart?.driver_tip)}</OText>
|
|
245
224
|
</OSTable>
|
|
246
225
|
)}
|
|
247
|
-
{cart?.
|
|
248
|
-
<OSTable
|
|
249
|
-
<OText size={12}
|
|
250
|
-
{
|
|
226
|
+
{cart?.service_fee > 0 && (
|
|
227
|
+
<OSTable>
|
|
228
|
+
<OText size={12} lineHeight={18}>
|
|
229
|
+
{t('SERVICE_FEE', 'Service Fee')}
|
|
230
|
+
{`(${verifyDecimals(cart?.business?.service_fee, parseNumber)}%)`}
|
|
251
231
|
</OText>
|
|
252
|
-
<OText size={12}
|
|
232
|
+
<OText size={12} lineHeight={18}>{parsePrice(cart?.service_fee)}</OText>
|
|
253
233
|
</OSTable>
|
|
254
|
-
)
|
|
234
|
+
)}
|
|
255
235
|
{isCouponEnabled && !isCartPending && (
|
|
256
236
|
<OSTable>
|
|
257
237
|
<OSCoupon>
|
|
@@ -269,7 +249,7 @@ const CartUI = (props: any) => {
|
|
|
269
249
|
{t('TOTAL', 'Total')}
|
|
270
250
|
</OText>
|
|
271
251
|
<OText size={14} lineHeight={21} weight={'600'}>
|
|
272
|
-
{
|
|
252
|
+
{cart?.total >= 1 && parsePrice(cart?.total)}
|
|
273
253
|
</OText>
|
|
274
254
|
</OSTable>
|
|
275
255
|
</OSTotal>
|
|
@@ -23,7 +23,6 @@ import { PaymentOptions } from '../PaymentOptions';
|
|
|
23
23
|
import { DriverTips } from '../DriverTips';
|
|
24
24
|
import { NotFoundSource } from '../NotFoundSource';
|
|
25
25
|
import { UserDetails } from '../UserDetails';
|
|
26
|
-
import { PaymentOptionWallet } from '../PaymentOptionWallet';
|
|
27
26
|
|
|
28
27
|
import {
|
|
29
28
|
ChContainer,
|
|
@@ -38,8 +37,7 @@ import {
|
|
|
38
37
|
ChUserDetails,
|
|
39
38
|
ChCart,
|
|
40
39
|
DeliveryOptionsContainer,
|
|
41
|
-
DeliveryOptionItem
|
|
42
|
-
WalletPaymentOptionContainer
|
|
40
|
+
DeliveryOptionItem
|
|
43
41
|
} from './styles';
|
|
44
42
|
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
|
|
45
43
|
|
|
@@ -506,15 +504,6 @@ const CheckoutUI = (props: any) => {
|
|
|
506
504
|
</ChSection>
|
|
507
505
|
)}
|
|
508
506
|
|
|
509
|
-
{!cartState.loading && cart && (
|
|
510
|
-
<WalletPaymentOptionContainer>
|
|
511
|
-
<PaymentOptionWallet
|
|
512
|
-
cart={cart}
|
|
513
|
-
/>
|
|
514
|
-
</WalletPaymentOptionContainer>
|
|
515
|
-
)}
|
|
516
|
-
|
|
517
|
-
|
|
518
507
|
{!cartState.loading && cart && (
|
|
519
508
|
<ChSection>
|
|
520
509
|
<ChCart>
|
|
@@ -554,8 +543,8 @@ const CheckoutUI = (props: any) => {
|
|
|
554
543
|
)}
|
|
555
544
|
|
|
556
545
|
{!cartState.loading && cart && (
|
|
557
|
-
|
|
558
|
-
<ChErrors
|
|
546
|
+
<ChSection style={{ paddingTop: 0, paddingBottom: 20, paddingHorizontal: 20 }}>
|
|
547
|
+
<ChErrors>
|
|
559
548
|
{!cart?.valid_address && cart?.status !== 2 && (
|
|
560
549
|
<OText
|
|
561
550
|
color={theme.colors.error}
|
|
@@ -583,7 +572,7 @@ const CheckoutUI = (props: any) => {
|
|
|
583
572
|
</OText>
|
|
584
573
|
)}
|
|
585
574
|
</ChErrors>
|
|
586
|
-
</
|
|
575
|
+
</ChSection>
|
|
587
576
|
)}
|
|
588
577
|
<OModal
|
|
589
578
|
open={openChangeStore && props.isFranchiseApp}
|