ordering-ui-react-native 0.12.35 → 0.12.39
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 +1 -1
- package/src/components/AddressForm/index.tsx +5 -5
- package/src/components/FacebookLogin/index.tsx +2 -2
- package/src/components/LoginForm/index.tsx +1 -1
- package/src/components/PaymentOptions/index.tsx +5 -5
- package/src/components/SignupForm/index.tsx +2 -2
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -8
- package/themes/business/src/components/LoginForm/index.tsx +1 -1
- package/themes/business/src/components/OrderDetails/Business.tsx +2 -4
- package/themes/business/src/components/OrderDetails/Delivery.tsx +111 -108
- package/themes/business/src/components/SearchBar/index.tsx +1 -1
- package/themes/business/src/components/SignupForm/index.tsx +2 -2
- package/themes/business/src/types/index.tsx +3 -3
- package/themes/doordash/src/components/AddressForm/index.tsx +5 -5
- package/themes/doordash/src/components/FacebookLogin/index.tsx +2 -2
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -1
- package/themes/doordash/src/components/PaymentOptions/index.tsx +5 -5
- package/themes/doordash/src/components/SignupForm/index.tsx +2 -2
- package/themes/franchises/src/components/AddressForm/index.tsx +5 -5
- package/themes/franchises/src/components/FacebookLogin/index.tsx +2 -2
- package/themes/franchises/src/components/LoginForm/index.tsx +1 -1
- package/themes/franchises/src/components/PaymentOptions/index.tsx +3 -3
- package/themes/franchises/src/components/SignupForm/index.tsx +2 -2
- package/themes/instacart/src/components/AddressForm/index.tsx +5 -5
- package/themes/instacart/src/components/FacebookLogin/index.tsx +2 -2
- package/themes/instacart/src/components/LoginForm/index.tsx +1 -1
- package/themes/instacart/src/components/PaymentOptions/index.tsx +4 -4
- package/themes/instacart/src/components/SignupForm/index.tsx +2 -2
- package/themes/original/src/components/AddressForm/index.tsx +5 -5
- package/themes/original/src/components/FacebookLogin/index.tsx +2 -2
- package/themes/original/src/components/LoginForm/index.tsx +1 -1
- package/themes/original/src/components/PaymentOptions/index.tsx +5 -5
- package/themes/original/src/components/SignupForm/index.tsx +2 -2
- package/themes/single-business/src/components/AddressForm/index.tsx +5 -5
- package/themes/single-business/src/components/AppleLogin/index.tsx +2 -2
- package/themes/single-business/src/components/FacebookLogin/index.tsx +2 -2
- package/themes/single-business/src/components/GoogleLogin/index.tsx +2 -2
- package/themes/single-business/src/components/LanguageSelector/index.tsx +87 -70
- package/themes/single-business/src/components/LoginForm/index.tsx +1 -1
- package/themes/single-business/src/components/OrderDetails/index.tsx +14 -14
- package/themes/single-business/src/components/PaymentOptions/index.tsx +4 -4
- package/themes/single-business/src/components/ProductForm/index.tsx +682 -656
- package/themes/single-business/src/components/ProductForm/styles.tsx +1 -1
- package/themes/single-business/src/components/SignupForm/index.tsx +2 -2
- package/themes/single-business/src/components/UserProfile/index.tsx +2 -2
- package/themes/single-business/src/components/shared/OInput.tsx +1 -0
- package/themes/single-business/src/components/shared/OLink.tsx +80 -0
- package/themes/single-business/src/components/shared/index.tsx +2 -0
- package/themes/single-business/src/types/index.tsx +1 -0
- package/themes/uber-eats/src/components/AddressForm/index.tsx +5 -5
- package/themes/uber-eats/src/components/FacebookLogin/index.tsx +2 -2
- package/themes/uber-eats/src/components/LoginForm/index.tsx +1 -1
- package/themes/uber-eats/src/components/PaymentOptions/index.tsx +5 -5
- package/themes/uber-eats/src/components/SignupForm/index.tsx +2 -2
|
@@ -2,6 +2,7 @@ import React from 'react'
|
|
|
2
2
|
import { LanguageSelector as LanguageSelectorController, useOrder } from 'ordering-components/native'
|
|
3
3
|
import { useTheme } from 'styled-components/native';
|
|
4
4
|
import { Platform, StyleSheet, View } from 'react-native'
|
|
5
|
+
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder'
|
|
5
6
|
|
|
6
7
|
import RNPickerSelect from 'react-native-picker-select'
|
|
7
8
|
import { Container } from './styles'
|
|
@@ -10,83 +11,99 @@ import { OIcon } from '../shared'
|
|
|
10
11
|
|
|
11
12
|
const LanguageSelectorUI = (props: LanguageSelectorParams) => {
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
const [orderState] = useOrder()
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
const theme = useTheme();
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
18
|
+
const _pickerStyle = StyleSheet.create({
|
|
19
|
+
inputAndroid: {
|
|
20
|
+
color: theme.colors.white,
|
|
21
|
+
borderWidth: 1,
|
|
22
|
+
borderColor: theme.colors.clear,
|
|
23
|
+
paddingHorizontal: 10,
|
|
24
|
+
paddingEnd: 24,
|
|
25
|
+
height: 40,
|
|
26
|
+
backgroundColor: theme.colors.clear,
|
|
27
|
+
},
|
|
28
|
+
inputIOS: {
|
|
29
|
+
color: theme.colors.white,
|
|
30
|
+
paddingEnd: 24,
|
|
31
|
+
height: 40,
|
|
32
|
+
borderWidth: 1,
|
|
33
|
+
borderColor: theme.colors.clear,
|
|
34
|
+
backgroundColor: theme.colors.clear
|
|
35
|
+
},
|
|
36
|
+
icon: {
|
|
37
|
+
width: 10,
|
|
38
|
+
marginTop: 9,
|
|
39
|
+
marginEnd: 10
|
|
40
|
+
},
|
|
41
|
+
placeholder: {
|
|
42
|
+
color: theme.colors.secundaryContrast
|
|
43
|
+
}
|
|
44
|
+
})
|
|
44
45
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
const {
|
|
47
|
+
languagesState,
|
|
48
|
+
currentLanguage,
|
|
49
|
+
handleChangeLanguage,
|
|
50
|
+
iconColor,
|
|
51
|
+
pickerStyle
|
|
52
|
+
} = props
|
|
52
53
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
54
|
+
const _languages = languagesState?.languages?.map((language: any) => {
|
|
55
|
+
return {
|
|
56
|
+
value: language?.code,
|
|
57
|
+
label: language?.name,
|
|
58
|
+
inputLabel: language?.name
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
_languages && _languages.sort((a: any, b: any) =>
|
|
62
|
+
(a.content > b.content) ? 1 : ((b.content > a.content) ? -1 : 0)
|
|
63
|
+
)
|
|
63
64
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
65
|
+
return (
|
|
66
|
+
languagesState?.loading && props.allowLoading ? (
|
|
67
|
+
<Container>
|
|
68
|
+
<Placeholder style={{ width: 100, paddingTop: 10 }} Animation={Fade}>
|
|
69
|
+
<PlaceholderLine height={20} style={{ paddingBottom: 0, marginBottom: 0 }} />
|
|
70
|
+
</Placeholder>
|
|
71
|
+
</Container>
|
|
72
|
+
) : (
|
|
73
|
+
<Container>
|
|
74
|
+
{languagesState?.languages ? (
|
|
75
|
+
<>
|
|
76
|
+
{iconColor && <OIcon src={theme.images.general.language} color={iconColor} style={{ marginEnd: 14 }} width={16} />}
|
|
77
|
+
<RNPickerSelect
|
|
78
|
+
onValueChange={handleChangeLanguage}
|
|
79
|
+
items={_languages || []}
|
|
80
|
+
value={currentLanguage}
|
|
81
|
+
style={pickerStyle ? pickerStyle : _pickerStyle}
|
|
82
|
+
useNativeAndroidPickerStyle={false}
|
|
83
|
+
placeholder={{}}
|
|
84
|
+
Icon={() => (
|
|
85
|
+
<View
|
|
86
|
+
style={pickerStyle ? pickerStyle.icon : _pickerStyle.icon}
|
|
87
|
+
>
|
|
88
|
+
<OIcon src={theme.images.general.arrow_down} color={theme.colors.white} style={{ width: '100%' }} />
|
|
89
|
+
</View>
|
|
90
|
+
)}
|
|
91
|
+
disabled={orderState.loading}
|
|
92
|
+
/>
|
|
93
|
+
</>
|
|
94
|
+
) : (
|
|
95
|
+
<View style={{ height: 40 }} />
|
|
96
|
+
)}
|
|
97
|
+
</Container>
|
|
98
|
+
)
|
|
99
|
+
)
|
|
83
100
|
}
|
|
84
101
|
|
|
85
102
|
export const LanguageSelector = (props: LanguageSelectorParams) => {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
103
|
+
const LanguageProps = {
|
|
104
|
+
...props,
|
|
105
|
+
UIComponent: LanguageSelectorUI
|
|
106
|
+
}
|
|
90
107
|
|
|
91
|
-
|
|
108
|
+
return <LanguageSelectorController {...LanguageProps} />
|
|
92
109
|
}
|
|
@@ -381,7 +381,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
381
381
|
handleData={(val: any) => setPhoneInputData(val)}
|
|
382
382
|
textInputProps={{
|
|
383
383
|
returnKeyType: 'next',
|
|
384
|
-
onSubmitEditing: () => inputRef
|
|
384
|
+
onSubmitEditing: () => inputRef?.current?.focus?.(),
|
|
385
385
|
}}
|
|
386
386
|
/>
|
|
387
387
|
</View>
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
OrderDriver,
|
|
37
37
|
Map,
|
|
38
38
|
} from './styles';
|
|
39
|
-
import { OButton, OIcon, OModal, OText } from '../shared';
|
|
39
|
+
import { OButton, OIcon, OModal, OText, OLink } from '../shared';
|
|
40
40
|
import { ProductItemAccordion } from '../ProductItemAccordion';
|
|
41
41
|
import { TouchableOpacity } from 'react-native-gesture-handler';
|
|
42
42
|
import { OrderDetailsParams } from '../../types';
|
|
@@ -487,19 +487,19 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
487
487
|
{order?.business?.name}
|
|
488
488
|
</OText>
|
|
489
489
|
<Icons>
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
490
|
+
{(!!order?.business?.cellphone || !!order?.business?.phone) && (
|
|
491
|
+
<View style={{ paddingEnd: 5 }}>
|
|
492
|
+
<OLink
|
|
493
|
+
url={`tel:${order?.business?.cellphone ?? order?.business?.phone}`}
|
|
494
|
+
>
|
|
495
|
+
<OIcon
|
|
496
|
+
src={theme.images.general.phone}
|
|
497
|
+
width={16}
|
|
498
|
+
color={theme.colors.disabled}
|
|
499
|
+
/>
|
|
500
|
+
</OLink>
|
|
501
|
+
</View>
|
|
502
|
+
)}
|
|
503
503
|
<TouchableOpacity
|
|
504
504
|
style={{ paddingStart: 5 }}
|
|
505
505
|
onPress={() => handleOpenMessagesForBusiness()}>
|
|
@@ -240,7 +240,7 @@ const PaymentOptionsUI = (props: any) => {
|
|
|
240
240
|
)}
|
|
241
241
|
|
|
242
242
|
{/* Stripe */}
|
|
243
|
-
{isOpenMethod?.paymethod?.gateway === 'stripe' && !paymethodData
|
|
243
|
+
{isOpenMethod?.paymethod?.gateway === 'stripe' && !paymethodData?.id && (
|
|
244
244
|
<View>
|
|
245
245
|
<OButton
|
|
246
246
|
text={t('ADD_PAYMENT_CARD', 'Add New Payment Card')}
|
|
@@ -290,7 +290,7 @@ const PaymentOptionsUI = (props: any) => {
|
|
|
290
290
|
<OModal
|
|
291
291
|
entireModal
|
|
292
292
|
title={t('ADD_CREDIT_OR_DEBIT_CARD', 'Add credit or debit card')}
|
|
293
|
-
open={isOpenMethod?.paymethod?.gateway === 'stripe_direct' && !paymethodData
|
|
293
|
+
open={isOpenMethod?.paymethod?.gateway === 'stripe_direct' && !paymethodData?.id}
|
|
294
294
|
onClose={() => handlePaymethodClick(null)}
|
|
295
295
|
>
|
|
296
296
|
<KeyboardAvoidingView
|
|
@@ -308,7 +308,7 @@ const PaymentOptionsUI = (props: any) => {
|
|
|
308
308
|
</OModal>
|
|
309
309
|
|
|
310
310
|
{/* Stripe Connect */}
|
|
311
|
-
{isOpenMethod?.paymethod?.gateway === 'stripe_connect' && !paymethodData
|
|
311
|
+
{isOpenMethod?.paymethod?.gateway === 'stripe_connect' && !paymethodData?.id && (
|
|
312
312
|
<View>
|
|
313
313
|
<OButton
|
|
314
314
|
text={t('ADD_PAYMENT_CARD', 'Add New Payment Card')}
|
|
@@ -374,7 +374,7 @@ const PaymentOptionsUI = (props: any) => {
|
|
|
374
374
|
{/* Paypal */}
|
|
375
375
|
{/* <Modal
|
|
376
376
|
className='modal-info'
|
|
377
|
-
open={paymethodSelected?.gateway === 'paypal' && !paymethodData
|
|
377
|
+
open={paymethodSelected?.gateway === 'paypal' && !paymethodData?.id}
|
|
378
378
|
onClose={() => handlePaymethodClick(null)}
|
|
379
379
|
title={t('PAY_WITH_PAYPAL', 'Pay with PayPal')}
|
|
380
380
|
>
|