ordering-ui-react-native 0.16.46 → 0.16.47-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 +6 -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/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/Messages/index.tsx +2 -2
- package/src/components/NotificationSetting/index.tsx +85 -0
- package/src/components/OrdersOption/index.tsx +54 -56
- package/src/components/PaymentOptions/index.tsx +298 -345
- package/src/components/PaymentOptionsWebView/index.tsx +120 -121
- package/src/components/ReviewDriver/index.tsx +1 -1
- package/src/components/ReviewOrder/index.tsx +2 -2
- package/src/components/ReviewProducts/index.tsx +11 -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/components/shared/OToast.tsx +3 -3
- package/src/index.tsx +2 -0
- package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
- package/src/utils/index.tsx +2 -1
- package/themes/business/src/components/BusinessController/index.tsx +2 -2
- package/themes/business/src/components/Chat/index.tsx +40 -32
- package/themes/business/src/components/DriverMap/index.tsx +7 -5
- package/themes/business/src/components/DriverSchedule/index.tsx +36 -19
- 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 +33 -23
- 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 +18 -20
- package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
- package/themes/business/src/components/ReviewCustomer/index.tsx +27 -13
- package/themes/business/src/components/ScheduleBlocked/index.tsx +2 -2
- package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
- package/themes/business/src/components/UserProfileForm/index.tsx +2 -0
- 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/OLink.tsx +24 -12
- 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/BusinessesListing/index.tsx +2 -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/ProductForm/index.tsx +1 -14
- 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 +4 -0
- package/themes/original/src/components/AddressDetails/index.tsx +10 -8
- package/themes/original/src/components/AddressForm/index.tsx +157 -140
- 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 +218 -147
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +2 -2
- package/themes/original/src/components/BusinessController/index.tsx +231 -114
- package/themes/original/src/components/BusinessController/styles.tsx +14 -9
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
- 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 +109 -139
- 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 +59 -60
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +175 -80
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +18 -11
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +35 -23
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +3 -2
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +275 -120
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +47 -10
- package/themes/original/src/components/BusinessesListing/index.tsx +80 -25
- package/themes/original/src/components/Cart/index.tsx +82 -15
- 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 +113 -117
- package/themes/original/src/components/Checkout/styles.tsx +4 -3
- package/themes/original/src/components/CitiesControl/index.tsx +89 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
- 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/FavoriteList/index.tsx +69 -45
- package/themes/original/src/components/FloatingButton/index.tsx +13 -11
- 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/GPSButton/styles.ts +3 -3
- 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 +89 -73
- package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
- package/themes/original/src/components/LoginForm/index.tsx +98 -41
- package/themes/original/src/components/LottieAnimation/index.tsx +69 -0
- package/themes/original/src/components/Messages/index.tsx +35 -20
- package/themes/original/src/components/MomentOption/index.tsx +8 -6
- package/themes/original/src/components/MultiCart/index.tsx +63 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
- package/themes/original/src/components/MultiCheckout/index.tsx +10 -2
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +34 -16
- package/themes/original/src/components/MyOrders/index.tsx +88 -22
- package/themes/original/src/components/NavBar/index.tsx +11 -5
- 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 +200 -39
- 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 +77 -66
- package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
- package/themes/original/src/components/OrderSummary/index.tsx +2 -35
- 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 +94 -98
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
- package/themes/original/src/components/OrdersOption/index.tsx +102 -56
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +1 -2
- package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
- package/themes/original/src/components/PlaceSpot/index.tsx +249 -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 +639 -664
- package/themes/original/src/components/ProductForm/styles.tsx +10 -11
- 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/ProductOptionSubOption/index.tsx +16 -8
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +0 -1
- package/themes/original/src/components/ProfessionalFilter/index.tsx +2 -1
- package/themes/original/src/components/ProfessionalProfile/index.tsx +19 -8
- package/themes/original/src/components/Promotions/index.tsx +232 -219
- package/themes/original/src/components/Promotions/styles.tsx +7 -2
- package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
- package/themes/original/src/components/ReviewOrder/index.tsx +120 -108
- package/themes/original/src/components/ReviewOrder/styles.tsx +5 -7
- package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
- package/themes/original/src/components/ReviewTrigger/index.tsx +136 -0
- package/themes/original/src/components/ReviewTrigger/styles.tsx +41 -0
- package/themes/original/src/components/ServiceForm/index.tsx +332 -264
- package/themes/original/src/components/SignupForm/index.tsx +160 -113
- package/themes/original/src/components/SingleOrderCard/index.tsx +266 -183
- package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
- package/themes/original/src/components/SingleProductCard/index.tsx +198 -112
- package/themes/original/src/components/SingleProductCard/styles.tsx +3 -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 +13 -2
- package/themes/original/src/components/UpsellingProducts/index.tsx +15 -5
- package/themes/original/src/components/UserDetails/index.tsx +5 -3
- package/themes/original/src/components/UserFormDetails/index.tsx +6 -48
- package/themes/original/src/components/UserProfile/index.tsx +56 -31
- package/themes/original/src/components/UserProfile/styles.ts +17 -0
- 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/HeaderTitle.tsx +8 -3
- 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 +10 -1
- 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 +83 -28
- package/themes/original/src/utils/index.tsx +103 -58
- 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}
|
|
@@ -106,7 +106,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
const qualificationList = [
|
|
109
|
-
{ key: 1, text: t('TERRIBLE', 'Terrible'), percent: 0
|
|
109
|
+
{ key: 1, text: t('TERRIBLE', 'Terrible'), percent: 0, parentStyle: { left: '0%' }, isInnerStyle: false, pointerColor: false },
|
|
110
110
|
{ key: 2, text: t('BAD', 'Bad'), percent: 0.25, parentStyle: { left: '25%' }, isInnerStyle: true, pointerColor: true },
|
|
111
111
|
{ key: 3, text: t('OKAY', 'Okay'), percent: 0.5, parentStyle: { left: '50%' }, isInnerStyle: true, pointerColor: true },
|
|
112
112
|
{ key: 4, text: t('GOOD', 'Good'), percent: 0.75, parentStyle: { left: '75%' }, isInnerStyle: true, pointerColor: true },
|
|
@@ -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.
|
|
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}
|
|
@@ -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>
|
|
@@ -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}
|
|
@@ -5,7 +5,7 @@ import { useTheme } from 'styled-components/native';
|
|
|
5
5
|
import { getTraduction } from '../../utils'
|
|
6
6
|
|
|
7
7
|
const fadeDuration = 300;
|
|
8
|
-
const
|
|
8
|
+
const topPosition = 20;
|
|
9
9
|
|
|
10
10
|
export const Toast = (props: any) => {
|
|
11
11
|
const [toastConfig, { hideToast }] = useToast();
|
|
@@ -54,7 +54,7 @@ export const Toast = (props: any) => {
|
|
|
54
54
|
backgroundColor = theme.colors.toastInfo || '#6BA4FF';
|
|
55
55
|
break;
|
|
56
56
|
case ToastType.Error:
|
|
57
|
-
backgroundColor = theme.colors.toastError || '#D83520'
|
|
57
|
+
backgroundColor = theme.colors.toastError || '#D83520';
|
|
58
58
|
break;
|
|
59
59
|
case ToastType.Success:
|
|
60
60
|
backgroundColor = theme.colors.toastSuccess || '#90C68E';
|
|
@@ -65,7 +65,7 @@ export const Toast = (props: any) => {
|
|
|
65
65
|
<Animated.View
|
|
66
66
|
style={[
|
|
67
67
|
styles.container,
|
|
68
|
-
{
|
|
68
|
+
{ top: topPosition, opacity },
|
|
69
69
|
]}
|
|
70
70
|
>
|
|
71
71
|
<View style={[styles.toast, { backgroundColor }]}>
|
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,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module '@fatnlazycat/react-native-recaptcha-v3'
|
package/src/utils/index.tsx
CHANGED
|
@@ -34,7 +34,8 @@ 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'
|
|
37
|
+
ERROR_INVALID_OFFER: 'The offer doesn\'t exist',
|
|
38
|
+
ERROR_ADD_PRODUCT_BEFORE_ADDRESS: 'You must have an address'
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
return keyList[key] ? t(key, keyList[key]) : t(key)
|
|
@@ -67,11 +67,11 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
67
67
|
shadowColor: '#000',
|
|
68
68
|
shadowOffset: {
|
|
69
69
|
width: 0,
|
|
70
|
-
height: 1.5,
|
|
70
|
+
height: business?.logo ? 1.5 : 0,
|
|
71
71
|
},
|
|
72
72
|
shadowOpacity: 0.21,
|
|
73
73
|
shadowRadius: 3,
|
|
74
|
-
elevation: 7,
|
|
74
|
+
elevation: business?.logo ? 7 : 0,
|
|
75
75
|
},
|
|
76
76
|
header: {
|
|
77
77
|
flexDirection: 'row',
|