ordering-ui-react-native 0.16.29 → 0.16.30-release
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +8 -5
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/ActiveOrders/index.tsx +61 -63
- package/src/components/ActiveOrders/styles.tsx +8 -14
- package/src/components/AddressForm/index.tsx +18 -2
- package/src/components/BusinessBasicInformation/index.tsx +11 -19
- package/src/components/BusinessInformation/index.tsx +33 -4
- package/src/components/BusinessInformation/styles.tsx +2 -2
- package/src/components/BusinessProductsList/index.tsx +10 -10
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +2 -1
- package/src/components/LanguageSelector/index.tsx +21 -16
- package/src/components/LoginForm/index.tsx +15 -0
- package/src/components/Messages/index.tsx +2 -2
- package/src/components/NotificationSetting/index.tsx +85 -0
- package/src/components/OrderDetails/index.tsx +2 -20
- package/src/components/OrdersOption/index.tsx +54 -56
- package/src/components/PaymentOptions/index.tsx +335 -365
- package/src/components/PaymentOptionsWebView/index.tsx +120 -121
- package/src/components/ReviewDriver/index.tsx +1 -1
- package/src/components/ReviewOrder/index.tsx +2 -1
- package/src/components/ReviewProducts/index.tsx +11 -0
- package/src/components/SignupForm/index.tsx +15 -0
- package/src/components/SingleProductReview/index.tsx +8 -5
- package/src/components/StripeElementsForm/index.tsx +25 -16
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OBottomPopup.tsx +6 -2
- package/src/index.tsx +2 -0
- package/src/pages/BusinessesListing.tsx +7 -6
- package/src/pages/OrderDetails.tsx +1 -1
- package/src/pages/ReviewDriver.tsx +2 -2
- package/src/pages/ReviewOrder.tsx +2 -2
- package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
- package/src/utils/index.tsx +0 -1
- package/themes/business/index.tsx +4 -0
- package/themes/business/src/components/BusinessController/index.tsx +2 -2
- package/themes/business/src/components/Chat/index.tsx +42 -34
- package/themes/business/src/components/DriverMap/index.tsx +7 -5
- package/themes/business/src/components/DriverSchedule/index.tsx +71 -0
- package/themes/business/src/components/DriverSchedule/styles.tsx +6 -0
- package/themes/business/src/components/LoginForm/index.tsx +111 -74
- package/themes/business/src/components/MapView/index.tsx +12 -1
- package/themes/business/src/components/MessagesOption/index.tsx +11 -1
- package/themes/business/src/components/NewOrderNotification/index.tsx +26 -41
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +25 -19
- package/themes/business/src/components/OrdersListManager/index.tsx +10 -3
- package/themes/business/src/components/OrdersOption/index.tsx +65 -21
- package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
- package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
- package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
- package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
- package/themes/business/src/components/PreviousOrders/index.tsx +21 -23
- package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
- package/themes/business/src/components/ReviewCustomer/index.tsx +1 -1
- package/themes/business/src/components/ScheduleBlocked/index.tsx +53 -0
- package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
- package/themes/business/src/components/UserProfileForm/index.tsx +28 -4
- package/themes/business/src/components/shared/ODropDown.tsx +42 -8
- package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
- package/themes/business/src/components/shared/OModal.tsx +40 -37
- package/themes/business/src/types/index.tsx +15 -9
- package/themes/business/src/utils/index.tsx +10 -0
- 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/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/LoginForm/index.tsx +121 -10
- package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
- 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/OrderTypeCardSelector/index.tsx +8 -10
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/types/index.d.ts +2 -0
- package/themes/original/index.tsx +12 -0
- package/themes/original/src/components/AddressDetails/index.tsx +1 -1
- package/themes/original/src/components/AddressForm/index.tsx +139 -135
- package/themes/original/src/components/AddressList/index.tsx +1 -1
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +311 -161
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +6 -2
- package/themes/original/src/components/BusinessController/index.tsx +190 -113
- package/themes/original/src/components/BusinessController/styles.tsx +0 -7
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +4 -4
- package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
- package/themes/original/src/components/BusinessListingSearch/index.tsx +80 -128
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
- package/themes/original/src/components/BusinessProductsList/index.tsx +49 -52
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +293 -177
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +23 -11
- package/themes/original/src/components/BusinessReviews/index.tsx +6 -1
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +109 -40
- package/themes/original/src/components/BusinessTypeFilter/styles.tsx +2 -0
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +561 -0
- package/themes/original/src/components/BusinessesListing/{styles.tsx → Layout/Appointment/styles.tsx} +24 -10
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +676 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +137 -0
- package/themes/original/src/components/BusinessesListing/index.tsx +105 -519
- package/themes/original/src/components/Cart/index.tsx +44 -12
- package/themes/original/src/components/Cart/styles.tsx +4 -0
- package/themes/original/src/components/CartContent/index.tsx +22 -16
- package/themes/original/src/components/Checkout/index.tsx +101 -61
- package/themes/original/src/components/Checkout/styles.tsx +0 -1
- package/themes/original/src/components/DriverTips/index.tsx +4 -4
- package/themes/original/src/components/DriverTips/styles.tsx +2 -1
- package/themes/original/src/components/Favorite/index.tsx +1 -0
- package/themes/original/src/components/FavoriteList/index.tsx +32 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/index.tsx +20 -19
- package/themes/original/src/components/GoogleMap/index.tsx +20 -12
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +25 -10
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +4 -0
- package/themes/original/src/components/HelpGuide/index.tsx +9 -8
- package/themes/original/src/components/HelpOrder/index.tsx +9 -8
- package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
- package/themes/original/src/components/LoginForm/Otp/index.tsx +95 -72
- package/themes/original/src/components/LoginForm/index.tsx +83 -45
- package/themes/original/src/components/LottieAnimation/index.tsx +69 -0
- package/themes/original/src/components/Messages/index.tsx +17 -17
- package/themes/original/src/components/MomentOption/index.tsx +1 -1
- package/themes/original/src/components/MomentSelector/index.tsx +197 -0
- package/themes/original/src/components/MomentSelector/styles.tsx +6 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -92
- package/themes/original/src/components/MultiCheckout/index.tsx +6 -0
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -16
- package/themes/original/src/components/MyOrders/index.tsx +70 -6
- package/themes/original/src/components/NavBar/index.tsx +15 -9
- package/themes/original/src/components/NetworkError/index.tsx +5 -3
- package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
- package/themes/original/src/components/Notifications/index.tsx +148 -0
- package/themes/original/src/components/Notifications/styles.tsx +17 -0
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +167 -0
- package/themes/original/src/components/OrderDetails/index.tsx +190 -35
- package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
- package/themes/original/src/components/OrderItAgain/index.tsx +75 -0
- package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
- package/themes/original/src/components/OrderProgress/index.tsx +8 -2
- package/themes/original/src/components/OrderSummary/index.tsx +3 -36
- package/themes/original/src/components/OrderTypeSelector/index.tsx +85 -36
- package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +97 -106
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
- package/themes/original/src/components/OrdersOption/index.tsx +71 -55
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +41 -23
- package/themes/original/src/components/PhoneInputNumber/index.tsx +5 -11
- package/themes/original/src/components/PlaceSpot/index.tsx +243 -47
- package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
- package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
- package/themes/original/src/components/ProductForm/index.tsx +633 -664
- package/themes/original/src/components/ProductForm/styles.tsx +9 -8
- package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
- package/themes/original/src/components/ProductOption/index.tsx +1 -1
- package/themes/original/src/components/ProfessionalFilter/index.tsx +129 -0
- package/themes/original/src/components/ProfessionalFilter/styles.tsx +0 -0
- package/themes/original/src/components/ProfessionalProfile/index.tsx +309 -0
- package/themes/original/src/components/ProfessionalProfile/styles.tsx +46 -0
- package/themes/original/src/components/ReviewDriver/index.tsx +6 -6
- package/themes/original/src/components/ReviewOrder/index.tsx +18 -3
- package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
- package/themes/original/src/components/ReviewTrigger/index.tsx +118 -0
- package/themes/original/src/components/ReviewTrigger/styles.tsx +34 -0
- package/themes/original/src/components/SearchBar/index.tsx +5 -3
- package/themes/original/src/components/ServiceForm/index.tsx +637 -0
- package/themes/original/src/components/ServiceForm/styles.tsx +50 -0
- package/themes/original/src/components/SignupForm/index.tsx +350 -206
- package/themes/original/src/components/SingleOrderCard/index.tsx +229 -181
- package/themes/original/src/components/SingleOrderCard/styles.tsx +0 -7
- package/themes/original/src/components/SingleProductCard/index.tsx +199 -110
- package/themes/original/src/components/SingleProductCard/styles.tsx +1 -10
- package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
- package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
- package/themes/original/src/components/StripeElementsForm/index.tsx +15 -7
- package/themes/original/src/components/UpsellingProducts/index.tsx +15 -5
- package/themes/original/src/components/UserDetails/index.tsx +31 -17
- package/themes/original/src/components/UserFormDetails/index.tsx +74 -81
- package/themes/original/src/components/UserProfile/index.tsx +54 -29
- package/themes/original/src/components/UserProfile/styles.ts +17 -0
- package/themes/original/src/components/UserProfileForm/index.tsx +15 -10
- package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
- package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
- package/themes/original/src/components/Wallets/index.tsx +176 -164
- package/themes/original/src/components/Wallets/styles.tsx +12 -8
- package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
- package/themes/original/src/components/shared/OBottomPopup.tsx +48 -15
- package/themes/original/src/components/shared/OButton.tsx +10 -3
- package/themes/original/src/components/shared/OIcon.tsx +8 -1
- package/themes/original/src/components/shared/OInput.tsx +3 -2
- package/themes/original/src/layouts/Container.tsx +13 -9
- package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
- package/themes/original/src/types/index.tsx +121 -30
- package/themes/original/src/utils/index.tsx +77 -0
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -5,147 +5,146 @@ import WebView from 'react-native-webview';
|
|
|
5
5
|
import { ActivityIndicator } from 'react-native-paper';
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
ToastType,
|
|
9
|
+
useToast,
|
|
10
|
+
useApi,
|
|
11
|
+
useLanguage,
|
|
12
|
+
useConfig
|
|
13
13
|
} from 'ordering-components/native';
|
|
14
14
|
|
|
15
15
|
import { OText } from '../shared';
|
|
16
16
|
|
|
17
17
|
interface PaymentOptionsWebViewParams {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
onNavigationRedirect?: Function,
|
|
19
|
+
uri?: any,
|
|
20
|
+
user?: any,
|
|
21
|
+
token?: any,
|
|
22
|
+
cart?: any,
|
|
23
|
+
currency?: any,
|
|
24
|
+
webviewPaymethod?: any,
|
|
25
|
+
setShowGateway?: any,
|
|
26
|
+
setOpenOrderCreating?: any,
|
|
27
|
+
locationId?: any
|
|
28
28
|
}
|
|
29
29
|
export const PaymentOptionsWebView = (props: PaymentOptionsWebViewParams) => {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
30
|
+
const {
|
|
31
|
+
onNavigationRedirect,
|
|
32
|
+
uri,
|
|
33
|
+
user,
|
|
34
|
+
token,
|
|
35
|
+
cart,
|
|
36
|
+
currency,
|
|
37
|
+
webviewPaymethod,
|
|
38
|
+
setShowGateway,
|
|
39
|
+
setOpenOrderCreating,
|
|
40
|
+
locationId
|
|
41
|
+
} = props
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
const webviewRef = useRef<any>(null)
|
|
44
|
+
const [, { showToast }] = useToast();
|
|
45
|
+
const [ordering] = useApi()
|
|
46
|
+
const [{ configs }] = useConfig();
|
|
47
|
+
const [, t] = useLanguage();
|
|
48
48
|
|
|
49
|
+
|
|
50
|
+
const [progClr, setProgClr] = useState('#424242');
|
|
51
|
+
const [prog, setProg] = useState(true);
|
|
49
52
|
|
|
50
|
-
|
|
51
|
-
const [prog, setProg] = useState(true);
|
|
52
|
-
|
|
53
|
-
const handleCloseWebview = () => {
|
|
53
|
+
const handleCloseWebview = () => {
|
|
54
54
|
setProg(true);
|
|
55
55
|
setShowGateway({ open: false, closedByUser: true })
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
const onMessage = (e: any) => {
|
|
59
|
+
if (e?.nativeEvent?.data && e?.nativeEvent?.data !== 'undefined') {
|
|
60
|
+
let payment = JSON.parse(e.nativeEvent.data);
|
|
61
61
|
|
|
62
|
-
if (payment === 'api error') {
|
|
62
|
+
if (payment === 'api error' || payment === 'Cancelled by user') {
|
|
63
63
|
setShowGateway({ closedByUser: true, open: false })
|
|
64
64
|
setProg(true);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
67
|
+
if (payment) {
|
|
68
|
+
if (payment.error) {
|
|
69
|
+
showToast(ToastType.Error, payment.result)
|
|
70
|
+
setOpenOrderCreating && setOpenOrderCreating(false)
|
|
71
|
+
} else if (payment?.result?.order?.uuid) {
|
|
72
|
+
showToast(ToastType.Success, t('ORDER_PLACED_SUCCESSfULLY', 'The order was placed successfully'))
|
|
73
|
+
onNavigationRedirect && onNavigationRedirect('OrderDetails', { orderId: payment?.result?.order?.uuid, isFromCheckout: true})
|
|
74
|
+
}
|
|
75
|
+
setProg(true);
|
|
76
|
+
setShowGateway({ closedByUser: false, open: false })
|
|
77
|
+
}
|
|
74
78
|
}
|
|
75
|
-
|
|
76
|
-
setShowGateway({ closedByUser: false, open: false })
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
79
|
+
}
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
return (
|
|
82
82
|
<View style={{ zIndex: 9999, height: '100%', width: '100%', position: 'absolute', backgroundColor: 'white' }}>
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
83
|
+
<Icon
|
|
84
|
+
name="x"
|
|
85
|
+
size={35}
|
|
86
|
+
style={{ backgroundColor: 'white', paddingTop: 30, paddingLeft: 10 }}
|
|
87
|
+
onPress={handleCloseWebview}
|
|
88
|
+
/>
|
|
89
|
+
<OText
|
|
90
|
+
style={{
|
|
91
|
+
textAlign: 'center',
|
|
92
|
+
fontSize: 16,
|
|
93
|
+
fontWeight: 'bold',
|
|
94
|
+
color: '#00457C',
|
|
95
|
+
marginBottom: 5,
|
|
96
|
+
marginTop: 10
|
|
97
|
+
}}>
|
|
98
|
+
{webviewPaymethod?.gateway === 'paypal' ? (t('PAYPAL_GATEWAY', 'PayPal GateWay')) : (t('SQUARE_PAYMENT', 'Square payment'))}
|
|
99
|
+
</OText>
|
|
100
|
+
<View style={{ padding: 20, opacity: prog ? 1 : 0, backgroundColor: 'white' }}>
|
|
101
|
+
<ActivityIndicator size={24} color={progClr} />
|
|
102
|
+
</View>
|
|
103
|
+
<WebView
|
|
104
|
+
source={{ uri: uri }}
|
|
105
|
+
onMessage={onMessage}
|
|
106
|
+
ref={webviewRef}
|
|
107
|
+
javaScriptEnabled={true}
|
|
108
|
+
javaScriptEnabledAndroid={true}
|
|
109
|
+
cacheEnabled={false}
|
|
110
|
+
cacheMode='LOAD_NO_CACHE'
|
|
111
|
+
style={{ flex: 1 }}
|
|
112
|
+
onShouldStartLoadWithRequest={() => true}
|
|
113
|
+
onLoadStart={() => {
|
|
114
|
+
setProg(true);
|
|
115
|
+
setProgClr('#424242');
|
|
116
|
+
}}
|
|
117
|
+
onLoadProgress={() => {
|
|
118
|
+
setProg(true);
|
|
119
|
+
setProgClr('#00457C');
|
|
120
|
+
}}
|
|
121
|
+
onLoad={() => {
|
|
122
|
+
setProg(true);
|
|
123
|
+
setProgClr('#00457C');
|
|
124
|
+
}}
|
|
125
|
+
onLoadEnd={(e) => {
|
|
126
|
+
const messageParams = locationId ? { locationId } : {}
|
|
127
|
+
const message = {
|
|
128
|
+
action: 'init',
|
|
129
|
+
data: {
|
|
130
|
+
urlPlace: `${ordering.root}/carts/${cart?.uuid}/place`,
|
|
131
|
+
urlConfirm: `${ordering.root}/carts/${cart?.uuid}/confirm`,
|
|
132
|
+
payData: {
|
|
133
|
+
paymethod_id: webviewPaymethod?.id,
|
|
134
|
+
amount: cart?.balance ?? cart?.total,
|
|
135
|
+
delivery_zone_id: cart?.delivery_zone_id,
|
|
136
|
+
user_id: user?.id,
|
|
137
|
+
user_name: user?.name
|
|
138
|
+
},
|
|
139
|
+
currency: configs?.stripe_currency?.value || currency,
|
|
140
|
+
userToken: token,
|
|
141
|
+
clientId: webviewPaymethod?.credentials?.client_id,
|
|
142
|
+
...messageParams
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
setProg(false);
|
|
146
|
+
webviewRef?.current?.postMessage?.(JSON.stringify(message))
|
|
147
|
+
}}
|
|
148
|
+
/>
|
|
149
149
|
</View>
|
|
150
|
-
|
|
151
|
-
}
|
|
150
|
+
)}
|
|
@@ -218,7 +218,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
|
|
|
218
218
|
<RatingBarContainer>
|
|
219
219
|
<LinearGradient
|
|
220
220
|
start={{ x: 0.0, y: 0.0 }}
|
|
221
|
-
end={{ x: qualificationList[dirverReviews?.qualification - 1]?.percent || 0, y: 0 }}
|
|
221
|
+
end={{ x: qualificationList[dirverReviews?.qualification - 1]?.percent || 0.0001, y: 0 }}
|
|
222
222
|
locations={[.9999, .9999]}
|
|
223
223
|
colors={[theme.colors.primary, theme.colors.lightGray]}
|
|
224
224
|
style={styles.statusBar}
|
|
@@ -238,7 +238,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
|
238
238
|
<RatingBarContainer>
|
|
239
239
|
<LinearGradient
|
|
240
240
|
start={{ x: 0.0, y: 0.0 }}
|
|
241
|
-
end={{ x: qualificationList[stars.quality - 1]?.percent || 0, y: 0 }}
|
|
241
|
+
end={{ x: qualificationList[stars.quality - 1]?.percent || 0.0001, y: 0.0 }}
|
|
242
242
|
locations={[.9999, .9999]}
|
|
243
243
|
colors={[theme.colors.primary, theme.colors.lightGray]}
|
|
244
244
|
style={styles.statusBar}
|
|
@@ -332,6 +332,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
|
332
332
|
export const ReviewOrder = (props: ReviewOrderParams) => {
|
|
333
333
|
const reviewOrderProps = {
|
|
334
334
|
...props,
|
|
335
|
+
defaultStar: 0,
|
|
335
336
|
UIComponent: ReviewOrderUI
|
|
336
337
|
}
|
|
337
338
|
return <ReviewOrderController {...reviewOrderProps} />
|
|
@@ -61,6 +61,17 @@ const ReviewProductsUI = (props: ReviewProductParams) => {
|
|
|
61
61
|
}
|
|
62
62
|
}, [formState])
|
|
63
63
|
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
const _changes = order?.products.map(product => {
|
|
66
|
+
return {
|
|
67
|
+
product_id: product?.product_id,
|
|
68
|
+
comment: '',
|
|
69
|
+
qualification: 5
|
|
70
|
+
}
|
|
71
|
+
})
|
|
72
|
+
handleChangeFormState(_changes)
|
|
73
|
+
}, [])
|
|
74
|
+
|
|
64
75
|
return (
|
|
65
76
|
<>
|
|
66
77
|
<ReviewProductsContainer>
|
|
@@ -245,6 +245,12 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
245
245
|
|
|
246
246
|
const handleOpenRecaptcha = () => {
|
|
247
247
|
setRecaptchaVerified(false)
|
|
248
|
+
|
|
249
|
+
if (recaptchaVerified) {
|
|
250
|
+
handleReCaptcha && handleReCaptcha('')
|
|
251
|
+
return
|
|
252
|
+
}
|
|
253
|
+
|
|
248
254
|
if (!recaptchaConfig?.siteKey) {
|
|
249
255
|
showToast(ToastType.Error, t('NO_RECAPTCHA_SITE_KEY', 'The config doesn\'t have recaptcha site key'));
|
|
250
256
|
return
|
|
@@ -555,6 +561,15 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
555
561
|
baseUrl={recaptchaConfig?.baseUrl}
|
|
556
562
|
onVerify={onRecaptchaVerify}
|
|
557
563
|
onExpire={() => setRecaptchaVerified(false)}
|
|
564
|
+
footerComponent={<OButton
|
|
565
|
+
onClick={() => recaptchaRef.current.close()}
|
|
566
|
+
style={{ borderRadius: 0 }}
|
|
567
|
+
text={t('CLOSE', 'Close')}
|
|
568
|
+
bgColor={theme.colors.primary}
|
|
569
|
+
borderColor={theme.colors.primary}
|
|
570
|
+
textStyle={{ color: 'white' }}
|
|
571
|
+
imgRightSrc={null}
|
|
572
|
+
/>}
|
|
558
573
|
/>
|
|
559
574
|
</>
|
|
560
575
|
)}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
|
-
import { useLanguage } from 'ordering-components/native'
|
|
3
|
-
import { OText, OButton, OInput } from '../shared'
|
|
2
|
+
import { useLanguage, useUtils } from 'ordering-components/native'
|
|
3
|
+
import { OText, OButton, OInput, OIcon } from '../shared'
|
|
4
4
|
import { StyleSheet, TouchableOpacity, View } from 'react-native'
|
|
5
5
|
import AntDesignIcons from 'react-native-vector-icons/AntDesign'
|
|
6
6
|
import { useTheme } from 'styled-components/native'
|
|
7
7
|
import { SingleProductReviewParams } from '../../types'
|
|
8
|
+
import FastImage from 'react-native-fast-image'
|
|
8
9
|
|
|
9
10
|
import {
|
|
10
11
|
ProductContainer,
|
|
@@ -12,6 +13,7 @@ import {
|
|
|
12
13
|
LikeHandsActionContainer,
|
|
13
14
|
LikeHandsButton,
|
|
14
15
|
CommentsButtonGroup,
|
|
16
|
+
LogoWrapper
|
|
15
17
|
} from './styles'
|
|
16
18
|
|
|
17
19
|
export const SingleProductReview = (props: SingleProductReviewParams) => {
|
|
@@ -23,6 +25,7 @@ export const SingleProductReview = (props: SingleProductReviewParams) => {
|
|
|
23
25
|
|
|
24
26
|
const [, t] = useLanguage()
|
|
25
27
|
const theme = useTheme()
|
|
28
|
+
const [{ optimizeImage }] = useUtils()
|
|
26
29
|
|
|
27
30
|
const styles = StyleSheet.create({
|
|
28
31
|
inputTextArea: {
|
|
@@ -37,7 +40,7 @@ export const SingleProductReview = (props: SingleProductReviewParams) => {
|
|
|
37
40
|
flexDirection: 'row',
|
|
38
41
|
justifyContent: 'center',
|
|
39
42
|
marginVertical: 10,
|
|
40
|
-
}
|
|
43
|
+
}
|
|
41
44
|
})
|
|
42
45
|
|
|
43
46
|
const [comments, setComments] = useState<Array<any>>([])
|
|
@@ -69,7 +72,7 @@ export const SingleProductReview = (props: SingleProductReviewParams) => {
|
|
|
69
72
|
}
|
|
70
73
|
|
|
71
74
|
useEffect(() => {
|
|
72
|
-
if (comments?.length === 0 && !extraComment
|
|
75
|
+
if (comments?.length === 0 && !extraComment) return
|
|
73
76
|
let _comments = ''
|
|
74
77
|
if (comments.length > 0) {
|
|
75
78
|
comments.map(comment => (_comments += comment.content + '. '))
|
|
@@ -129,7 +132,7 @@ export const SingleProductReview = (props: SingleProductReviewParams) => {
|
|
|
129
132
|
style={{ height: 35, paddingLeft: 5, paddingRight: 5, marginHorizontal: 3, marginVertical: 10 }}
|
|
130
133
|
imgRightSrc={isSelectedComment(commentItem.key) ? theme.images.general.close : null}
|
|
131
134
|
imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
|
|
132
|
-
onClick={() => handleChangeComment(commentItem)
|
|
135
|
+
onClick={() => handleChangeComment(commentItem)}
|
|
133
136
|
/>
|
|
134
137
|
))}
|
|
135
138
|
</CommentsButtonGroup>
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
useConfirmSetupIntent,
|
|
8
8
|
createPaymentMethod
|
|
9
9
|
} from '@stripe/stripe-react-native';
|
|
10
|
-
import configs from '../../config.json'
|
|
11
10
|
import { ErrorMessage } from './styles';
|
|
12
11
|
|
|
13
12
|
import { StripeElementsForm as StripeFormController } from './naked';
|
|
@@ -26,7 +25,8 @@ const StripeElementsFormUI = (props: any) => {
|
|
|
26
25
|
methodsPay,
|
|
27
26
|
paymethod,
|
|
28
27
|
onCancel,
|
|
29
|
-
cart
|
|
28
|
+
cart,
|
|
29
|
+
merchantId
|
|
30
30
|
} = props;
|
|
31
31
|
|
|
32
32
|
const theme = useTheme();
|
|
@@ -54,17 +54,25 @@ const StripeElementsFormUI = (props: any) => {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
if (user?.address) {
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
billingDetails.address = {
|
|
58
|
+
line1: user?.address
|
|
59
|
+
}
|
|
60
|
+
}
|
|
59
61
|
|
|
60
62
|
const createPayMethod = async () => {
|
|
61
|
-
const params: any = {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
const params: any = { paymentMethodType: 'Card', paymentMethodData: {} }
|
|
64
|
+
if (Object.keys(billingDetails).length > 0) {
|
|
65
|
+
params.paymentMethodData.billingDetails = {...billingDetails, token: card?.last4}
|
|
66
|
+
}
|
|
65
67
|
try {
|
|
66
68
|
setCreatePmLoading(true)
|
|
67
|
-
const { paymentMethod } = await createPaymentMethod(params);
|
|
69
|
+
const { paymentMethod, error } = await createPaymentMethod(params);
|
|
70
|
+
|
|
71
|
+
if (error) {
|
|
72
|
+
setErrors(error?.message);
|
|
73
|
+
setCreatePmLoading(false)
|
|
74
|
+
return
|
|
75
|
+
}
|
|
68
76
|
|
|
69
77
|
setCreatePmLoading(false)
|
|
70
78
|
handleSource && handleSource({
|
|
@@ -87,10 +95,10 @@ const StripeElementsFormUI = (props: any) => {
|
|
|
87
95
|
createPayMethod();
|
|
88
96
|
return
|
|
89
97
|
}
|
|
90
|
-
const params: any = {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
98
|
+
const params: any = { paymentMethodType: 'Card', paymentMethodData: {} }
|
|
99
|
+
if (Object.keys(billingDetails).length > 0) {
|
|
100
|
+
params.paymentMethodData.billingDetails = {...billingDetails, token: card?.last4}
|
|
101
|
+
}
|
|
94
102
|
try {
|
|
95
103
|
const { setupIntent, error } = await confirmSetupIntent(requirements, params);
|
|
96
104
|
|
|
@@ -126,12 +134,13 @@ const StripeElementsFormUI = (props: any) => {
|
|
|
126
134
|
<View style={styles.container}>
|
|
127
135
|
{publicKey ? (
|
|
128
136
|
<View style={{ flex: 1 }}>
|
|
129
|
-
<StripeProvider
|
|
137
|
+
<StripeProvider
|
|
130
138
|
publishableKey={publicKey}
|
|
131
|
-
merchantIdentifier={`merchant.${
|
|
139
|
+
merchantIdentifier={`merchant.${merchantId}`}
|
|
140
|
+
urlScheme={merchantId}
|
|
132
141
|
>
|
|
133
142
|
{methodsPay?.includes(paymethod) ? (
|
|
134
|
-
<StripeMethodForm
|
|
143
|
+
<StripeMethodForm
|
|
135
144
|
handleSource={handleSource}
|
|
136
145
|
onCancel={onCancel}
|
|
137
146
|
cart={cart}
|
|
@@ -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`
|
|
@@ -4,14 +4,18 @@ const deviceHeight = Dimensions.get('window').height
|
|
|
4
4
|
|
|
5
5
|
interface Props {
|
|
6
6
|
open: boolean;
|
|
7
|
+
containerStyle: any;
|
|
7
8
|
title?: string;
|
|
9
|
+
titleStyle?: any;
|
|
8
10
|
children?: any;
|
|
9
11
|
onClose?: any;
|
|
10
12
|
}
|
|
11
13
|
const OBottomPopup = (props: Props) => {
|
|
12
14
|
const {
|
|
13
15
|
open,
|
|
16
|
+
containerStyle,
|
|
14
17
|
title,
|
|
18
|
+
titleStyle,
|
|
15
19
|
onClose,
|
|
16
20
|
children
|
|
17
21
|
} = props
|
|
@@ -29,9 +33,9 @@ const OBottomPopup = (props: Props) => {
|
|
|
29
33
|
>
|
|
30
34
|
<View style={styles.touchableOutsideStyle} />
|
|
31
35
|
</TouchableWithoutFeedback>
|
|
32
|
-
<View style={styles.bottomContainer}>
|
|
36
|
+
<View style={{ ...styles.bottomContainer, ...containerStyle }}>
|
|
33
37
|
<View>
|
|
34
|
-
<Text style={styles.titleStyle}>
|
|
38
|
+
<Text style={{ ...styles.titleStyle, ...titleStyle }}>
|
|
35
39
|
{title}
|
|
36
40
|
</Text>
|
|
37
41
|
{children}
|
package/src/index.tsx
CHANGED
|
@@ -36,6 +36,7 @@ import { LogoutButton } from './components/LogoutButton';
|
|
|
36
36
|
import { Messages } from './components/Messages';
|
|
37
37
|
import { MomentOption } from './components/MomentOption';
|
|
38
38
|
import NavBar from './components/NavBar';
|
|
39
|
+
import { NotificationSetting } from './components/NotificationSetting'
|
|
39
40
|
import { NotFoundSource } from './components/NotFoundSource';
|
|
40
41
|
import { OrderCreating } from './components/OrderCreating';
|
|
41
42
|
import { OrderDetails } from './components/OrderDetails';
|
|
@@ -136,6 +137,7 @@ export {
|
|
|
136
137
|
Messages,
|
|
137
138
|
MomentOption,
|
|
138
139
|
NavBar,
|
|
140
|
+
NotificationSetting,
|
|
139
141
|
NotFoundSource,
|
|
140
142
|
OrderCreating,
|
|
141
143
|
OrderDetails,
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import React, {useEffect} from 'react'
|
|
1
|
+
import React, { useEffect } from 'react'
|
|
2
2
|
import { BusinessesListing as BusinessListingController } from '../components/BusinessesListing'
|
|
3
3
|
import styled from 'styled-components/native'
|
|
4
4
|
import { useTheme } from 'styled-components/native'
|
|
5
5
|
|
|
6
6
|
const BusinessesListing = (props: any) => {
|
|
7
7
|
const theme = useTheme()
|
|
8
|
-
const businessId =
|
|
8
|
+
const businessId = props.route.params?.businessId
|
|
9
9
|
const categoryId = props.route.params?.categoryId
|
|
10
|
-
const productId =
|
|
11
|
-
const store =
|
|
10
|
+
const productId = props.route.params?.productId
|
|
11
|
+
const store = props.route.params?.store
|
|
12
12
|
|
|
13
13
|
useEffect(() => {
|
|
14
|
-
if(store){
|
|
15
|
-
props.navigation.navigate('Business', {store,businessId,categoryId,productId})
|
|
14
|
+
if (store) {
|
|
15
|
+
props.navigation.navigate('Business', { store, businessId, categoryId, productId })
|
|
16
16
|
return
|
|
17
17
|
}
|
|
18
18
|
}, [businessId, categoryId, productId, store])
|
|
19
19
|
|
|
20
20
|
const BusinessesListingProps = {
|
|
21
21
|
...props,
|
|
22
|
+
navigation: props?.navigation,
|
|
22
23
|
isSearchByName: true,
|
|
23
24
|
isSearchByDescription: true,
|
|
24
25
|
propsToFetch: ['id', 'name', 'header', 'logo', 'ribbon', 'location', 'schedule', 'open', 'delivery_price', 'distance', 'delivery_time', 'pickup_time', 'reviews', 'featured', 'offers', 'food', 'laundry', 'alcohol', 'groceries', 'slug'],
|
|
@@ -2,7 +2,7 @@ import React from 'react'
|
|
|
2
2
|
import { OrderDetails as OrderDetailsController } from '../components/OrderDetails'
|
|
3
3
|
import { SafeAreaContainer } from '../layouts/SafeAreaContainer'
|
|
4
4
|
|
|
5
|
-
const OrderDetails = ({ navigation, route }
|
|
5
|
+
const OrderDetails = ({ navigation, route }: any) => {
|
|
6
6
|
const orderDetailsProps = {
|
|
7
7
|
navigation,
|
|
8
8
|
orderId: route.params?.orderId,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { Platform } from 'react-native';
|
|
3
3
|
import styled from 'styled-components/native';
|
|
4
|
-
import {ReviewDriver as ReviewDriverController} from '../components/ReviewDriver'
|
|
4
|
+
import { ReviewDriver as ReviewDriverController } from '../components/ReviewDriver'
|
|
5
5
|
import { SafeAreaContainer } from '../layouts/SafeAreaContainer';
|
|
6
6
|
|
|
7
7
|
const KeyboardView = styled.KeyboardAvoidingView`
|
|
8
8
|
flex: 1;
|
|
9
9
|
`;
|
|
10
10
|
|
|
11
|
-
const ReviewDriver = ({navigation, route}
|
|
11
|
+
const ReviewDriver = ({ navigation, route }: any) => {
|
|
12
12
|
const reviewDriverProps = {
|
|
13
13
|
navigation,
|
|
14
14
|
order: route?.params?.order,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { Platform } from 'react-native';
|
|
3
3
|
import styled from 'styled-components/native';
|
|
4
|
-
import {ReviewOrder as ReviewOrderController} from '../components/ReviewOrder'
|
|
4
|
+
import { ReviewOrder as ReviewOrderController } from '../components/ReviewOrder'
|
|
5
5
|
import { SafeAreaContainer } from '../layouts/SafeAreaContainer';
|
|
6
6
|
|
|
7
7
|
const KeyboardView = styled.KeyboardAvoidingView`
|
|
8
8
|
flex: 1;
|
|
9
9
|
`;
|
|
10
10
|
|
|
11
|
-
const ReviewOrder = ({navigation, route}
|
|
11
|
+
const ReviewOrder = ({ navigation, route }: any) => {
|
|
12
12
|
const reviewOrderProps = {
|
|
13
13
|
navigation,
|
|
14
14
|
order: route?.params?.order,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module '@fatnlazycat/react-native-recaptcha-v3'
|
package/src/utils/index.tsx
CHANGED
|
@@ -34,7 +34,6 @@ export const getTraduction = (key: string, t: any) => {
|
|
|
34
34
|
ERROR_ADD_PRODUCT_VERY_FAR_FOR_DELIVERY: 'Error adding product, very far for delivery',
|
|
35
35
|
ERROR_PRODUCT_NOT_FOUND: 'Error with the product',
|
|
36
36
|
ERROR_ADD_BUSINESS_INVALID: 'An error occurred with the business',
|
|
37
|
-
ERROR_INVALID_OFFER: 'The offer doesn\'t exist'
|
|
38
37
|
}
|
|
39
38
|
|
|
40
39
|
return keyList[key] ? t(key, keyList[key]) : t(key)
|
|
@@ -39,6 +39,8 @@ import { VerifyPhone } from './src/components/VerifyPhone';
|
|
|
39
39
|
import { DriverMap } from './src/components/DriverMap';
|
|
40
40
|
import { MapViewUI as MapView } from './src/components/MapView'
|
|
41
41
|
import { NewOrderNotification } from './src/components/NewOrderNotification';
|
|
42
|
+
import { DriverSchedule } from './src/components/DriverSchedule';
|
|
43
|
+
import { ScheduleBlocked } from './src/components/ScheduleBlocked';
|
|
42
44
|
//OComponents
|
|
43
45
|
import {
|
|
44
46
|
OText,
|
|
@@ -106,6 +108,8 @@ export {
|
|
|
106
108
|
UserFormDetailsUI,
|
|
107
109
|
UserProfileForm,
|
|
108
110
|
VerifyPhone,
|
|
111
|
+
DriverSchedule,
|
|
112
|
+
ScheduleBlocked,
|
|
109
113
|
//OComponents
|
|
110
114
|
OAlert,
|
|
111
115
|
OButton,
|