ordering-ui-react-native 0.16.25 → 0.16.26-release
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -4
- 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/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 +5 -4
- 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/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 +81 -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 +289 -175
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +22 -8
- 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 +42 -10
- 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 +93 -53
- 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 +8 -3
- package/themes/original/src/components/HelpGuide/index.tsx +8 -3
- package/themes/original/src/components/HelpOrder/index.tsx +8 -3
- 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 +82 -44
- 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/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 +1 -34
- 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 +100 -106
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +17 -12
- 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 +4 -10
- 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 +710 -653
- package/themes/original/src/components/ProductForm/styles.tsx +9 -7
- 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 +631 -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 +207 -107
- 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 +174 -162
- package/themes/original/src/components/Wallets/styles.tsx +10 -8
- package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
- package/themes/original/src/components/shared/OBottomPopup.tsx +47 -14
- 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/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
|
@@ -32,6 +32,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
32
32
|
latitudeDelta: 0.0010,
|
|
33
33
|
longitudeDelta: 0.0010 * ASPECT_RATIO
|
|
34
34
|
})
|
|
35
|
+
const [MARKERS, SETMARKERS] = useState(locations)
|
|
35
36
|
let mapRef = useRef<any>(null)
|
|
36
37
|
const googleMapsApiKey = configState?.configs?.google_maps_api_key?.value
|
|
37
38
|
|
|
@@ -41,12 +42,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
41
42
|
ERROR_NOT_FOUND_ADDRESS: 'Sorry, we couldn\'t find an address',
|
|
42
43
|
ERROR_MAX_LIMIT_LOCATION: `Sorry, You can only set the position to ${maxLimitLocation}m`
|
|
43
44
|
}
|
|
44
|
-
|
|
45
|
-
return {
|
|
46
|
-
latitude: location.lat,
|
|
47
|
-
longitude: location.lng
|
|
48
|
-
}
|
|
49
|
-
})
|
|
45
|
+
|
|
50
46
|
const geocodePosition = (pos: { latitude: number, longitude: number }) => {
|
|
51
47
|
Geocoder.from({
|
|
52
48
|
latitude: pos.latitude,
|
|
@@ -93,7 +89,9 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
93
89
|
return
|
|
94
90
|
}
|
|
95
91
|
|
|
96
|
-
|
|
92
|
+
const _maxLimitLocation = typeof maxLimitLocation === 'string' ? parseInt(maxLimitLocation, 10) : maxLimitLocation
|
|
93
|
+
|
|
94
|
+
if (distance <= _maxLimitLocation) {
|
|
97
95
|
setMarkerPosition(curPos)
|
|
98
96
|
setRegion({ ...region, longitude: curPos.longitude, latitude: curPos.latitude })
|
|
99
97
|
} else {
|
|
@@ -147,7 +145,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
147
145
|
}
|
|
148
146
|
|
|
149
147
|
const fitAllMarkers = () => {
|
|
150
|
-
mapRef.current.fitToCoordinates(MARKERS, {
|
|
148
|
+
mapRef.current.fitToCoordinates(MARKERS?.map(location => ({ latitude: location.lat, longitude: location.lng })), {
|
|
151
149
|
edgePadding: { top: 80, right: 80, bottom: 80, left: 80 },
|
|
152
150
|
animated: true,
|
|
153
151
|
});
|
|
@@ -157,6 +155,13 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
157
155
|
Geocoder.init(googleMapsApiKey)
|
|
158
156
|
}, [])
|
|
159
157
|
|
|
158
|
+
useEffect(() => {
|
|
159
|
+
mapRef.current.animateToRegion({
|
|
160
|
+
...region,
|
|
161
|
+
latitude: location?.lat,
|
|
162
|
+
longitude: location?.lng,
|
|
163
|
+
})
|
|
164
|
+
}, [location])
|
|
160
165
|
|
|
161
166
|
useEffect(() => {
|
|
162
167
|
if (saveLocation) {
|
|
@@ -170,6 +175,9 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
170
175
|
fitAllMarkers()
|
|
171
176
|
}
|
|
172
177
|
}, 1000)
|
|
178
|
+
if (locations) {
|
|
179
|
+
SETMARKERS(locations)
|
|
180
|
+
}
|
|
173
181
|
return () => clearInterval(interval)
|
|
174
182
|
}, [locations])
|
|
175
183
|
|
|
@@ -189,16 +197,16 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
189
197
|
>
|
|
190
198
|
{locations ? (
|
|
191
199
|
<>
|
|
192
|
-
{MARKERS && MARKERS.map((location: {
|
|
200
|
+
{MARKERS && MARKERS.map((location: { lat: number, lng: number }, i: number) => (
|
|
193
201
|
<React.Fragment key={i}>
|
|
194
202
|
{
|
|
195
203
|
<Marker
|
|
196
204
|
zIndex={i}
|
|
197
|
-
coordinate={location}
|
|
198
|
-
title={
|
|
205
|
+
coordinate={{ latitude: location.lat ?? 0, longitude: location.lng ?? 0 }}
|
|
206
|
+
title={MARKERS[i]?.title}
|
|
199
207
|
>
|
|
200
208
|
<View>
|
|
201
|
-
<OIcon url={
|
|
209
|
+
<OIcon url={MARKERS[i].icon} width={50} height={50} />
|
|
202
210
|
</View>
|
|
203
211
|
</Marker>
|
|
204
212
|
}
|
|
@@ -3,7 +3,8 @@ import { useLanguage } from 'ordering-components/native'
|
|
|
3
3
|
import { HelpAccountAndPaymentParams } from '../../types'
|
|
4
4
|
import { OText, OButton, OIcon } from '../shared'
|
|
5
5
|
import { useTheme } from 'styled-components/native'
|
|
6
|
-
import { StyleSheet } from 'react-native'
|
|
6
|
+
import { StyleSheet, TouchableOpacity } from 'react-native'
|
|
7
|
+
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
7
8
|
|
|
8
9
|
import {
|
|
9
10
|
Content
|
|
@@ -38,10 +39,14 @@ export const HelpAccountAndPayment = (props: HelpAccountAndPaymentParams) => {
|
|
|
38
39
|
return (
|
|
39
40
|
<>
|
|
40
41
|
<OButton
|
|
41
|
-
imgLeftSrc={theme.images.general.arrow_left}
|
|
42
42
|
imgRightSrc={null}
|
|
43
43
|
style={styles.btnBackArrow}
|
|
44
44
|
onClick={() => goToBack()}
|
|
45
|
+
icon={AntDesignIcon}
|
|
46
|
+
iconProps={{
|
|
47
|
+
name: 'arrowleft',
|
|
48
|
+
size: 26
|
|
49
|
+
}}
|
|
45
50
|
/>
|
|
46
51
|
<OText size={22} weight={600}>{t('ACCOUNT_PAYMENT_OPTIONS', 'Account and Payment Options')}</OText>
|
|
47
52
|
<Content>
|
|
@@ -65,4 +70,4 @@ export const HelpAccountAndPayment = (props: HelpAccountAndPaymentParams) => {
|
|
|
65
70
|
</Content>
|
|
66
71
|
</>
|
|
67
72
|
)
|
|
68
|
-
}
|
|
73
|
+
}
|
|
@@ -3,10 +3,11 @@ import { useLanguage } from 'ordering-components/native'
|
|
|
3
3
|
import { HelpGuideParams } from '../../types'
|
|
4
4
|
import { OText, OButton, OIcon } from '../shared'
|
|
5
5
|
import { useTheme } from 'styled-components/native'
|
|
6
|
-
import { StyleSheet } from 'react-native'
|
|
6
|
+
import { StyleSheet, TouchableOpacity } from 'react-native'
|
|
7
7
|
import {
|
|
8
8
|
Content
|
|
9
9
|
} from './styles'
|
|
10
|
+
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
10
11
|
|
|
11
12
|
export const HelpGuide = (props: HelpGuideParams) => {
|
|
12
13
|
const {
|
|
@@ -37,10 +38,14 @@ export const HelpGuide = (props: HelpGuideParams) => {
|
|
|
37
38
|
return (
|
|
38
39
|
<>
|
|
39
40
|
<OButton
|
|
40
|
-
imgLeftSrc={theme.images.general.arrow_left}
|
|
41
41
|
imgRightSrc={null}
|
|
42
42
|
style={styles.btnBackArrow}
|
|
43
43
|
onClick={() => goToBack()}
|
|
44
|
+
icon={AntDesignIcon}
|
|
45
|
+
iconProps={{
|
|
46
|
+
name: 'arrowleft',
|
|
47
|
+
size: 26
|
|
48
|
+
}}
|
|
44
49
|
/>
|
|
45
50
|
<OText size={22} weight={600}>{t('GUIDE_TO_ORDERING', 'Guide to Ordering')}</OText>
|
|
46
51
|
<Content>
|
|
@@ -64,4 +69,4 @@ export const HelpGuide = (props: HelpGuideParams) => {
|
|
|
64
69
|
</Content>
|
|
65
70
|
</>
|
|
66
71
|
)
|
|
67
|
-
}
|
|
72
|
+
}
|
|
@@ -3,8 +3,9 @@ import { useLanguage } from 'ordering-components/native'
|
|
|
3
3
|
import { HelpOrderParams } from '../../types'
|
|
4
4
|
import { OText, OButton, OIcon } from '../shared'
|
|
5
5
|
import { useTheme } from 'styled-components/native'
|
|
6
|
-
import { StyleSheet } from 'react-native'
|
|
6
|
+
import { StyleSheet, TouchableOpacity } from 'react-native'
|
|
7
7
|
import { WebView } from 'react-native-webview'
|
|
8
|
+
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
8
9
|
|
|
9
10
|
import {
|
|
10
11
|
Content
|
|
@@ -42,10 +43,14 @@ export const HelpOrder = (props: HelpOrderParams) => {
|
|
|
42
43
|
return (
|
|
43
44
|
<>
|
|
44
45
|
<OButton
|
|
45
|
-
imgLeftSrc={theme.images.general.arrow_left}
|
|
46
46
|
imgRightSrc={null}
|
|
47
47
|
style={styles.btnBackArrow}
|
|
48
48
|
onClick={() => goToBack()}
|
|
49
|
+
icon={AntDesignIcon}
|
|
50
|
+
iconProps={{
|
|
51
|
+
name: 'arrowleft',
|
|
52
|
+
size: 26
|
|
53
|
+
}}
|
|
49
54
|
/>
|
|
50
55
|
<OText size={22} weight={600}>{t('HELP_WITH_ORDER', 'Help with an order')}</OText>
|
|
51
56
|
<Content>
|
|
@@ -76,4 +81,4 @@ export const HelpOrder = (props: HelpOrderParams) => {
|
|
|
76
81
|
</Content>
|
|
77
82
|
</>
|
|
78
83
|
)
|
|
79
|
-
}
|
|
84
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { LanguageSelector as LanguageSelectorController, useOrder } from 'ordering-components/native'
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { LanguageSelector as LanguageSelectorController, useOrder, useLanguage } from 'ordering-components/native'
|
|
3
3
|
import { useTheme } from 'styled-components/native';
|
|
4
|
-
import {
|
|
4
|
+
import { StyleSheet, View } from 'react-native'
|
|
5
5
|
|
|
6
6
|
import RNPickerSelect from 'react-native-picker-select'
|
|
7
7
|
import { Container, DummyContainer } from './styles'
|
|
@@ -9,9 +9,17 @@ import { LanguageSelectorParams } from '../../types'
|
|
|
9
9
|
import { OIcon } from '../shared'
|
|
10
10
|
|
|
11
11
|
const LanguageSelectorUI = (props: LanguageSelectorParams) => {
|
|
12
|
+
const {
|
|
13
|
+
languagesState,
|
|
14
|
+
currentLanguage,
|
|
15
|
+
handleChangeLanguage,
|
|
16
|
+
iconColor,
|
|
17
|
+
pickerStyle
|
|
18
|
+
} = props
|
|
12
19
|
|
|
13
20
|
const [orderState] = useOrder()
|
|
14
|
-
|
|
21
|
+
const [state] = useLanguage()
|
|
22
|
+
const [languagePressed, setLanguagePressed] = useState(currentLanguage)
|
|
15
23
|
const theme = useTheme();
|
|
16
24
|
|
|
17
25
|
const _pickerStyle = StyleSheet.create({
|
|
@@ -41,14 +49,11 @@ const LanguageSelectorUI = (props: LanguageSelectorParams) => {
|
|
|
41
49
|
color: theme.colors.secundaryContrast
|
|
42
50
|
}
|
|
43
51
|
})
|
|
44
|
-
|
|
45
|
-
const {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
iconColor,
|
|
50
|
-
pickerStyle
|
|
51
|
-
} = props
|
|
52
|
+
|
|
53
|
+
const changeLanguage = (lang : string) => {
|
|
54
|
+
setLanguagePressed(lang)
|
|
55
|
+
handleChangeLanguage(lang)
|
|
56
|
+
}
|
|
52
57
|
|
|
53
58
|
const _languages = languagesState?.languages?.map((language: any) => {
|
|
54
59
|
return {
|
|
@@ -67,14 +72,14 @@ const LanguageSelectorUI = (props: LanguageSelectorParams) => {
|
|
|
67
72
|
<>
|
|
68
73
|
{iconColor && <OIcon src={theme.images.general.language} color={iconColor} style={{ marginEnd: 14 }} width={16} />}
|
|
69
74
|
<RNPickerSelect
|
|
70
|
-
onValueChange={
|
|
75
|
+
onValueChange={changeLanguage}
|
|
71
76
|
items={_languages || []}
|
|
72
77
|
value={currentLanguage}
|
|
73
78
|
style={pickerStyle ? pickerStyle : _pickerStyle}
|
|
74
79
|
useNativeAndroidPickerStyle={false}
|
|
75
80
|
placeholder={{}}
|
|
76
81
|
Icon={() => <View style={pickerStyle ? pickerStyle.icon : _pickerStyle.icon}><OIcon src={theme.images.general.arrow_down} color={theme.colors.white} style={{ width: '100%' }} /></View>}
|
|
77
|
-
disabled={orderState.loading}
|
|
82
|
+
disabled={orderState.loading || state.loading || state?.language?.code !== languagePressed}
|
|
78
83
|
/>
|
|
79
84
|
</>
|
|
80
85
|
) : <DummyContainer />}
|
|
@@ -1,90 +1,113 @@
|
|
|
1
|
-
import React, { useEffect } from 'react'
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
2
|
import { formatSeconds } from '../../../utils'
|
|
3
3
|
import { StyleSheet, TouchableOpacity } from 'react-native';
|
|
4
4
|
import { useCountdownTimer } from '../../../../../../src/hooks/useCountdownTimer';
|
|
5
5
|
import { useLanguage } from 'ordering-components/native';
|
|
6
6
|
import { OTPContainer } from './styles';
|
|
7
7
|
import { OText, OButton } from '../../shared';
|
|
8
|
-
import
|
|
8
|
+
import OtpInputs from 'react-native-otp-inputs';
|
|
9
9
|
import { useTheme } from 'styled-components/native';
|
|
10
10
|
import { otpParams } from '../../../types'
|
|
11
11
|
|
|
12
12
|
export const Otp = (props: otpParams) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
const {
|
|
14
|
+
willVerifyOtpState,
|
|
15
|
+
setWillVerifyOtpState,
|
|
16
|
+
onSubmit,
|
|
17
|
+
handleLoginOtp,
|
|
18
|
+
setAlertState,
|
|
19
|
+
pinCount
|
|
20
|
+
} = props
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
const theme = useTheme();
|
|
23
|
+
const [, t] = useLanguage();
|
|
24
|
+
const [otpLeftTime, _, resetOtpLeftTime]: any = useCountdownTimer(
|
|
25
|
+
600, willVerifyOtpState)
|
|
25
26
|
|
|
27
|
+
const [code, setCode] = useState('')
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
|
|
30
|
+
const handleOnSubmit = () => {
|
|
31
|
+
setAlertState({
|
|
32
|
+
open: true,
|
|
33
|
+
title: t('CODE_SENT', 'The code has been sent'),
|
|
34
|
+
})
|
|
35
|
+
resetOtpLeftTime()
|
|
36
|
+
onSubmit()
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (otpLeftTime === 0) {
|
|
41
|
+
setAlertState({
|
|
42
|
+
open: true,
|
|
43
|
+
title: t('TIME_IS_UP', 'Time is up'),
|
|
44
|
+
content: t('PLEASE_RESEND_CODE', 'Please resend code again')
|
|
45
|
+
})
|
|
34
46
|
}
|
|
47
|
+
}, [otpLeftTime])
|
|
35
48
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
content: t('PLEASE_RESEND_CODE', 'Please resend code again')
|
|
42
|
-
})
|
|
43
|
-
}
|
|
44
|
-
}, [otpLeftTime])
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (code?.length === (pinCount || 6)) {
|
|
51
|
+
handleLoginOtp(code)
|
|
52
|
+
}
|
|
53
|
+
}, [code])
|
|
45
54
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
const loginStyle = StyleSheet.create({
|
|
56
|
+
container: {
|
|
57
|
+
width: '100%',
|
|
58
|
+
flexDirection: 'row',
|
|
59
|
+
justifyContent: 'space-between',
|
|
60
|
+
marginVertical: 30
|
|
61
|
+
},
|
|
62
|
+
focusStyles: {
|
|
63
|
+
borderColor: theme.colors.primary,
|
|
64
|
+
borderWidth: 1,
|
|
65
|
+
borderRadius: 8
|
|
66
|
+
},
|
|
67
|
+
underlineStyleBase: {
|
|
68
|
+
width: 45,
|
|
69
|
+
height: 50,
|
|
70
|
+
borderWidth: 1,
|
|
71
|
+
fontSize: 16,
|
|
72
|
+
borderRadius: 8,
|
|
73
|
+
borderColor: theme.colors.lightGray,
|
|
74
|
+
textAlign: 'center'
|
|
75
|
+
},
|
|
76
|
+
underlineStyleHighLighted: {
|
|
77
|
+
borderColor: theme.colors.primary,
|
|
78
|
+
color: theme.colors.primary,
|
|
79
|
+
fontSize: 16
|
|
80
|
+
},
|
|
81
|
+
});
|
|
59
82
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
83
|
+
return (
|
|
84
|
+
<>
|
|
85
|
+
<OTPContainer>
|
|
86
|
+
<OText size={24}>
|
|
87
|
+
{formatSeconds(otpLeftTime)}
|
|
88
|
+
</OText>
|
|
89
|
+
<OtpInputs
|
|
90
|
+
autofillFromClipboard
|
|
91
|
+
numberOfInputs={pinCount || 6}
|
|
92
|
+
style={loginStyle.container}
|
|
93
|
+
inputStyles={loginStyle.underlineStyleBase}
|
|
94
|
+
focusStyles={loginStyle.focusStyles}
|
|
95
|
+
handleChange={setCode}
|
|
96
|
+
/>
|
|
97
|
+
<TouchableOpacity onPress={() => handleOnSubmit()} disabled={otpLeftTime > 520}>
|
|
98
|
+
<OText size={16} mBottom={30} color={otpLeftTime > 520 ? theme.colors.disabled : theme.colors.primary}>
|
|
99
|
+
{t('RESEND_CODE', 'Resend code')}
|
|
100
|
+
</OText>
|
|
101
|
+
</TouchableOpacity>
|
|
102
|
+
<OButton
|
|
103
|
+
onClick={() => setWillVerifyOtpState(false)}
|
|
104
|
+
bgColor={theme.colors.white}
|
|
105
|
+
borderColor={theme.colors.primary}
|
|
106
|
+
textStyle={{ color: theme.colors.primary }}
|
|
107
|
+
style={{ borderRadius: 8, width: '100%' }}
|
|
108
|
+
text={t('CANCEL', 'Cancel')}
|
|
109
|
+
/>
|
|
110
|
+
</OTPContainer>
|
|
111
|
+
</>
|
|
112
|
+
)
|
|
90
113
|
}
|
|
@@ -5,6 +5,7 @@ import { useForm, Controller } from 'react-hook-form';
|
|
|
5
5
|
import { PhoneInputNumber } from '../PhoneInputNumber';
|
|
6
6
|
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
|
|
7
7
|
import Recaptcha from 'react-native-recaptcha-that-works'
|
|
8
|
+
import ReCaptcha from '@fatnlazycat/react-native-recaptcha-v3'
|
|
8
9
|
|
|
9
10
|
import {
|
|
10
11
|
LoginForm as LoginFormController,
|
|
@@ -102,7 +103,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
102
103
|
|
|
103
104
|
const googleLoginEnabled = configs?.google_login_enabled?.value === '1' || !configs?.google_login_enabled?.enabled
|
|
104
105
|
const facebookLoginEnabled = configs?.facebook_login_enabled?.value === '1' || !configs?.facebook_login_enabled?.enabled
|
|
105
|
-
|
|
106
|
+
const appleLoginEnabled = configs?.apple_login_enabled?.value === '1' || !configs?.apple_login_enabled?.enabled
|
|
106
107
|
|
|
107
108
|
const loginStyle = StyleSheet.create({
|
|
108
109
|
btnOutline: {
|
|
@@ -235,7 +236,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
235
236
|
|
|
236
237
|
const onRecaptchaVerify = (token: any) => {
|
|
237
238
|
setRecaptchaVerified(true)
|
|
238
|
-
handleReCaptcha(token)
|
|
239
|
+
handleReCaptcha({ code: token, version: recaptchaConfig?.version })
|
|
239
240
|
}
|
|
240
241
|
|
|
241
242
|
const handleChangeOtpType = (type: string) => {
|
|
@@ -256,7 +257,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
256
257
|
})
|
|
257
258
|
}
|
|
258
259
|
|
|
259
|
-
const handleCategoryScroll = (opc
|
|
260
|
+
const handleCategoryScroll = (opc: string) => {
|
|
260
261
|
tabsRef.current.scrollTo({
|
|
261
262
|
x: tabLayouts?.[opc]?.x - 40,
|
|
262
263
|
animated: true
|
|
@@ -272,15 +273,39 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
272
273
|
|
|
273
274
|
useEffect(() => {
|
|
274
275
|
if (configs && Object.keys(configs).length > 0 && enableReCaptcha) {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
276
|
+
if (configs?.security_recaptcha_type?.value === 'v3' &&
|
|
277
|
+
configs?.security_recaptcha_score_v3?.value > 0 &&
|
|
278
|
+
configs?.security_recaptcha_site_key_v3?.value
|
|
279
|
+
) {
|
|
280
|
+
setRecaptchaConfig({
|
|
281
|
+
version: 'v3',
|
|
282
|
+
siteKey: configs?.security_recaptcha_site_key_v3?.value || null,
|
|
283
|
+
baseUrl: configs?.security_recaptcha_base_url?.value || null
|
|
284
|
+
})
|
|
285
|
+
return
|
|
286
|
+
}
|
|
287
|
+
if (configs?.security_recaptcha_site_key?.value) {
|
|
288
|
+
setRecaptchaConfig({
|
|
289
|
+
version: 'v2',
|
|
290
|
+
siteKey: configs?.security_recaptcha_site_key?.value || null,
|
|
291
|
+
baseUrl: configs?.security_recaptcha_base_url?.value || null
|
|
292
|
+
})
|
|
293
|
+
}
|
|
279
294
|
}
|
|
280
295
|
}, [configs, enableReCaptcha])
|
|
281
296
|
|
|
282
297
|
useEffect(() => {
|
|
283
298
|
if (!formState.loading && formState.result?.error) {
|
|
299
|
+
if (formState.result?.result?.[0] === 'ERROR_AUTH_VERIFICATION_CODE') {
|
|
300
|
+
setRecaptchaVerified(false)
|
|
301
|
+
setRecaptchaConfig({
|
|
302
|
+
version: 'v2',
|
|
303
|
+
siteKey: configs?.security_recaptcha_site_key?.value || null,
|
|
304
|
+
baseUrl: configs?.security_recaptcha_base_url?.value || null
|
|
305
|
+
})
|
|
306
|
+
showToast(ToastType.Info, t('TRY_AGAIN', 'Please try again'))
|
|
307
|
+
return
|
|
308
|
+
}
|
|
284
309
|
formState.result?.result &&
|
|
285
310
|
showToast(
|
|
286
311
|
ToastType.Error,
|
|
@@ -351,15 +376,15 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
351
376
|
titleStyle={{ marginRight: 0, marginLeft: 0 }}
|
|
352
377
|
/>
|
|
353
378
|
<FormSide>
|
|
354
|
-
{((useLoginByEmail
|
|
379
|
+
{(Number(useLoginByEmail) + Number(useLoginByCellphone) + Number(useLoginOtpEmail) + Number(useLoginOtpCellphone) > 1) && (
|
|
355
380
|
<LoginWith>
|
|
356
381
|
<OTabs
|
|
357
|
-
horizontal
|
|
382
|
+
horizontal
|
|
358
383
|
showsHorizontalScrollIndicator={false}
|
|
359
384
|
ref={tabsRef}
|
|
360
385
|
>
|
|
361
386
|
{useLoginByEmail && (
|
|
362
|
-
<TabBtn
|
|
387
|
+
<TabBtn
|
|
363
388
|
onPress={() => handleChangeTab('email')}
|
|
364
389
|
onLayout={(event: any) => handleOnLayout(event, 'email')}
|
|
365
390
|
>
|
|
@@ -384,7 +409,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
384
409
|
</TabBtn>
|
|
385
410
|
)}
|
|
386
411
|
{useLoginByCellphone && (
|
|
387
|
-
<TabBtn
|
|
412
|
+
<TabBtn
|
|
388
413
|
onPress={() => handleChangeTab('cellphone')}
|
|
389
414
|
onLayout={(event: any) => handleOnLayout(event, 'cellphone')}
|
|
390
415
|
>
|
|
@@ -409,7 +434,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
409
434
|
</TabBtn>
|
|
410
435
|
)}
|
|
411
436
|
{useLoginOtpEmail && (
|
|
412
|
-
<TabBtn
|
|
437
|
+
<TabBtn
|
|
413
438
|
onPress={() => handleChangeOtpType('email')}
|
|
414
439
|
onLayout={(event: any) => handleOnLayout(event, 'otp_email')}
|
|
415
440
|
>
|
|
@@ -434,7 +459,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
434
459
|
</TabBtn>
|
|
435
460
|
)}
|
|
436
461
|
{useLoginOtpCellphone && (
|
|
437
|
-
<TabBtn
|
|
462
|
+
<TabBtn
|
|
438
463
|
onPress={() => handleChangeOtpType('cellphone')}
|
|
439
464
|
onLayout={(event: any) => handleOnLayout(event, 'otp_cellphone')}
|
|
440
465
|
>
|
|
@@ -596,35 +621,47 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
596
621
|
</TouchableOpacity>
|
|
597
622
|
)}
|
|
598
623
|
|
|
599
|
-
{enableReCaptcha && (
|
|
624
|
+
{(enableReCaptcha && recaptchaConfig?.version) && (
|
|
600
625
|
<>
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
{
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
626
|
+
{recaptchaConfig?.version === 'v3' ? (
|
|
627
|
+
<ReCaptcha
|
|
628
|
+
url={recaptchaConfig?.baseUrl}
|
|
629
|
+
siteKey={recaptchaConfig?.siteKey}
|
|
630
|
+
containerStyle={{ height: 40 }}
|
|
631
|
+
onExecute={onRecaptchaVerify}
|
|
632
|
+
reCaptchaType={1}
|
|
633
|
+
/>
|
|
634
|
+
) : (
|
|
635
|
+
<>
|
|
636
|
+
<TouchableOpacity
|
|
637
|
+
onPress={handleOpenRecaptcha}
|
|
638
|
+
>
|
|
639
|
+
<RecaptchaButton>
|
|
640
|
+
{recaptchaVerified ? (
|
|
641
|
+
<MaterialCommunityIcons
|
|
642
|
+
name="checkbox-marked"
|
|
643
|
+
size={26}
|
|
644
|
+
color={theme.colors.primary}
|
|
645
|
+
/>
|
|
646
|
+
) : (
|
|
647
|
+
<MaterialCommunityIcons
|
|
648
|
+
name="checkbox-blank-outline"
|
|
649
|
+
size={26}
|
|
650
|
+
color={theme.colors.mediumGray}
|
|
651
|
+
/>
|
|
652
|
+
)}
|
|
653
|
+
<OText size={14} mLeft={8}>{t('VERIFY_ReCAPTCHA', 'Verify reCAPTCHA')}</OText>
|
|
654
|
+
</RecaptchaButton>
|
|
655
|
+
</TouchableOpacity>
|
|
656
|
+
<Recaptcha
|
|
657
|
+
ref={recaptchaRef}
|
|
658
|
+
siteKey={recaptchaConfig?.siteKey}
|
|
659
|
+
baseUrl={recaptchaConfig?.baseUrl}
|
|
660
|
+
onVerify={onRecaptchaVerify}
|
|
661
|
+
onExpire={() => setRecaptchaVerified(false)}
|
|
662
|
+
/>
|
|
663
|
+
</>)
|
|
664
|
+
}
|
|
628
665
|
</>
|
|
629
666
|
)}
|
|
630
667
|
<OButton
|
|
@@ -682,8 +719,9 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
682
719
|
)}
|
|
683
720
|
|
|
684
721
|
{configs && Object.keys(configs).length > 0 ? (
|
|
685
|
-
(((configs?.facebook_login?.value === 'true' || configs?.facebook_login?.value === '1') && configs?.facebook_id?.value) ||
|
|
686
|
-
|
|
722
|
+
(((configs?.facebook_login?.value === 'true' || configs?.facebook_login?.value === '1') && configs?.facebook_id?.value && facebookLoginEnabled) ||
|
|
723
|
+
((configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) && googleLoginEnabled) ||
|
|
724
|
+
((configs?.apple_login_client_id?.value !== '' && configs?.apple_login_client_id?.value !== null) && appleLoginEnabled)) &&
|
|
687
725
|
(
|
|
688
726
|
<>
|
|
689
727
|
<View
|
|
@@ -707,7 +745,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
707
745
|
<ButtonsWrapper>
|
|
708
746
|
<SocialButtons>
|
|
709
747
|
{(configs?.facebook_login?.value === 'true' || configs?.facebook_login?.value === '1') &&
|
|
710
|
-
configs?.facebook_id?.value &&
|
|
748
|
+
configs?.facebook_id?.value &&
|
|
711
749
|
facebookLoginEnabled && (
|
|
712
750
|
<FacebookLogin
|
|
713
751
|
notificationState={notificationState}
|