ordering-ui-react-native 0.14.22-release → 0.14.25
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/ProductForm/index.tsx +15 -13
- package/themes/doordash/src/components/ProductForm/index.tsx +16 -14
- package/themes/instacart/src/components/BusinessProductsList/styles.tsx +1 -1
- package/themes/instacart/src/components/ProductForm/index.tsx +15 -13
- package/themes/instacart/src/components/SingleProductCard/index.tsx +24 -19
- package/themes/instacart/src/components/SingleProductCard/styles.tsx +4 -6
- package/themes/kiosk/src/components/ProductForm/index.tsx +15 -13
- package/themes/original/index.tsx +4 -0
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +2 -1
- package/themes/original/src/components/BusinessesListing/index.tsx +25 -19
- package/themes/original/src/components/Cart/index.tsx +27 -9
- package/themes/original/src/components/CartContent/index.tsx +1 -0
- package/themes/original/src/components/Checkout/index.tsx +15 -4
- package/themes/original/src/components/Checkout/styles.tsx +5 -1
- package/themes/original/src/components/Help/index.tsx +2 -2
- package/themes/original/src/components/OrderDetails/index.tsx +54 -0
- package/themes/original/src/components/OrderProgress/index.tsx +2 -2
- package/themes/original/src/components/OrderSummary/index.tsx +21 -3
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +163 -0
- package/themes/original/src/components/PaymentOptionWallet/styles.tsx +38 -0
- package/themes/original/src/components/ProductForm/index.tsx +21 -19
- package/themes/original/src/components/UserProfile/index.tsx +5 -0
- package/themes/original/src/components/WalletTransactionItem/index.tsx +68 -0
- package/themes/original/src/components/WalletTransactionItem/styles.tsx +37 -0
- package/themes/original/src/components/Wallets/index.tsx +204 -0
- package/themes/original/src/components/Wallets/styles.tsx +43 -0
- package/themes/original/src/types/index.tsx +4 -2
- package/themes/single-business/src/components/ProductForm/index.tsx +29 -28
- package/themes/uber-eats/src/components/ProductForm/index.tsx +15 -13
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.25",
|
|
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#development",
|
|
59
59
|
"patch-package": "^6.4.7",
|
|
60
60
|
"postinstall-postinstall": "^2.1.0",
|
|
61
61
|
"prop-types": "^15.7.2",
|
|
@@ -232,19 +232,21 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
232
232
|
</React.Fragment>
|
|
233
233
|
)
|
|
234
234
|
}))}
|
|
235
|
-
|
|
236
|
-
<
|
|
237
|
-
<
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
235
|
+
{!product?.hide_special_instructions && (
|
|
236
|
+
<ProductComment>
|
|
237
|
+
<SectionTitle>
|
|
238
|
+
<OText size={16}>{t('SPECIAL_COMMENT', 'Special comment')}</OText>
|
|
239
|
+
</SectionTitle>
|
|
240
|
+
<OInput
|
|
241
|
+
multiline
|
|
242
|
+
placeholder={t('SPECIAL_COMMENT', 'Special comment')}
|
|
243
|
+
value={productCart.comment}
|
|
244
|
+
onChange={(val: string) => handleChangeCommentState({ target: { value: val } })}
|
|
245
|
+
isDisabled={!(productCart && !isSoldOut && maxProductQuantity)}
|
|
246
|
+
style={styles.comment}
|
|
247
|
+
/>
|
|
248
|
+
</ProductComment>
|
|
249
|
+
)}
|
|
248
250
|
</ProductEditions>
|
|
249
251
|
)}
|
|
250
252
|
</WrapContent>
|
|
@@ -287,20 +287,22 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
287
287
|
</React.Fragment>
|
|
288
288
|
)
|
|
289
289
|
}))}
|
|
290
|
-
|
|
291
|
-
<
|
|
292
|
-
<
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
290
|
+
{!product?.hide_special_instructions && (
|
|
291
|
+
<ProductComment onLayout={(e: any) => setCommentY(e.nativeEvent.layout.y + e.nativeEvent.layout.height)}>
|
|
292
|
+
<SectionTitle>
|
|
293
|
+
<OText style={theme.labels.middle as TextStyle}>{t('SPECIAL_COMMENT', 'Special comment')}</OText>
|
|
294
|
+
</SectionTitle>
|
|
295
|
+
<OInput
|
|
296
|
+
multiline
|
|
297
|
+
placeholder={t('SPECIAL_COMMENT', 'Special comment')}
|
|
298
|
+
value={productCart.comment}
|
|
299
|
+
onChange={(val: string) => handleChangeCommentState({ target: { value: val } })}
|
|
300
|
+
isDisabled={!(productCart && !isSoldOut && maxProductQuantity)}
|
|
301
|
+
style={styles.comment}
|
|
302
|
+
inputStyle={{ fontSize: 12, paddingBottom: 7, paddingTop: 17 }}
|
|
303
|
+
/>
|
|
304
|
+
</ProductComment>
|
|
305
|
+
)}
|
|
304
306
|
{productCart && !isSoldOut && maxProductQuantity > 0 && (
|
|
305
307
|
<View style={{ paddingVertical: 4, marginBottom: 10 }}>
|
|
306
308
|
<SectionTitle>
|
|
@@ -235,19 +235,21 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
235
235
|
</React.Fragment>
|
|
236
236
|
)
|
|
237
237
|
}))}
|
|
238
|
-
|
|
239
|
-
<
|
|
240
|
-
<
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
238
|
+
{!product?.hide_special_instructions && (
|
|
239
|
+
<ProductComment>
|
|
240
|
+
<SectionTitle>
|
|
241
|
+
<OText style={theme.labels.middle}>{t('SPECIAL_COMMENT', 'Special comment')}</OText>
|
|
242
|
+
</SectionTitle>
|
|
243
|
+
<OInput
|
|
244
|
+
multiline
|
|
245
|
+
placeholder={t('SPECIAL_COMMENT', 'Special comment')}
|
|
246
|
+
value={productCart.comment}
|
|
247
|
+
onChange={(val: string) => handleChangeCommentState({ target: { value: val } })}
|
|
248
|
+
isDisabled={!(productCart && !isSoldOut && maxProductQuantity)}
|
|
249
|
+
style={{ ...styles.comment, borderColor: theme.colors.border }}
|
|
250
|
+
/>
|
|
251
|
+
</ProductComment>
|
|
252
|
+
)}
|
|
251
253
|
</ProductEditions>
|
|
252
254
|
)}
|
|
253
255
|
</WrapContent>
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
CardInfo,
|
|
7
7
|
SoldOut
|
|
8
8
|
} from './styles'
|
|
9
|
-
import { StyleSheet, TouchableOpacity, Dimensions } from 'react-native'
|
|
9
|
+
import { StyleSheet, TouchableOpacity, Dimensions, View } from 'react-native'
|
|
10
10
|
import { OText, OIcon } from '../shared'
|
|
11
11
|
import { useTheme } from 'styled-components/native'
|
|
12
12
|
|
|
@@ -23,11 +23,7 @@ export const SingleProductCard = (props: SingleProductCardParams) => {
|
|
|
23
23
|
|
|
24
24
|
const styles = StyleSheet.create({
|
|
25
25
|
container: {
|
|
26
|
-
width: (windowWidth - 80) / 2
|
|
27
|
-
height: (windowWidth - 80) / 2 + 40
|
|
28
|
-
},
|
|
29
|
-
textStyle: {
|
|
30
|
-
flex: 1,
|
|
26
|
+
width: (windowWidth - 80) / 2
|
|
31
27
|
},
|
|
32
28
|
soldOutTextStyle : {
|
|
33
29
|
textTransform: 'capitalize',
|
|
@@ -35,9 +31,14 @@ export const SingleProductCard = (props: SingleProductCardParams) => {
|
|
|
35
31
|
fontSize: 12,
|
|
36
32
|
lineHeight: 18
|
|
37
33
|
},
|
|
38
|
-
|
|
34
|
+
imageWrapper: {
|
|
39
35
|
width: (windowWidth - 160) / 2,
|
|
40
36
|
height: (windowWidth - 160) / 2,
|
|
37
|
+
position: 'relative'
|
|
38
|
+
},
|
|
39
|
+
productStyle: {
|
|
40
|
+
width: '100%',
|
|
41
|
+
height: '100%',
|
|
41
42
|
borderRadius: 3,
|
|
42
43
|
marginTop: 5
|
|
43
44
|
},
|
|
@@ -74,26 +75,30 @@ export const SingleProductCard = (props: SingleProductCardParams) => {
|
|
|
74
75
|
onPress={() => onProductClick?.(product)}
|
|
75
76
|
activeOpacity={0.8}
|
|
76
77
|
>
|
|
77
|
-
<
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
<View
|
|
79
|
+
style={styles.imageWrapper}
|
|
80
|
+
>
|
|
81
|
+
<OIcon
|
|
82
|
+
url={optimizeImage(product?.images, 'h_200,c_limit')}
|
|
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>
|
|
82
92
|
<CardInfo>
|
|
83
93
|
<OText color={theme.colors.textPrimary} style={{...theme.labels.normal, marginTop: 9}}>{parsePrice(product?.price)}</OText>
|
|
84
|
-
<OText numberOfLines={1} ellipsizeMode='tail' style={{...
|
|
85
|
-
<OText color={theme.colors.textSecondary} size={9} numberOfLines={2} ellipsizeMode='tail' style={{...
|
|
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>
|
|
86
96
|
</CardInfo>
|
|
87
97
|
|
|
88
98
|
<TouchableOpacity style={styles.addBtn} onPress={() => onProductClick?.(product)} activeOpacity={0.7}>
|
|
89
99
|
<OIcon src={theme.images.general.plus_circle} />
|
|
90
100
|
</TouchableOpacity>
|
|
91
101
|
|
|
92
|
-
{(isSoldOut || maxProductQuantity <= 0) && (
|
|
93
|
-
<SoldOut>
|
|
94
|
-
<OText size={10} style={styles.soldOutTextStyle}>{t('SOLD_OUT', 'SOLD OUT')}</OText>
|
|
95
|
-
</SoldOut>
|
|
96
|
-
)}
|
|
97
102
|
</CardContainer>
|
|
98
103
|
)
|
|
99
104
|
}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import styled from 'styled-components/native'
|
|
2
2
|
|
|
3
3
|
export const CardContainer = styled.TouchableOpacity`
|
|
4
|
-
|
|
5
|
-
align-items: flex-start;
|
|
4
|
+
flex-direction: column;
|
|
6
5
|
padding: 10px;
|
|
7
6
|
position: relative;
|
|
8
|
-
/* margin-end: 10px; */
|
|
9
|
-
border-radius: 3px;
|
|
10
7
|
`
|
|
11
8
|
export const CardInfo = styled.View`
|
|
12
9
|
flex: 1;
|
|
@@ -16,6 +13,7 @@ export const SoldOut = styled.View`
|
|
|
16
13
|
position: absolute;
|
|
17
14
|
background: ${(props: any) => props.theme.colors.black} 0% 0% no-repeat padding-box;
|
|
18
15
|
padding: 3px 9px;
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
left: 0px;
|
|
17
|
+
bottom: -5px;
|
|
18
|
+
border-radius: 3px;
|
|
21
19
|
`
|
|
@@ -438,19 +438,21 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
438
438
|
</React.Fragment>
|
|
439
439
|
)
|
|
440
440
|
}))}
|
|
441
|
-
|
|
442
|
-
<
|
|
443
|
-
<
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
441
|
+
{!product?.hide_special_instructions && (
|
|
442
|
+
<ProductComment>
|
|
443
|
+
<SectionTitle>
|
|
444
|
+
<OText size={28} weight="bold">{t('SPECIAL_COMMENT', 'Special comment')}</OText>
|
|
445
|
+
</SectionTitle>
|
|
446
|
+
<OInput
|
|
447
|
+
multiline
|
|
448
|
+
placeholder={t('SPECIAL_COMMENT', 'Special comment')}
|
|
449
|
+
value={productCart.comment}
|
|
450
|
+
onChange={(val: string) => handleChangeCommentState({ target: { value: val } })}
|
|
451
|
+
isDisabled={!(productCart && !isSoldOut && maxProductQuantity)}
|
|
452
|
+
style={styles.comment}
|
|
453
|
+
/>
|
|
454
|
+
</ProductComment>
|
|
455
|
+
)}
|
|
454
456
|
</ProductEditions>
|
|
455
457
|
</WrapContent>
|
|
456
458
|
</View>
|
|
@@ -28,6 +28,8 @@ 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';
|
|
31
33
|
|
|
32
34
|
import { Toast } from './src/components/shared/OToast';
|
|
33
35
|
import {
|
|
@@ -86,6 +88,8 @@ export {
|
|
|
86
88
|
HelpOrder,
|
|
87
89
|
NotFoundSource,
|
|
88
90
|
OrderTypeSelector,
|
|
91
|
+
Wallets,
|
|
92
|
+
PaymentOptionWallet,
|
|
89
93
|
|
|
90
94
|
// OComponents
|
|
91
95
|
Toast,
|
|
@@ -17,6 +17,7 @@ export const BusinessItemAccordion = (props: any) => {
|
|
|
17
17
|
const {
|
|
18
18
|
cart,
|
|
19
19
|
moment,
|
|
20
|
+
singleBusiness,
|
|
20
21
|
handleClearProducts
|
|
21
22
|
} = props
|
|
22
23
|
|
|
@@ -29,7 +30,7 @@ export const BusinessItemAccordion = (props: any) => {
|
|
|
29
30
|
const isClosed = !cart?.valid_schedule
|
|
30
31
|
const isProducts = cart?.products?.length
|
|
31
32
|
|
|
32
|
-
const [isActive, setActiveState] = useState(
|
|
33
|
+
const [isActive, setActiveState] = useState(!!singleBusiness)
|
|
33
34
|
|
|
34
35
|
useEffect(() => {
|
|
35
36
|
const cartsArray = Object.values(orderState?.carts)
|
|
@@ -57,6 +57,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
57
57
|
handleBusinessClick,
|
|
58
58
|
paginationProps,
|
|
59
59
|
handleChangeSearch,
|
|
60
|
+
businessId
|
|
60
61
|
} = props;
|
|
61
62
|
|
|
62
63
|
const theme = useTheme();
|
|
@@ -256,17 +257,20 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
256
257
|
/>
|
|
257
258
|
</WrapMomentOption>
|
|
258
259
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
260
|
+
{!businessId && (
|
|
261
|
+
<SearchBar
|
|
262
|
+
onSearch={handleChangeSearch}
|
|
263
|
+
searchValue={searchValue}
|
|
264
|
+
lazyLoad
|
|
265
|
+
isCancelXButtonShow={!!searchValue}
|
|
266
|
+
borderStyle={styles.borderStyle}
|
|
267
|
+
onCancel={() => handleChangeSearch('')}
|
|
268
|
+
placeholder={t('SEARCH', 'Search')}
|
|
269
|
+
height={26}
|
|
270
|
+
inputStyle={{ ...styles.searchInput, ...Platform.OS === 'ios' ? {} : { paddingBottom: 4 } }}
|
|
271
|
+
/>
|
|
272
|
+
)}
|
|
273
|
+
|
|
270
274
|
</View>
|
|
271
275
|
</OrderControlContainer>
|
|
272
276
|
</HeaderWrapper>
|
|
@@ -277,7 +281,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
277
281
|
/>
|
|
278
282
|
</OrderProgressWrapper>
|
|
279
283
|
)}
|
|
280
|
-
{!props.franchiseId && featuredBusiness && featuredBusiness.length > 0 && (
|
|
284
|
+
{!businessId && !props.franchiseId && featuredBusiness && featuredBusiness.length > 0 && (
|
|
281
285
|
<FeaturedWrapper>
|
|
282
286
|
<OText size={16} style={{ marginLeft: 40 }} weight={Platform.OS === 'ios' ? '600' : 'bold'}>{t('FEATURED_BUSINESS', 'Featured business')}</OText>
|
|
283
287
|
<ScrollView
|
|
@@ -306,17 +310,19 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
306
310
|
</FeaturedWrapper>
|
|
307
311
|
)}
|
|
308
312
|
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100 }} />
|
|
309
|
-
{!props.franchiseId && (
|
|
313
|
+
{!businessId && !props.franchiseId && (
|
|
310
314
|
<HighestRatedBusinesses onBusinessClick={handleBusinessClick} navigation={navigation} />
|
|
311
315
|
)}
|
|
312
316
|
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100 }} />
|
|
313
317
|
<ListWrapper>
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
318
|
+
{!businessId && (
|
|
319
|
+
<BusinessTypeFilter
|
|
320
|
+
images={props.images}
|
|
321
|
+
businessTypes={props.businessTypes}
|
|
322
|
+
defaultBusinessType={props.defaultBusinessType}
|
|
323
|
+
handleChangeBusinessType={handleChangeBusinessType}
|
|
324
|
+
/>
|
|
325
|
+
)}
|
|
320
326
|
{!businessesList.loading && businessesList.businesses.length === 0 && (
|
|
321
327
|
<NotFoundSource
|
|
322
328
|
content={t(
|
|
@@ -113,6 +113,15 @@ 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
|
+
|
|
116
125
|
return (
|
|
117
126
|
<CContainer>
|
|
118
127
|
{openUpselling && (
|
|
@@ -130,6 +139,7 @@ const CartUI = (props: any) => {
|
|
|
130
139
|
)}
|
|
131
140
|
<BusinessItemAccordion
|
|
132
141
|
cart={cart}
|
|
142
|
+
singleBusiness={props.singleBusiness}
|
|
133
143
|
moment={momentFormatted}
|
|
134
144
|
handleClearProducts={handleClearProducts}
|
|
135
145
|
handleCartOpen={handleCartOpen}
|
|
@@ -191,7 +201,7 @@ const CartUI = (props: any) => {
|
|
|
191
201
|
cart?.fees?.length > 0 && cart?.fees?.filter((fee: any) => !(fee.fixed === 0 && fee.percentage === 0)).map((fee: any) => (
|
|
192
202
|
<OSTable key={fee?.id}>
|
|
193
203
|
<OSRow>
|
|
194
|
-
<OText numberOfLines={1}>
|
|
204
|
+
<OText numberOfLines={1} size={12} lineHeight={18}>
|
|
195
205
|
{fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}{' '}
|
|
196
206
|
({parsePrice(fee?.fixed)} + {fee?.percentage}%){' '}
|
|
197
207
|
</OText>
|
|
@@ -203,6 +213,15 @@ const CartUI = (props: any) => {
|
|
|
203
213
|
</OSTable>
|
|
204
214
|
))
|
|
205
215
|
}
|
|
216
|
+
{cart?.service_fee > 0 && !cart?.fees?.length && (
|
|
217
|
+
<OSTable>
|
|
218
|
+
<OText size={12} lineHeight={18}>
|
|
219
|
+
{t('SERVICE_FEE', 'Service Fee')}
|
|
220
|
+
{`(${verifyDecimals(cart?.business?.service_fee, parseNumber)}%)`}
|
|
221
|
+
</OText>
|
|
222
|
+
<OText size={12} lineHeight={18}>{parsePrice(cart?.service_fee)}</OText>
|
|
223
|
+
</OSTable>
|
|
224
|
+
)}
|
|
206
225
|
{orderState?.options?.type === 1 && cart?.delivery_price > 0 && (
|
|
207
226
|
<OSTable>
|
|
208
227
|
<OText size={12} lineHeight={18}>{t('DELIVERY_FEE', 'Delivery Fee')}</OText>
|
|
@@ -223,15 +242,14 @@ const CartUI = (props: any) => {
|
|
|
223
242
|
<OText size={12} lineHeight={18}>{parsePrice(cart?.driver_tip)}</OText>
|
|
224
243
|
</OSTable>
|
|
225
244
|
)}
|
|
226
|
-
{cart?.
|
|
227
|
-
<OSTable>
|
|
228
|
-
<OText size={12}
|
|
229
|
-
{
|
|
230
|
-
{`(${verifyDecimals(cart?.business?.service_fee, parseNumber)}%)`}
|
|
245
|
+
{cart?.payment_events?.length > 0 && cart?.payment_events?.map((event: any) => (
|
|
246
|
+
<OSTable key={event.id}>
|
|
247
|
+
<OText size={12} numberOfLines={1}>
|
|
248
|
+
{walletName[cart?.wallets?.find((wallet: any) => wallet.id === event.wallet_id)?.type]?.name}
|
|
231
249
|
</OText>
|
|
232
|
-
<OText size={12}
|
|
250
|
+
<OText size={12}>-{parsePrice(event.amount)}</OText>
|
|
233
251
|
</OSTable>
|
|
234
|
-
)}
|
|
252
|
+
))}
|
|
235
253
|
{isCouponEnabled && !isCartPending && (
|
|
236
254
|
<OSTable>
|
|
237
255
|
<OSCoupon>
|
|
@@ -249,7 +267,7 @@ const CartUI = (props: any) => {
|
|
|
249
267
|
{t('TOTAL', 'Total')}
|
|
250
268
|
</OText>
|
|
251
269
|
<OText size={14} lineHeight={21} weight={'600'}>
|
|
252
|
-
{cart?.
|
|
270
|
+
{parsePrice(cart?.balance ?? cart?.total)}
|
|
253
271
|
</OText>
|
|
254
272
|
</OSTable>
|
|
255
273
|
</OSTotal>
|
|
@@ -23,6 +23,7 @@ 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';
|
|
26
27
|
|
|
27
28
|
import {
|
|
28
29
|
ChContainer,
|
|
@@ -37,7 +38,8 @@ import {
|
|
|
37
38
|
ChUserDetails,
|
|
38
39
|
ChCart,
|
|
39
40
|
DeliveryOptionsContainer,
|
|
40
|
-
DeliveryOptionItem
|
|
41
|
+
DeliveryOptionItem,
|
|
42
|
+
WalletPaymentOptionContainer
|
|
41
43
|
} from './styles';
|
|
42
44
|
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
|
|
43
45
|
|
|
@@ -504,6 +506,15 @@ const CheckoutUI = (props: any) => {
|
|
|
504
506
|
</ChSection>
|
|
505
507
|
)}
|
|
506
508
|
|
|
509
|
+
{!cartState.loading && cart && (
|
|
510
|
+
<WalletPaymentOptionContainer>
|
|
511
|
+
<PaymentOptionWallet
|
|
512
|
+
cart={cart}
|
|
513
|
+
/>
|
|
514
|
+
</WalletPaymentOptionContainer>
|
|
515
|
+
)}
|
|
516
|
+
|
|
517
|
+
|
|
507
518
|
{!cartState.loading && cart && (
|
|
508
519
|
<ChSection>
|
|
509
520
|
<ChCart>
|
|
@@ -543,8 +554,8 @@ const CheckoutUI = (props: any) => {
|
|
|
543
554
|
)}
|
|
544
555
|
|
|
545
556
|
{!cartState.loading && cart && (
|
|
546
|
-
|
|
547
|
-
<ChErrors>
|
|
557
|
+
<View>
|
|
558
|
+
<ChErrors style={{ marginBottom: 0 }}>
|
|
548
559
|
{!cart?.valid_address && cart?.status !== 2 && (
|
|
549
560
|
<OText
|
|
550
561
|
color={theme.colors.error}
|
|
@@ -572,7 +583,7 @@ const CheckoutUI = (props: any) => {
|
|
|
572
583
|
</OText>
|
|
573
584
|
)}
|
|
574
585
|
</ChErrors>
|
|
575
|
-
</
|
|
586
|
+
</View>
|
|
576
587
|
)}
|
|
577
588
|
<OModal
|
|
578
589
|
open={openChangeStore && props.isFranchiseApp}
|
|
@@ -74,6 +74,10 @@ export const ChDriverTips = styled(ChPaymethods)``
|
|
|
74
74
|
|
|
75
75
|
export const ChCart = styled(ChPaymethods)``
|
|
76
76
|
|
|
77
|
+
export const WalletPaymentOptionContainer = styled(ChPaymethods)`
|
|
78
|
+
padding-bottom: 0;
|
|
79
|
+
`
|
|
80
|
+
|
|
77
81
|
export const ChPlaceOrderBtn = styled.View`
|
|
78
82
|
width: 100%;
|
|
79
83
|
display: flex;
|
|
@@ -99,4 +103,4 @@ export const DeliveryOptionItem = styled.View`
|
|
|
99
103
|
align-items: center;
|
|
100
104
|
flex-direction: row;
|
|
101
105
|
background-color: ${(props : any) => props?.backgroundColor ?? '#fff'};
|
|
102
|
-
`;
|
|
106
|
+
`;
|
|
@@ -48,8 +48,8 @@ export const Help = (props: HelpParams) => {
|
|
|
48
48
|
|
|
49
49
|
<LastOrdersContainer>
|
|
50
50
|
<OText size={18} weight={600}>{t('LAST_ORDERS', 'Last Orders')}</OText>
|
|
51
|
-
<LastOrders onRedirect={onRedirect} />
|
|
51
|
+
<LastOrders businessId={props.businessId} onRedirect={onRedirect} />
|
|
52
52
|
</LastOrdersContainer>
|
|
53
53
|
</>
|
|
54
54
|
)
|
|
55
|
-
}
|
|
55
|
+
}
|
|
@@ -104,6 +104,15 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
104
104
|
|
|
105
105
|
const { order, businessData } = props.order;
|
|
106
106
|
|
|
107
|
+
const walletName: any = {
|
|
108
|
+
cash: {
|
|
109
|
+
name: t('PAY_WITH_CASH_WALLET', 'Pay with Cash Wallet'),
|
|
110
|
+
},
|
|
111
|
+
credit_point: {
|
|
112
|
+
name: t('PAY_WITH_CREDITS_POINTS_WALLET', 'Pay with Credit Points Wallet'),
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
107
116
|
const getOrderStatus = (s: string) => {
|
|
108
117
|
const status = parseInt(s);
|
|
109
118
|
const orderStatus = [
|
|
@@ -826,6 +835,51 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
826
835
|
</OText>
|
|
827
836
|
</Table>
|
|
828
837
|
</Total>
|
|
838
|
+
{order?.payment_events?.length > 0 && (
|
|
839
|
+
<View style={{marginTop: 10}}>
|
|
840
|
+
<OText size={20} weight='bold' color={theme.colors.textNormal}>{t('PAYMENTS', 'Payments')}</OText>
|
|
841
|
+
<View
|
|
842
|
+
style={{
|
|
843
|
+
width: '100%',
|
|
844
|
+
marginTop: 10
|
|
845
|
+
}}
|
|
846
|
+
>
|
|
847
|
+
{order?.payment_events?.map((event: any) => (
|
|
848
|
+
<View
|
|
849
|
+
key={event.id}
|
|
850
|
+
style={{
|
|
851
|
+
display: 'flex',
|
|
852
|
+
flexDirection: 'row',
|
|
853
|
+
justifyContent: 'space-between',
|
|
854
|
+
alignItems: 'center',
|
|
855
|
+
marginBottom: 10
|
|
856
|
+
}}
|
|
857
|
+
>
|
|
858
|
+
<View
|
|
859
|
+
style={{
|
|
860
|
+
display: 'flex',
|
|
861
|
+
flexDirection: 'column',
|
|
862
|
+
}}
|
|
863
|
+
>
|
|
864
|
+
<OText>
|
|
865
|
+
{event?.wallet_event
|
|
866
|
+
? walletName[event?.wallet_event?.wallet?.type]?.name
|
|
867
|
+
: event?.paymethod?.name}
|
|
868
|
+
</OText>
|
|
869
|
+
{event?.data?.charge_id && (
|
|
870
|
+
<OText>
|
|
871
|
+
{`${t('CODE', 'Code')}: ${event?.data?.charge_id}`}
|
|
872
|
+
</OText>
|
|
873
|
+
)}
|
|
874
|
+
</View>
|
|
875
|
+
<OText>
|
|
876
|
+
-{parsePrice(event.amount)}
|
|
877
|
+
</OText>
|
|
878
|
+
</View>
|
|
879
|
+
))}
|
|
880
|
+
</View>
|
|
881
|
+
</View>
|
|
882
|
+
)}
|
|
829
883
|
</OrderBill>
|
|
830
884
|
</OrderContent>
|
|
831
885
|
</>
|
|
@@ -193,13 +193,13 @@ const OrderProgressUI = (props: any) => {
|
|
|
193
193
|
</View>
|
|
194
194
|
</View>
|
|
195
195
|
)}
|
|
196
|
-
{!orderList?.loading && orderList?.orders?.length === 0 && (
|
|
196
|
+
{/* {!orderList?.loading && orderList?.orders?.length === 0 && (
|
|
197
197
|
<NotFoundSource
|
|
198
198
|
image={imageFails}
|
|
199
199
|
content={t('NO_RESULTS_FOUND', 'Sorry, no results found')}
|
|
200
200
|
conditioned
|
|
201
201
|
/>
|
|
202
|
-
)}
|
|
202
|
+
)} */}
|
|
203
203
|
</>
|
|
204
204
|
)
|
|
205
205
|
}
|