ordering-ui-react-native 0.15.22 → 0.15.23-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 +5 -3
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessTypeFilter/index.tsx +12 -2
- package/src/components/BusinessTypeFilter/styles.tsx +1 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +0 -1
- package/src/components/LanguageSelector/index.tsx +1 -0
- package/src/components/OrderDetails/index.tsx +2 -2
- package/src/components/PaymentOptions/index.tsx +9 -16
- package/src/components/PaymentOptionsWebView/index.tsx +123 -124
- package/src/components/StripeElementsForm/index.tsx +27 -48
- package/src/components/UserProfileForm/index.tsx +63 -6
- package/src/components/UserProfileForm/styles.tsx +8 -0
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/config.json +0 -2
- package/src/navigators/HomeNavigator.tsx +6 -0
- package/src/pages/BusinessProductsList.tsx +1 -0
- package/src/pages/BusinessesListing.tsx +1 -1
- package/src/pages/Checkout.tsx +1 -1
- package/src/pages/Sessions.tsx +22 -0
- package/src/types/index.tsx +2 -9
- package/src/utils/index.tsx +68 -1
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +56 -8
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +5 -0
- package/themes/business/src/components/Chat/index.tsx +38 -86
- package/themes/business/src/components/Home/index.tsx +128 -55
- package/themes/business/src/components/Home/styles.tsx +8 -1
- package/themes/business/src/components/NewOrderNotification/index.tsx +59 -98
- package/themes/business/src/components/OrderDetails/Business.tsx +2 -1
- package/themes/business/src/components/OrderDetails/Delivery.tsx +22 -13
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +151 -89
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +91 -17
- package/themes/business/src/components/OrderDetails/styles.tsx +7 -0
- package/themes/business/src/components/OrdersListManager/index.tsx +874 -0
- package/themes/business/src/components/OrdersListManager/styles.tsx +123 -0
- package/themes/business/src/components/OrdersListManager/utils.tsx +216 -0
- package/themes/business/src/components/OrdersOption/index.tsx +53 -49
- package/themes/business/src/components/PreviousOrders/index.tsx +75 -22
- package/themes/business/src/types/index.tsx +2 -1
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/kiosk/src/components/BusinessController/index.tsx +27 -6
- package/themes/kiosk/src/components/BusinessController/styles.tsx +1 -1
- package/themes/kiosk/src/components/BusinessProductsListing/index.tsx +48 -21
- package/themes/kiosk/src/components/Cart/index.tsx +98 -24
- package/themes/kiosk/src/components/Cart/styles.tsx +6 -0
- package/themes/kiosk/src/components/CartBottomSheet/index.tsx +1 -1
- package/themes/kiosk/src/components/CartBottomSheet/styles.tsx +1 -1
- package/themes/kiosk/src/components/CartContent/index.tsx +13 -3
- package/themes/kiosk/src/components/CartItem/index.tsx +20 -8
- package/themes/kiosk/src/components/CategoriesMenu/index.tsx +6 -5
- package/themes/kiosk/src/components/CustomerName/index.tsx +89 -88
- package/themes/kiosk/src/components/Intro/index.tsx +13 -13
- package/themes/kiosk/src/components/LanguageSelector/index.tsx +12 -8
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderDetails/index.tsx +136 -41
- package/themes/kiosk/src/components/OrderDetails/styles.tsx +5 -0
- package/themes/kiosk/src/components/OrderSummary/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +10 -12
- package/themes/kiosk/src/components/ProductForm/index.tsx +174 -125
- package/themes/kiosk/src/components/ProductForm/styles.tsx +1 -1
- package/themes/kiosk/src/components/ProductOption/index.tsx +1 -0
- package/themes/kiosk/src/components/ProductOption/styles.tsx +1 -0
- package/themes/kiosk/src/components/UpsellingProducts/index.tsx +48 -34
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/components/shared/OCard.tsx +112 -78
- package/themes/kiosk/src/types/index.d.ts +2 -0
- package/themes/original/index.tsx +178 -1
- package/themes/original/src/components/AddressForm/index.tsx +15 -10
- package/themes/original/src/components/AddressList/index.tsx +56 -18
- package/themes/original/src/components/AppleLogin/index.tsx +117 -78
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +96 -45
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +28 -1
- package/themes/original/src/components/BusinessController/index.tsx +52 -22
- package/themes/original/src/components/BusinessController/styles.tsx +22 -0
- package/themes/original/src/components/BusinessFeaturedController/index.tsx +20 -1
- package/themes/original/src/components/BusinessFeaturedController/styles.tsx +23 -0
- package/themes/original/src/components/BusinessListingSearch/index.tsx +4 -0
- package/themes/original/src/components/BusinessMenuList/index.tsx +11 -4
- package/themes/original/src/components/BusinessPreorder/index.tsx +141 -121
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +7 -5
- package/themes/original/src/components/BusinessProductsList/index.tsx +127 -20
- package/themes/original/src/components/BusinessProductsList/styles.tsx +29 -2
- package/themes/original/src/components/BusinessProductsListing/index.tsx +92 -37
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +22 -0
- package/themes/original/src/components/BusinessReviews/index.tsx +4 -25
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +1 -2
- package/themes/original/src/components/BusinessesListing/index.tsx +48 -57
- package/themes/original/src/components/Cart/index.tsx +18 -14
- package/themes/original/src/components/CartContent/index.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +42 -27
- package/themes/original/src/components/ForgotPasswordForm/index.tsx +84 -4
- package/themes/original/src/components/GoogleMap/index.tsx +1 -0
- package/themes/original/src/components/Help/index.tsx +21 -4
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +97 -89
- package/themes/original/src/components/Home/index.tsx +1 -1
- package/themes/original/src/components/LastOrders/index.tsx +12 -1
- package/themes/original/src/components/LoginForm/index.tsx +73 -2
- package/themes/original/src/components/LoginForm/styles.tsx +6 -1
- package/themes/original/src/components/MessageListing/index.tsx +10 -1
- package/themes/original/src/components/Messages/index.tsx +34 -25
- package/themes/original/src/components/Messages/styles.tsx +1 -3
- package/themes/original/src/components/MomentOption/index.tsx +10 -1
- package/themes/original/src/components/MomentOption/styles.tsx +1 -1
- package/themes/original/src/components/OrderDetails/index.tsx +34 -27
- package/themes/original/src/components/OrderDetails/styles.tsx +1 -2
- package/themes/original/src/components/OrderProgress/index.tsx +4 -4
- package/themes/original/src/components/OrderProgress/styles.tsx +1 -0
- package/themes/original/src/components/OrderSummary/index.tsx +2 -2
- package/themes/original/src/components/OrderTypeSelector/index.tsx +4 -2
- package/themes/original/src/components/OrdersOption/index.tsx +25 -33
- package/themes/original/src/components/OrdersOption/styles.tsx +0 -6
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +10 -4
- package/themes/original/src/components/PaymentOptionWallet/styles.tsx +1 -1
- package/themes/original/src/components/PaymentOptions/index.tsx +9 -19
- package/themes/original/src/components/PreviousOrders/index.tsx +19 -13
- package/themes/original/src/components/ProductForm/index.tsx +40 -33
- package/themes/original/src/components/ProductForm/styles.tsx +2 -2
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +5 -3
- package/themes/original/src/components/Promotions/index.tsx +250 -0
- package/themes/original/src/components/Promotions/styles.tsx +60 -0
- package/themes/original/src/components/ReviewOrder/index.tsx +10 -9
- package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
- package/themes/original/src/components/Sessions/index.tsx +160 -0
- package/themes/original/src/components/Sessions/styles.tsx +15 -0
- package/themes/original/src/components/SingleProductCard/index.tsx +47 -21
- package/themes/original/src/components/SingleProductCard/styles.tsx +28 -1
- package/themes/original/src/components/StripeElementsForm/index.tsx +55 -72
- package/themes/original/src/components/TaxInformation/index.tsx +10 -4
- package/themes/original/src/components/UpsellingProducts/index.tsx +87 -71
- package/themes/original/src/components/UserDetails/index.tsx +4 -95
- package/themes/original/src/components/UserFormDetails/index.tsx +32 -31
- package/themes/original/src/components/UserProfile/index.tsx +62 -14
- package/themes/original/src/components/UserProfileForm/index.tsx +20 -18
- package/themes/original/src/components/VerifyPhone/index.tsx +10 -7
- package/themes/original/src/components/VerifyPhone/styles.tsx +2 -1
- package/themes/original/src/components/Wallets/index.tsx +75 -8
- package/themes/original/src/components/Wallets/styles.tsx +21 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +21 -0
- package/themes/original/src/components/shared/index.tsx +2 -0
- package/themes/original/src/config/constants.tsx +6 -6
- package/themes/original/src/types/index.tsx +46 -4
- package/themes/original/src/utils/index.tsx +12 -2
- package/themes/single-business/src/components/AddressList/index.tsx +1 -1
- package/themes/single-business/src/components/OrderTypeSelector/index.tsx +6 -6
- package/themes/single-business/src/components/UserProfile/index.tsx +1 -1
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/StripeMethodForm/index.tsx +0 -168
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
BusinessList as BusinessesListingController,
|
|
4
4
|
useLanguage,
|
|
5
|
-
|
|
5
|
+
useOrder
|
|
6
6
|
} from 'ordering-components/native';
|
|
7
7
|
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
|
|
8
8
|
import { View, ScrollView, Platform, Dimensions } from 'react-native';
|
|
@@ -24,117 +24,125 @@ const HighestRatedBusinessesUI = (props: HighestRatedBusinessesParams) => {
|
|
|
24
24
|
} = props;
|
|
25
25
|
|
|
26
26
|
const [, t] = useLanguage()
|
|
27
|
-
|
|
27
|
+
const [orderState] = useOrder()
|
|
28
28
|
|
|
29
29
|
const windowWidth = Dimensions.get('window').width;
|
|
30
30
|
|
|
31
31
|
useEffect(() => {
|
|
32
|
-
if (businessesList?.loading || !isLoading) return
|
|
32
|
+
if (businessesList?.loading || !isLoading) return
|
|
33
33
|
getBusinesses(true)
|
|
34
34
|
}, [isLoading])
|
|
35
35
|
|
|
36
36
|
return (
|
|
37
37
|
<>
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
justifyContent: 'space-between',
|
|
71
|
-
}}>
|
|
72
|
-
<PlaceholderLine
|
|
73
|
-
height={15}
|
|
74
|
-
width={40}
|
|
75
|
-
style={{ marginBottom: 15 }}
|
|
76
|
-
/>
|
|
77
|
-
<PlaceholderLine
|
|
78
|
-
height={15}
|
|
79
|
-
width={20}
|
|
80
|
-
style={{ marginBottom: 15 }}
|
|
81
|
-
/>
|
|
82
|
-
</View>
|
|
38
|
+
|
|
39
|
+
{businessesList.loading ? (
|
|
40
|
+
<>
|
|
41
|
+
<ScrollView
|
|
42
|
+
showsHorizontalScrollIndicator={false}
|
|
43
|
+
nestedScrollEnabled
|
|
44
|
+
horizontal
|
|
45
|
+
style={{ height: 300, paddingHorizontal: 40 }}
|
|
46
|
+
>
|
|
47
|
+
{[
|
|
48
|
+
...Array(10).keys()
|
|
49
|
+
].map((item, i) => (
|
|
50
|
+
<Placeholder
|
|
51
|
+
Animation={Fade}
|
|
52
|
+
key={i}
|
|
53
|
+
style={{
|
|
54
|
+
marginTop: 20,
|
|
55
|
+
width: windowWidth - 100,
|
|
56
|
+
paddingHorizontal: 5,
|
|
57
|
+
height: '100%'
|
|
58
|
+
}}>
|
|
59
|
+
<View style={{ width: '100%' }}>
|
|
60
|
+
<PlaceholderLine
|
|
61
|
+
height={150}
|
|
62
|
+
style={{ marginBottom: 20, borderRadius: 8 }}
|
|
63
|
+
/>
|
|
64
|
+
<View style={{ paddingHorizontal: 10 }}>
|
|
65
|
+
<View
|
|
66
|
+
style={{
|
|
67
|
+
flexDirection: 'row',
|
|
68
|
+
justifyContent: 'space-between',
|
|
69
|
+
}}>
|
|
83
70
|
<PlaceholderLine
|
|
84
71
|
height={15}
|
|
85
|
-
width={
|
|
86
|
-
style={{ marginBottom:
|
|
72
|
+
width={40}
|
|
73
|
+
style={{ marginBottom: 15 }}
|
|
87
74
|
/>
|
|
88
75
|
<PlaceholderLine
|
|
89
76
|
height={15}
|
|
90
|
-
width={
|
|
91
|
-
style={{ marginBottom:
|
|
77
|
+
width={20}
|
|
78
|
+
style={{ marginBottom: 15 }}
|
|
92
79
|
/>
|
|
93
80
|
</View>
|
|
81
|
+
<PlaceholderLine
|
|
82
|
+
height={15}
|
|
83
|
+
width={30}
|
|
84
|
+
style={{ marginBottom: 10 }}
|
|
85
|
+
/>
|
|
86
|
+
<PlaceholderLine
|
|
87
|
+
height={15}
|
|
88
|
+
width={80}
|
|
89
|
+
style={{ marginBottom: 10 }}
|
|
90
|
+
/>
|
|
94
91
|
</View>
|
|
95
|
-
</
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
92
|
+
</View>
|
|
93
|
+
</Placeholder>
|
|
94
|
+
))}
|
|
95
|
+
</ScrollView>
|
|
96
|
+
</>
|
|
97
|
+
) : (
|
|
98
|
+
<>
|
|
99
|
+
{businessesList.businesses.length > 0 && (
|
|
100
|
+
<ListWrapper>
|
|
101
|
+
<OText size={16} mBottom={5} weight={Platform.OS === 'ios' ? '600' : 'bold'}>{t('HIGHEST_RATED', 'Highest rated')}</OText>
|
|
102
|
+
<OText size={12}>{t('TOP_RATINGS_AND_GREAT_SERVICE', 'Top ratings and great service')}</OText>
|
|
103
|
+
<ScrollView
|
|
104
|
+
showsHorizontalScrollIndicator={false}
|
|
105
|
+
nestedScrollEnabled
|
|
106
|
+
horizontal
|
|
107
|
+
style={{ height: 300 }}
|
|
108
|
+
>
|
|
109
|
+
{
|
|
110
|
+
businessesList.businesses?.map(
|
|
111
|
+
(business: any) => (
|
|
112
|
+
<View
|
|
113
|
+
key={business.id}
|
|
114
|
+
style={{
|
|
115
|
+
width: windowWidth - 100,
|
|
116
|
+
paddingHorizontal: 5,
|
|
117
|
+
height: '100%'
|
|
118
|
+
}}
|
|
119
|
+
>
|
|
120
|
+
<BusinessController
|
|
121
|
+
business={business}
|
|
122
|
+
isBusinessOpen={business?.open}
|
|
123
|
+
handleCustomClick={onBusinessClick}
|
|
124
|
+
orderType={orderState?.options?.type}
|
|
125
|
+
navigation={navigation}
|
|
126
|
+
/>
|
|
127
|
+
</View>
|
|
128
|
+
)
|
|
119
129
|
)
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
)}
|
|
124
|
-
</>
|
|
130
|
+
}
|
|
131
|
+
</ScrollView>
|
|
132
|
+
</ListWrapper>
|
|
125
133
|
)}
|
|
126
|
-
|
|
127
|
-
|
|
134
|
+
</>
|
|
135
|
+
)}
|
|
128
136
|
</>
|
|
129
137
|
)
|
|
130
138
|
}
|
|
131
139
|
|
|
132
140
|
export const HighestRatedBusinesses = (props: any) => {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
141
|
+
const highestRatedBusinessesProps = {
|
|
142
|
+
...props,
|
|
143
|
+
UIComponent: HighestRatedBusinessesUI,
|
|
136
144
|
initialOrderByValue: 'rating'
|
|
137
|
-
|
|
145
|
+
};
|
|
138
146
|
|
|
139
|
-
|
|
147
|
+
return <BusinessesListingController {...highestRatedBusinessesProps} />;
|
|
140
148
|
};
|
|
@@ -36,7 +36,7 @@ export const Home = (props: any) => {
|
|
|
36
36
|
{t('WELCOME', 'Welcome!')}
|
|
37
37
|
</OText>
|
|
38
38
|
<OText color={theme.colors.white} size={14} style={{ marginBottom: 46 }}>
|
|
39
|
-
{t('
|
|
39
|
+
{t('SUBTITLE_HOME', "Let's start to order now")}
|
|
40
40
|
</OText>
|
|
41
41
|
<OButton
|
|
42
42
|
text={t('LOGIN_NOW', 'Login now')}
|
|
@@ -18,11 +18,15 @@ import {
|
|
|
18
18
|
OrderContainer,
|
|
19
19
|
OrderInfo
|
|
20
20
|
} from './styles'
|
|
21
|
+
import { useEffect } from 'react'
|
|
21
22
|
|
|
22
23
|
const LastOrdersUI = (props: LastOrdersParams) => {
|
|
23
24
|
const {
|
|
24
25
|
orderList,
|
|
25
|
-
onRedirect
|
|
26
|
+
onRedirect,
|
|
27
|
+
loadOrders,
|
|
28
|
+
refresh,
|
|
29
|
+
setRefresh
|
|
26
30
|
} = props
|
|
27
31
|
const { loading, error, orders } = orderList
|
|
28
32
|
|
|
@@ -46,6 +50,13 @@ const LastOrdersUI = (props: LastOrdersParams) => {
|
|
|
46
50
|
onRedirect && onRedirect('OrderDetails', { orderId: uuid })
|
|
47
51
|
}
|
|
48
52
|
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if(refresh){
|
|
55
|
+
loadOrders(false, false, false, true)
|
|
56
|
+
setRefresh && setRefresh(false)
|
|
57
|
+
}
|
|
58
|
+
}, [refresh])
|
|
59
|
+
|
|
49
60
|
return (
|
|
50
61
|
<>
|
|
51
62
|
{loading ? (
|
|
@@ -4,6 +4,7 @@ import Spinner from 'react-native-loading-spinner-overlay';
|
|
|
4
4
|
import { useForm, Controller } from 'react-hook-form';
|
|
5
5
|
import { PhoneInputNumber } from '../PhoneInputNumber';
|
|
6
6
|
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
|
|
7
|
+
import Recaptcha from 'react-native-recaptcha-that-works'
|
|
7
8
|
|
|
8
9
|
import {
|
|
9
10
|
LoginForm as LoginFormController,
|
|
@@ -18,7 +19,6 @@ import { FacebookLogin } from '../FacebookLogin';
|
|
|
18
19
|
import { VerifyPhone } from '../../../../../src/components/VerifyPhone';
|
|
19
20
|
import { OModal } from '../../../../../src/components/shared';
|
|
20
21
|
|
|
21
|
-
|
|
22
22
|
import {
|
|
23
23
|
Container,
|
|
24
24
|
ButtonsWrapper,
|
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
LineSeparator,
|
|
33
33
|
SkeletonWrapper,
|
|
34
34
|
TabBtn,
|
|
35
|
+
RecaptchaButton
|
|
35
36
|
} from './styles';
|
|
36
37
|
|
|
37
38
|
import NavBar from '../NavBar';
|
|
@@ -60,7 +61,9 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
60
61
|
handleSendVerifyCode,
|
|
61
62
|
handleCheckPhoneCode,
|
|
62
63
|
onNavigationRedirect,
|
|
63
|
-
notificationState
|
|
64
|
+
notificationState,
|
|
65
|
+
handleReCaptcha,
|
|
66
|
+
enableReCaptcha
|
|
64
67
|
} = props;
|
|
65
68
|
|
|
66
69
|
const [, { showToast }] = useToast();
|
|
@@ -79,6 +82,8 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
79
82
|
cellphone: null,
|
|
80
83
|
},
|
|
81
84
|
});
|
|
85
|
+
const [recaptchaConfig, setRecaptchaConfig] = useState<any>({})
|
|
86
|
+
const [recaptchaVerified, setRecaptchaVerified] = useState(false)
|
|
82
87
|
|
|
83
88
|
const theme = useTheme();
|
|
84
89
|
|
|
@@ -100,10 +105,15 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
100
105
|
flexGrow: 1,
|
|
101
106
|
marginBottom: 7,
|
|
102
107
|
},
|
|
108
|
+
recaptchaIcon: {
|
|
109
|
+
width: 100,
|
|
110
|
+
height: 100,
|
|
111
|
+
}
|
|
103
112
|
});
|
|
104
113
|
|
|
105
114
|
const emailRef = useRef<any>({});
|
|
106
115
|
const passwordRef = useRef<any>({});
|
|
116
|
+
const recaptchaRef = useRef<any>({});
|
|
107
117
|
|
|
108
118
|
const handleChangeTab = (val: string) => {
|
|
109
119
|
props.handleChangeTab(val);
|
|
@@ -156,6 +166,33 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
156
166
|
onChange(value.toLowerCase().replace(/[&,()%";:ç?<>{}\\[\]\s]/g, ''));
|
|
157
167
|
};
|
|
158
168
|
|
|
169
|
+
const handleOpenRecaptcha = () => {
|
|
170
|
+
setRecaptchaVerified(false)
|
|
171
|
+
if (!recaptchaConfig?.siteKey) {
|
|
172
|
+
showToast(ToastType.Error, t('NO_RECAPTCHA_SITE_KEY', 'The config doesn\'t have recaptcha site key'));
|
|
173
|
+
return
|
|
174
|
+
}
|
|
175
|
+
if (!recaptchaConfig?.baseUrl) {
|
|
176
|
+
showToast(ToastType.Error, t('NO_RECAPTCHA_BASE_URL', 'The config doesn\'t have recaptcha base url'));
|
|
177
|
+
return
|
|
178
|
+
}
|
|
179
|
+
recaptchaRef.current.open()
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
const onRecaptchaVerify = (token: any) => {
|
|
183
|
+
setRecaptchaVerified(true)
|
|
184
|
+
handleReCaptcha(token)
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
useEffect(() => {
|
|
188
|
+
if (configs && Object.keys(configs).length > 0 && enableReCaptcha) {
|
|
189
|
+
setRecaptchaConfig({
|
|
190
|
+
siteKey: configs?.security_recaptcha_site_key?.value || null,
|
|
191
|
+
baseUrl: configs?.security_recaptcha_base_url?.value || null
|
|
192
|
+
})
|
|
193
|
+
}
|
|
194
|
+
}, [configs, enableReCaptcha])
|
|
195
|
+
|
|
159
196
|
useEffect(() => {
|
|
160
197
|
if (!formState.loading && formState.result?.error) {
|
|
161
198
|
formState.result?.result &&
|
|
@@ -399,6 +436,39 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
399
436
|
</OText>
|
|
400
437
|
</TouchableOpacity>
|
|
401
438
|
)}
|
|
439
|
+
|
|
440
|
+
{enableReCaptcha && (
|
|
441
|
+
<>
|
|
442
|
+
<TouchableOpacity
|
|
443
|
+
onPress={handleOpenRecaptcha}
|
|
444
|
+
>
|
|
445
|
+
<RecaptchaButton>
|
|
446
|
+
{recaptchaVerified ? (
|
|
447
|
+
<MaterialCommunityIcons
|
|
448
|
+
name="checkbox-marked"
|
|
449
|
+
size={26}
|
|
450
|
+
color={theme.colors.primary}
|
|
451
|
+
/>
|
|
452
|
+
) : (
|
|
453
|
+
<MaterialCommunityIcons
|
|
454
|
+
name="checkbox-blank-outline"
|
|
455
|
+
size={26}
|
|
456
|
+
color={theme.colors.mediumGray}
|
|
457
|
+
/>
|
|
458
|
+
)}
|
|
459
|
+
<OText size={14} mLeft={8}>{t('VERIFY_ReCAPTCHA', 'Verify reCAPTCHA')}</OText>
|
|
460
|
+
</RecaptchaButton>
|
|
461
|
+
</TouchableOpacity>
|
|
462
|
+
<Recaptcha
|
|
463
|
+
ref={recaptchaRef}
|
|
464
|
+
siteKey={recaptchaConfig?.siteKey}
|
|
465
|
+
baseUrl={recaptchaConfig?.baseUrl}
|
|
466
|
+
onVerify={onRecaptchaVerify}
|
|
467
|
+
onExpire={() => setRecaptchaVerified(false)}
|
|
468
|
+
/>
|
|
469
|
+
</>
|
|
470
|
+
)}
|
|
471
|
+
|
|
402
472
|
<OButton
|
|
403
473
|
onClick={handleSubmit(onSubmit)}
|
|
404
474
|
text={loginButtonText}
|
|
@@ -559,6 +629,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
559
629
|
export const LoginForm = (props: any) => {
|
|
560
630
|
const loginProps = {
|
|
561
631
|
...props,
|
|
632
|
+
isRecaptchaEnable: true,
|
|
562
633
|
UIComponent: LoginFormUI,
|
|
563
634
|
};
|
|
564
635
|
return <LoginFormController {...loginProps} />;
|
|
@@ -36,7 +36,7 @@ export const LoginWith = styled.View`
|
|
|
36
36
|
width: 100%;
|
|
37
37
|
align-items: flex-start;
|
|
38
38
|
border-bottom-width: 1px;
|
|
39
|
-
border-bottom-color: ${(props: any) => props.theme.colors.border}
|
|
39
|
+
border-bottom-color: ${(props: any) => props.theme.colors.border};
|
|
40
40
|
`;
|
|
41
41
|
|
|
42
42
|
export const FormInput = styled.View`
|
|
@@ -80,3 +80,8 @@ export const LineSeparator = styled.View`
|
|
|
80
80
|
export const SkeletonWrapper = styled.View`
|
|
81
81
|
width: 90%;
|
|
82
82
|
`
|
|
83
|
+
export const RecaptchaButton = styled.View`
|
|
84
|
+
flex-direction: row;
|
|
85
|
+
align-items: center;
|
|
86
|
+
margin-bottom: 10px;
|
|
87
|
+
`
|
|
@@ -36,7 +36,9 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
36
36
|
loadOrders,
|
|
37
37
|
setSelectedOrderId,
|
|
38
38
|
setOrderList,
|
|
39
|
-
setOpenMessges
|
|
39
|
+
setOpenMessges,
|
|
40
|
+
setRefreshOrders,
|
|
41
|
+
refreshOrders
|
|
40
42
|
} = props
|
|
41
43
|
|
|
42
44
|
const theme = useTheme();
|
|
@@ -99,6 +101,13 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
99
101
|
setOrderList(orderList)
|
|
100
102
|
}, [orderList, loading])
|
|
101
103
|
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
if(refreshOrders){
|
|
106
|
+
loadOrders(false, false, false, true)
|
|
107
|
+
setRefreshOrders && setRefreshOrders(false)
|
|
108
|
+
}
|
|
109
|
+
}, [refreshOrders])
|
|
110
|
+
|
|
102
111
|
return (
|
|
103
112
|
<>
|
|
104
113
|
{!loading && orders.length === 0 && (
|
|
@@ -39,7 +39,7 @@ const ORDER_STATUS: any = {
|
|
|
39
39
|
23: 'ORDER_DRIVER_ON_WAY'
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
const filterSpecialStatus = ['prepared_in', 'delivered_in']
|
|
42
|
+
const filterSpecialStatus = ['prepared_in', 'delivered_in', 'delivery_datetime']
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
const MessagesUI = (props: MessagesParams) => {
|
|
@@ -332,30 +332,34 @@ const MessagesUI = (props: MessagesParams) => {
|
|
|
332
332
|
)
|
|
333
333
|
)
|
|
334
334
|
|
|
335
|
-
const renderSend = (props: any) =>
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
335
|
+
const renderSend = (props: any) => {
|
|
336
|
+
const isDisabled = (sendMessage?.loading || (message === '' && !image) || messages?.loading)
|
|
337
|
+
return (
|
|
338
|
+
<Send
|
|
339
|
+
{...props}
|
|
340
|
+
disabled={isDisabled}
|
|
341
|
+
alwaysShowSend
|
|
342
|
+
containerStyle={styles.containerSend}
|
|
343
|
+
>
|
|
344
|
+
<OIconButton
|
|
345
|
+
onClick={onSubmit}
|
|
346
|
+
style={{
|
|
347
|
+
height: 44,
|
|
348
|
+
width: 44,
|
|
349
|
+
borderRadius: 7.6,
|
|
350
|
+
opacity: isDisabled ? 0.2 : 1,
|
|
351
|
+
borderColor: isDisabled ? theme.colors.secondary : theme.colors.primary,
|
|
352
|
+
backgroundColor: isDisabled ? theme.colors.secondary : theme.colors.primary,
|
|
353
|
+
}}
|
|
354
|
+
iconStyle={{ marginTop: 3, marginRight: 2 }}
|
|
355
|
+
icon={theme.images.general.enter}
|
|
356
|
+
iconColor={isDisabled ? '#000' : '#fff'}
|
|
357
|
+
disabled={isDisabled}
|
|
358
|
+
disabledColor={theme.colors.secondary}
|
|
359
|
+
/>
|
|
360
|
+
</Send>
|
|
361
|
+
)
|
|
362
|
+
}
|
|
359
363
|
|
|
360
364
|
const renderBubble = (props: any) => (
|
|
361
365
|
<Bubble
|
|
@@ -536,6 +540,11 @@ const styles = StyleSheet.create({
|
|
|
536
540
|
|
|
537
541
|
export const Messages = (props: MessagesParams) => {
|
|
538
542
|
const [allMessages, setAllMessages] = useState(props.messages)
|
|
543
|
+
|
|
544
|
+
useEffect(() => {
|
|
545
|
+
setAllMessages(props.messages)
|
|
546
|
+
}, [props.messages])
|
|
547
|
+
|
|
539
548
|
const MessagesProps = {
|
|
540
549
|
...props,
|
|
541
550
|
UIComponent: MessagesUI,
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
1
|
import styled, { css } from 'styled-components/native'
|
|
3
2
|
|
|
4
|
-
|
|
5
3
|
export const Wrapper = styled.View`
|
|
6
4
|
flex: 1;
|
|
7
5
|
background-color: ${(props: any) => props.theme.colors.white};
|
|
@@ -39,4 +37,4 @@ export const MessageTypeItem = styled.View`
|
|
|
39
37
|
${({ active }: any) => active && css`
|
|
40
38
|
background-color: ${(props: any) => props.theme.colors.whiteGray};
|
|
41
39
|
`}
|
|
42
|
-
`
|
|
40
|
+
`
|
|
@@ -4,6 +4,7 @@ import CalendarStrip from 'react-native-calendar-strip'
|
|
|
4
4
|
import {
|
|
5
5
|
useLanguage,
|
|
6
6
|
useConfig,
|
|
7
|
+
useUtils,
|
|
7
8
|
useOrder,
|
|
8
9
|
MomentOption as MomentOptionController,
|
|
9
10
|
} from 'ordering-components/native';
|
|
@@ -132,6 +133,7 @@ const MomentOptionUI = (props: MomentOptionParams) => {
|
|
|
132
133
|
|
|
133
134
|
const [, t] = useLanguage();
|
|
134
135
|
const [{ configs }] = useConfig();
|
|
136
|
+
const [{ parseTime }] = useUtils()
|
|
135
137
|
const [orderState] = useOrder();
|
|
136
138
|
const [optionSelected, setOptionSelected] = useState({
|
|
137
139
|
isAsap: false,
|
|
@@ -143,6 +145,8 @@ const MomentOptionUI = (props: MomentOptionParams) => {
|
|
|
143
145
|
});
|
|
144
146
|
const { bottom } = useSafeAreaInsets();
|
|
145
147
|
|
|
148
|
+
const is12hours = configs?.dates_moment_format?.value?.includes('hh:mm')
|
|
149
|
+
|
|
146
150
|
const [selectedTime, setSelectedTime] = useState(null);
|
|
147
151
|
const [datesWhitelist, setDateWhitelist] = useState<any>([{ start: null, end: null }])
|
|
148
152
|
const [selectDate, setSelectedDate] = useState<any>(null)
|
|
@@ -338,7 +342,12 @@ const MomentOptionUI = (props: MomentOptionParams) => {
|
|
|
338
342
|
style={{
|
|
339
343
|
lineHeight: 24
|
|
340
344
|
}}
|
|
341
|
-
>{
|
|
345
|
+
>{is12hours ? (
|
|
346
|
+
time.startTime.includes('12')
|
|
347
|
+
? `${time.startTime}PM`
|
|
348
|
+
: parseTime(moment(time.startTime, 'HH:mm'), { outputFormat: 'hh:mma' })
|
|
349
|
+
) : time.startTime
|
|
350
|
+
}</OText>
|
|
342
351
|
</TimeItem>
|
|
343
352
|
</TouchableOpacity>
|
|
344
353
|
))}
|