ordering-ui-react-native 0.14.24 → 0.14.26-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/Messages/index.tsx +6 -1
- package/src/components/ProductForm/index.tsx +40 -34
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/doordash/src/components/ProductForm/index.tsx +14 -16
- package/themes/instacart/src/components/ProductForm/index.tsx +13 -15
- package/themes/kiosk/src/components/ProductForm/index.tsx +13 -15
- package/themes/original/index.tsx +0 -4
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +1 -2
- package/themes/original/src/components/BusinessesListing/index.tsx +19 -25
- package/themes/original/src/components/Cart/index.tsx +9 -27
- 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/Messages/index.tsx +39 -59
- package/themes/original/src/components/OrderDetails/index.tsx +5 -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 +43 -28
- package/themes/original/src/components/UserProfile/index.tsx +0 -5
- package/themes/original/src/types/index.tsx +2 -4
- package/themes/single-business/src/components/ProductForm/index.tsx +28 -29
- package/themes/uber-eats/src/components/ProductForm/index.tsx +13 -15
- 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.26-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",
|
|
@@ -45,6 +45,7 @@ const imgOptions = {
|
|
|
45
45
|
includeBase64: true,
|
|
46
46
|
selectionLimit: 0
|
|
47
47
|
}
|
|
48
|
+
const filterSpecialStatus = ['prepared_in', 'delivered_in']
|
|
48
49
|
|
|
49
50
|
const MessagesUI = (props: MessagesParams) => {
|
|
50
51
|
const {
|
|
@@ -118,7 +119,11 @@ const MessagesUI = (props: MessagesParams) => {
|
|
|
118
119
|
const messageConsole = (message: any) => {
|
|
119
120
|
return message.change?.attribute !== 'driver_id'
|
|
120
121
|
?
|
|
121
|
-
`${t('ORDER', 'Order')} ${t(message.change.attribute.toUpperCase(), message.change.attribute.replace('_', ' '))} ${t('CHANGED_FROM', 'Changed from')} ${
|
|
122
|
+
`${t('ORDER', 'Order')} ${t(message.change.attribute.toUpperCase(), message.change.attribute.replace('_', ' '))} ${t('CHANGED_FROM', 'Changed from')} ${
|
|
123
|
+
filterSpecialStatus.includes(message.change.attribute) ?
|
|
124
|
+
`${message.change.old === null ? '0' : message.change.old} ${t('TO', 'to')} ${message.change.new} ${t('MINUTES', 'Minutes')}` :
|
|
125
|
+
`${message.change.old !== null && t(ORDER_STATUS[parseInt(message.change.old, 10)])} ${t('TO', 'to')} ${t(ORDER_STATUS[parseInt(message.change.new, 10)])}`
|
|
126
|
+
}`
|
|
122
127
|
: message.change.new
|
|
123
128
|
?
|
|
124
129
|
`${message.driver?.name} ${message.driver?.lastname !== null ? message.driver.lastname : ''} ${t('WAS_ASSIGNED_AS_DRIVER', 'Was assigned as driver')} ${message.comment ? message.comment.length : ''}`
|
|
@@ -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>
|
|
@@ -232,21 +237,19 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
232
237
|
</React.Fragment>
|
|
233
238
|
)
|
|
234
239
|
}))}
|
|
235
|
-
|
|
236
|
-
<
|
|
237
|
-
<
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
</ProductComment>
|
|
249
|
-
)}
|
|
240
|
+
<ProductComment>
|
|
241
|
+
<SectionTitle>
|
|
242
|
+
<OText size={16}>{t('SPECIAL_COMMENT', 'Special comment')}</OText>
|
|
243
|
+
</SectionTitle>
|
|
244
|
+
<OInput
|
|
245
|
+
multiline
|
|
246
|
+
placeholder={t('SPECIAL_COMMENT', 'Special comment')}
|
|
247
|
+
value={productCart.comment}
|
|
248
|
+
onChange={(val: string) => handleChangeCommentState({ target: { value: val } })}
|
|
249
|
+
isDisabled={!(productCart && !isSoldOut && maxProductQuantity)}
|
|
250
|
+
style={styles.comment}
|
|
251
|
+
/>
|
|
252
|
+
</ProductComment>
|
|
250
253
|
</ProductEditions>
|
|
251
254
|
)}
|
|
252
255
|
</WrapContent>
|
|
@@ -383,6 +386,9 @@ const styles = StyleSheet.create({
|
|
|
383
386
|
textDecorationLine: 'line-through',
|
|
384
387
|
marginLeft: 7,
|
|
385
388
|
marginRight: 7
|
|
389
|
+
},
|
|
390
|
+
caloriesStyle: {
|
|
391
|
+
color: '#808080'
|
|
386
392
|
}
|
|
387
393
|
})
|
|
388
394
|
|
|
@@ -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
|
/>
|
|
@@ -287,22 +287,20 @@ 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
|
-
|
|
304
|
-
</ProductComment>
|
|
305
|
-
)}
|
|
290
|
+
<ProductComment onLayout={(e: any) => setCommentY(e.nativeEvent.layout.y + e.nativeEvent.layout.height)}>
|
|
291
|
+
<SectionTitle>
|
|
292
|
+
<OText style={theme.labels.middle as TextStyle}>{t('SPECIAL_COMMENT', 'Special comment')}</OText>
|
|
293
|
+
</SectionTitle>
|
|
294
|
+
<OInput
|
|
295
|
+
multiline
|
|
296
|
+
placeholder={t('SPECIAL_COMMENT', 'Special comment')}
|
|
297
|
+
value={productCart.comment}
|
|
298
|
+
onChange={(val: string) => handleChangeCommentState({ target: { value: val } })}
|
|
299
|
+
isDisabled={!(productCart && !isSoldOut && maxProductQuantity)}
|
|
300
|
+
style={styles.comment}
|
|
301
|
+
inputStyle={{ fontSize: 12, paddingBottom: 7, paddingTop: 17 }}
|
|
302
|
+
/>
|
|
303
|
+
</ProductComment>
|
|
306
304
|
{productCart && !isSoldOut && maxProductQuantity > 0 && (
|
|
307
305
|
<View style={{ paddingVertical: 4, marginBottom: 10 }}>
|
|
308
306
|
<SectionTitle>
|
|
@@ -235,21 +235,19 @@ 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
|
-
|
|
251
|
-
</ProductComment>
|
|
252
|
-
)}
|
|
238
|
+
<ProductComment>
|
|
239
|
+
<SectionTitle>
|
|
240
|
+
<OText style={theme.labels.middle}>{t('SPECIAL_COMMENT', 'Special comment')}</OText>
|
|
241
|
+
</SectionTitle>
|
|
242
|
+
<OInput
|
|
243
|
+
multiline
|
|
244
|
+
placeholder={t('SPECIAL_COMMENT', 'Special comment')}
|
|
245
|
+
value={productCart.comment}
|
|
246
|
+
onChange={(val: string) => handleChangeCommentState({ target: { value: val } })}
|
|
247
|
+
isDisabled={!(productCart && !isSoldOut && maxProductQuantity)}
|
|
248
|
+
style={{ ...styles.comment, borderColor: theme.colors.border }}
|
|
249
|
+
/>
|
|
250
|
+
</ProductComment>
|
|
253
251
|
</ProductEditions>
|
|
254
252
|
)}
|
|
255
253
|
</WrapContent>
|
|
@@ -438,21 +438,19 @@ 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
|
-
|
|
454
|
-
</ProductComment>
|
|
455
|
-
)}
|
|
441
|
+
<ProductComment>
|
|
442
|
+
<SectionTitle>
|
|
443
|
+
<OText size={28} weight="bold">{t('SPECIAL_COMMENT', 'Special comment')}</OText>
|
|
444
|
+
</SectionTitle>
|
|
445
|
+
<OInput
|
|
446
|
+
multiline
|
|
447
|
+
placeholder={t('SPECIAL_COMMENT', 'Special comment')}
|
|
448
|
+
value={productCart.comment}
|
|
449
|
+
onChange={(val: string) => handleChangeCommentState({ target: { value: val } })}
|
|
450
|
+
isDisabled={!(productCart && !isSoldOut && maxProductQuantity)}
|
|
451
|
+
style={styles.comment}
|
|
452
|
+
/>
|
|
453
|
+
</ProductComment>
|
|
456
454
|
</ProductEditions>
|
|
457
455
|
</WrapContent>
|
|
458
456
|
</View>
|
|
@@ -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,
|
|
@@ -17,7 +17,6 @@ export const BusinessItemAccordion = (props: any) => {
|
|
|
17
17
|
const {
|
|
18
18
|
cart,
|
|
19
19
|
moment,
|
|
20
|
-
singleBusiness,
|
|
21
20
|
handleClearProducts
|
|
22
21
|
} = props
|
|
23
22
|
|
|
@@ -30,7 +29,7 @@ export const BusinessItemAccordion = (props: any) => {
|
|
|
30
29
|
const isClosed = !cart?.valid_schedule
|
|
31
30
|
const isProducts = cart?.products?.length
|
|
32
31
|
|
|
33
|
-
const [isActive, setActiveState] = useState(
|
|
32
|
+
const [isActive, setActiveState] = useState(false)
|
|
34
33
|
|
|
35
34
|
useEffect(() => {
|
|
36
35
|
const cartsArray = Object.values(orderState?.carts)
|
|
@@ -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,7 +130,6 @@ 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}
|
|
@@ -201,7 +191,7 @@ const CartUI = (props: any) => {
|
|
|
201
191
|
cart?.fees?.length > 0 && cart?.fees?.filter((fee: any) => !(fee.fixed === 0 && fee.percentage === 0)).map((fee: any) => (
|
|
202
192
|
<OSTable key={fee?.id}>
|
|
203
193
|
<OSRow>
|
|
204
|
-
<OText numberOfLines={1}
|
|
194
|
+
<OText numberOfLines={1}>
|
|
205
195
|
{fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}{' '}
|
|
206
196
|
({parsePrice(fee?.fixed)} + {fee?.percentage}%){' '}
|
|
207
197
|
</OText>
|
|
@@ -213,15 +203,6 @@ const CartUI = (props: any) => {
|
|
|
213
203
|
</OSTable>
|
|
214
204
|
))
|
|
215
205
|
}
|
|
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
|
-
)}
|
|
225
206
|
{orderState?.options?.type === 1 && cart?.delivery_price > 0 && (
|
|
226
207
|
<OSTable>
|
|
227
208
|
<OText size={12} lineHeight={18}>{t('DELIVERY_FEE', 'Delivery Fee')}</OText>
|
|
@@ -242,14 +223,15 @@ const CartUI = (props: any) => {
|
|
|
242
223
|
<OText size={12} lineHeight={18}>{parsePrice(cart?.driver_tip)}</OText>
|
|
243
224
|
</OSTable>
|
|
244
225
|
)}
|
|
245
|
-
{cart?.
|
|
246
|
-
<OSTable
|
|
247
|
-
<OText size={12}
|
|
248
|
-
{
|
|
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)}%)`}
|
|
249
231
|
</OText>
|
|
250
|
-
<OText size={12}
|
|
232
|
+
<OText size={12} lineHeight={18}>{parsePrice(cart?.service_fee)}</OText>
|
|
251
233
|
</OSTable>
|
|
252
|
-
)
|
|
234
|
+
)}
|
|
253
235
|
{isCouponEnabled && !isCartPending && (
|
|
254
236
|
<OSTable>
|
|
255
237
|
<OSCoupon>
|
|
@@ -267,7 +249,7 @@ const CartUI = (props: any) => {
|
|
|
267
249
|
{t('TOTAL', 'Total')}
|
|
268
250
|
</OText>
|
|
269
251
|
<OText size={14} lineHeight={21} weight={'600'}>
|
|
270
|
-
{
|
|
252
|
+
{cart?.total >= 1 && parsePrice(cart?.total)}
|
|
271
253
|
</OText>
|
|
272
254
|
</OSTable>
|
|
273
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}
|
|
@@ -74,10 +74,6 @@ 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
|
-
|
|
81
77
|
export const ChPlaceOrderBtn = styled.View`
|
|
82
78
|
width: 100%;
|
|
83
79
|
display: flex;
|
|
@@ -103,4 +99,4 @@ export const DeliveryOptionItem = styled.View`
|
|
|
103
99
|
align-items: center;
|
|
104
100
|
flex-direction: row;
|
|
105
101
|
background-color: ${(props : any) => props?.backgroundColor ?? '#fff'};
|
|
106
|
-
`;
|
|
102
|
+
`;
|
|
@@ -11,7 +11,8 @@ export const FacebookLogin = (props: any) => {
|
|
|
11
11
|
const {
|
|
12
12
|
handleErrors,
|
|
13
13
|
handleLoading,
|
|
14
|
-
handleSuccessFacebookLogin
|
|
14
|
+
handleSuccessFacebookLogin,
|
|
15
|
+
notificationState
|
|
15
16
|
} = props
|
|
16
17
|
|
|
17
18
|
const [, t] = useLanguage()
|
|
@@ -30,7 +31,14 @@ export const FacebookLogin = (props: any) => {
|
|
|
30
31
|
|
|
31
32
|
const handleLoginClick = async (accessToken: string) => {
|
|
32
33
|
try {
|
|
33
|
-
const
|
|
34
|
+
const body: any = {
|
|
35
|
+
access_token: accessToken
|
|
36
|
+
}
|
|
37
|
+
if (notificationState?.notification_token) {
|
|
38
|
+
body.notification_token = notificationState.notification_token
|
|
39
|
+
body.notification_app = notificationState.notification_app
|
|
40
|
+
}
|
|
41
|
+
const response = await ordering.users().authFacebook(body)
|
|
34
42
|
if (!response.content.error) {
|
|
35
43
|
if (handleSuccessFacebookLogin) {
|
|
36
44
|
handleSuccessFacebookLogin(response.content.result)
|
|
@@ -38,9 +46,10 @@ export const FacebookLogin = (props: any) => {
|
|
|
38
46
|
}
|
|
39
47
|
} else {
|
|
40
48
|
handleLoading && handleLoading(false)
|
|
49
|
+
handleErrors && handleErrors(response.content.result)
|
|
41
50
|
logoutWithFacebook()
|
|
42
51
|
}
|
|
43
|
-
} catch (err) {
|
|
52
|
+
} catch (err: any) {
|
|
44
53
|
handleLoading && handleLoading(false)
|
|
45
54
|
handleErrors && handleErrors(err.message)
|
|
46
55
|
}
|
|
@@ -48,7 +57,7 @@ export const FacebookLogin = (props: any) => {
|
|
|
48
57
|
|
|
49
58
|
const loginWithFacebook = () => {
|
|
50
59
|
handleLoading && handleLoading(true)
|
|
51
|
-
LoginManager && LoginManager.logInWithPermissions(['public_profile']).then(
|
|
60
|
+
LoginManager && LoginManager.logInWithPermissions(['public_profile', 'email']).then(
|
|
52
61
|
(login: any) => {
|
|
53
62
|
if (login.isCancelled) {
|
|
54
63
|
const err = t('LOGIN_WITH_FACEBOOK_CANCELLED', 'Login cancelled')
|
|
@@ -58,6 +67,9 @@ export const FacebookLogin = (props: any) => {
|
|
|
58
67
|
AccessToken.getCurrentAccessToken().then((data: any) => {
|
|
59
68
|
const accessToken = data.accessToken.toString();
|
|
60
69
|
handleLoginClick(accessToken)
|
|
70
|
+
}).catch((err : any) => {
|
|
71
|
+
handleErrors && handleErrors(err.message)
|
|
72
|
+
handleLoading && handleLoading(false)
|
|
61
73
|
});
|
|
62
74
|
}
|
|
63
75
|
},
|
|
@@ -68,7 +80,10 @@ export const FacebookLogin = (props: any) => {
|
|
|
68
80
|
handleLoading && handleLoading(false)
|
|
69
81
|
handleErrors && handleErrors(err)
|
|
70
82
|
},
|
|
71
|
-
)
|
|
83
|
+
).catch((err : any) => {
|
|
84
|
+
handleErrors && handleErrors(err.message)
|
|
85
|
+
handleLoading && handleLoading(false)
|
|
86
|
+
});
|
|
72
87
|
};
|
|
73
88
|
|
|
74
89
|
const onPressButton = auth
|
|
@@ -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
|
|
51
|
+
<LastOrders onRedirect={onRedirect} />
|
|
52
52
|
</LastOrdersContainer>
|
|
53
53
|
</>
|
|
54
54
|
)
|
|
55
|
-
}
|
|
55
|
+
}
|