ordering-ui-react-native 0.21.45 → 0.21.46-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 -7
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/PaymentOptionsWebView/index.tsx +1 -0
- package/src/components/StripeMethodForm/index.tsx +6 -4
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/types/index.tsx +3 -1
- package/src/utils/index.tsx +2 -2
- package/themes/business/index.tsx +6 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +7 -3
- package/themes/business/src/components/BusinessController/index.tsx +19 -17
- package/themes/business/src/components/BusinessProductList/AccordionDropdown.tsx +63 -0
- package/themes/business/src/components/BusinessProductList/IterateCategories.tsx +108 -0
- package/themes/business/src/components/BusinessProductList/ProductList.tsx +196 -0
- package/themes/business/src/components/BusinessProductList/index.tsx +196 -0
- package/themes/business/src/components/BusinessProductList/styles.tsx +10 -0
- package/themes/business/src/components/DriverMap/index.tsx +36 -23
- package/themes/business/src/components/GoogleMap/index.tsx +15 -8
- package/themes/business/src/components/Home/index.tsx +5 -1
- package/themes/business/src/components/LanguageSelector/index.tsx +1 -2
- package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
- package/themes/business/src/components/LogoutButton/index.tsx +1 -1
- package/themes/business/src/components/MapView/index.tsx +30 -15
- package/themes/business/src/components/MessagesOption/index.tsx +2 -1
- package/themes/business/src/components/NewOrderNotification/index.tsx +66 -26
- package/themes/business/src/components/OrderDetails/Business.tsx +52 -2
- package/themes/business/src/components/OrderDetails/Delivery.tsx +30 -11
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +68 -61
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +40 -20
- package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
- package/themes/business/src/components/OrderSummary/index.tsx +240 -76
- package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
- package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
- package/themes/business/src/components/OrdersOption/index.tsx +125 -46
- package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +37 -40
- package/themes/business/src/components/PreviousOrders/OrderList.tsx +1 -1
- package/themes/business/src/components/PreviousOrders/index.tsx +5 -3
- package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
- package/themes/business/src/components/PrinterEdition/index.tsx +363 -0
- package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
- package/themes/business/src/components/PrinterSettings/index.tsx +267 -0
- package/themes/business/src/components/PrinterSettings/styles.tsx +30 -0
- package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
- package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
- package/themes/business/src/components/SearchBar/index.tsx +2 -1
- package/themes/business/src/components/Sessions/index.tsx +187 -0
- package/themes/business/src/components/Sessions/styles.tsx +20 -0
- package/themes/business/src/components/StoresList/index.tsx +5 -3
- package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
- package/themes/business/src/components/UserProfileForm/index.tsx +106 -54
- package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
- package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
- package/themes/business/src/components/shared/OInput.tsx +2 -0
- package/themes/business/src/components/shared/OTextarea.tsx +8 -9
- package/themes/business/src/hooks/useLocation.tsx +5 -4
- package/themes/business/src/types/index.tsx +16 -2
- package/themes/business/src/utils/index.tsx +5 -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/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/original/index.tsx +12 -4
- package/themes/original/src/components/AddressDetails/index.tsx +20 -10
- package/themes/original/src/components/AddressForm/index.tsx +41 -12
- package/themes/original/src/components/AddressForm/styles.tsx +1 -1
- package/themes/original/src/components/AddressList/index.tsx +18 -4
- package/themes/original/src/components/AddressList/styles.tsx +4 -4
- package/themes/original/src/components/AnalyticsSegment/index.tsx +6 -6
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +7 -10
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
- package/themes/original/src/components/BusinessController/index.tsx +18 -10
- package/themes/original/src/components/BusinessController/styles.tsx +8 -7
- package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
- package/themes/original/src/components/BusinessListingSearch/index.tsx +47 -358
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
- package/themes/original/src/components/BusinessPreorder/index.tsx +4 -3
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
- package/themes/original/src/components/BusinessProductsList/index.tsx +1 -1
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +34 -19
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
- package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +7 -7
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +2 -2
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
- package/themes/original/src/components/Cart/index.tsx +32 -9
- package/themes/original/src/components/CartContent/index.tsx +96 -58
- package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +144 -62
- package/themes/original/src/components/Checkout/styles.tsx +17 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
- package/themes/original/src/components/DatePicker/index.tsx +33 -0
- package/themes/original/src/components/DatePicker/styles.tsx +20 -0
- package/themes/original/src/components/Favorite/index.tsx +9 -9
- package/themes/original/src/components/Favorite/styles.tsx +0 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -0
- package/themes/original/src/components/GPSButton/index.tsx +1 -1
- package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
- package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
- package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
- package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
- package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +83 -0
- package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
- package/themes/original/src/components/GoogleMap/index.tsx +39 -18
- package/themes/original/src/components/Help/index.tsx +7 -0
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +5 -0
- package/themes/original/src/components/HelpGuide/index.tsx +5 -0
- package/themes/original/src/components/HelpOrder/index.tsx +5 -0
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +2 -2
- package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
- package/themes/original/src/components/Home/index.tsx +3 -8
- package/themes/original/src/components/LoginForm/Otp/index.tsx +4 -16
- package/themes/original/src/components/LoginForm/index.tsx +9 -3
- package/themes/original/src/components/MessageListing/index.tsx +6 -0
- package/themes/original/src/components/Messages/index.tsx +8 -7
- package/themes/original/src/components/Messages/styles.tsx +1 -1
- package/themes/original/src/components/MomentOption/index.tsx +19 -4
- package/themes/original/src/components/MultiCart/index.tsx +1 -1
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +7 -3
- package/themes/original/src/components/MultiCheckout/index.tsx +126 -61
- package/themes/original/src/components/MultiCheckout/styles.tsx +17 -0
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -15
- package/themes/original/src/components/MyOrders/index.tsx +28 -28
- package/themes/original/src/components/NavBar/index.tsx +5 -0
- package/themes/original/src/components/NetworkError/index.tsx +2 -3
- package/themes/original/src/components/NetworkError/styles.tsx +2 -2
- package/themes/original/src/components/Notifications/index.tsx +9 -8
- package/themes/original/src/components/Notifications/styles.tsx +0 -1
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +1 -1
- package/themes/original/src/components/OrderDetails/index.tsx +708 -663
- package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
- package/themes/original/src/components/OrderProgress/index.tsx +22 -3
- package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
- package/themes/original/src/components/OrderSummary/index.tsx +3 -1
- package/themes/original/src/components/OrderTypeSelector/index.tsx +10 -6
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/index.tsx +3 -5
- package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
- package/themes/original/src/components/PaymentOptionCard/index.tsx +4 -2
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +47 -4
- package/themes/original/src/components/PreviousOrders/index.tsx +2 -0
- package/themes/original/src/components/ProductForm/ActionButton.tsx +122 -0
- package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
- package/themes/original/src/components/ProductForm/index.tsx +170 -252
- package/themes/original/src/components/ProductItemAccordion/index.tsx +55 -44
- package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +112 -91
- package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
- package/themes/original/src/components/Promotions/index.tsx +13 -11
- package/themes/original/src/components/Promotions/styles.tsx +0 -2
- package/themes/original/src/components/ReviewDriver/index.tsx +5 -0
- package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
- package/themes/original/src/components/ReviewOrder/index.tsx +5 -0
- package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
- package/themes/original/src/components/ReviewProducts/index.tsx +5 -0
- package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
- package/themes/original/src/components/ServiceForm/index.tsx +1 -1
- package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
- package/themes/original/src/components/Sessions/index.tsx +5 -0
- package/themes/original/src/components/SignupForm/index.tsx +67 -59
- package/themes/original/src/components/SingleOrderCard/index.tsx +3 -2
- package/themes/original/src/components/SingleProductCard/index.tsx +4 -3
- package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
- package/themes/original/src/components/StripeCardsList/index.tsx +12 -35
- package/themes/original/src/components/StripeElementsForm/index.tsx +79 -59
- package/themes/original/src/components/StripeElementsForm/naked.tsx +47 -0
- package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
- package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +91 -0
- package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
- package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
- package/themes/original/src/components/UserFormDetails/index.tsx +123 -75
- package/themes/original/src/components/UserFormDetails/styles.tsx +7 -0
- package/themes/original/src/components/UserProfile/index.tsx +3 -2
- package/themes/original/src/components/UserProfileForm/index.tsx +5 -0
- package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
- package/themes/original/src/components/Wallets/index.tsx +7 -4
- package/themes/original/src/components/Wallets/styles.tsx +2 -1
- package/themes/original/src/components/WebsocketStatus/index.tsx +172 -0
- package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
- package/themes/original/src/components/shared/OButton.tsx +5 -5
- package/themes/original/src/components/shared/OInput.tsx +1 -4
- package/themes/original/src/components/shared/OModal.tsx +12 -14
- package/themes/original/src/layouts/Container.tsx +5 -3
- package/themes/original/src/types/index.tsx +4 -1
- package/themes/original/src/utils/index.tsx +12 -1
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -11,6 +11,8 @@ import {
|
|
|
11
11
|
useToast,
|
|
12
12
|
useLanguage,
|
|
13
13
|
useUtils,
|
|
14
|
+
useConfig,
|
|
15
|
+
useValidationFields
|
|
14
16
|
} from 'ordering-components/native';
|
|
15
17
|
import {
|
|
16
18
|
CenterView,
|
|
@@ -23,6 +25,7 @@ import { LogoutButton } from '../LogoutButton';
|
|
|
23
25
|
import { LanguageSelector } from '../LanguageSelector';
|
|
24
26
|
import { UserFormDetailsUI } from '../UserFormDetails';
|
|
25
27
|
import { DriverSchedule } from '../DriverSchedule'
|
|
28
|
+
import { PrinterSettings } from '../PrinterSettings'
|
|
26
29
|
import ToggleSwitch from 'toggle-switch-react-native';
|
|
27
30
|
import { UDWrapper } from '../UserFormDetails/styles';
|
|
28
31
|
import {
|
|
@@ -39,7 +42,6 @@ import { NotFoundSource } from '../NotFoundSource';
|
|
|
39
42
|
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
40
43
|
const ProfileUI = (props: ProfileParams) => {
|
|
41
44
|
const {
|
|
42
|
-
navigation,
|
|
43
45
|
formState,
|
|
44
46
|
isEdit,
|
|
45
47
|
validationFields,
|
|
@@ -47,20 +49,21 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
47
49
|
toggleIsEdit,
|
|
48
50
|
cleanFormState,
|
|
49
51
|
handleToggleAvalaibleStatusDriver,
|
|
50
|
-
userState,
|
|
51
|
-
isAvailableLoading,
|
|
52
52
|
isAlsea,
|
|
53
|
-
|
|
53
|
+
isShowDriverStatus,
|
|
54
|
+
navigation
|
|
54
55
|
} = props;
|
|
55
56
|
|
|
56
|
-
const [{ user }] = useSession();
|
|
57
|
-
const [
|
|
57
|
+
const [{ user, sessionLoading }] = useSession();
|
|
58
|
+
const [, t] = useLanguage();
|
|
58
59
|
const [, { showToast }] = useToast();
|
|
59
60
|
const [{ optimizeImage }] = useUtils();
|
|
61
|
+
const [{ configs }] = useConfig();
|
|
62
|
+
const [{ loading }, { loadOriginalValidationFields }] = useValidationFields()
|
|
60
63
|
const { errors } = useForm();
|
|
61
64
|
const theme = useTheme();
|
|
62
65
|
|
|
63
|
-
const [phoneInputData, setPhoneInputData] = useState({
|
|
66
|
+
const [phoneInputData, setPhoneInputData] = useState<any>({
|
|
64
67
|
error: '',
|
|
65
68
|
phone: {
|
|
66
69
|
country_phone_code: null,
|
|
@@ -68,17 +71,15 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
68
71
|
},
|
|
69
72
|
});
|
|
70
73
|
const [phoneUpdate, setPhoneUpdate] = useState(false);
|
|
74
|
+
const [userState, setUserState] = useState(props.userState)
|
|
71
75
|
const [userPhoneNumber, setUserPhoneNumber] = useState<any>(null);
|
|
72
76
|
const [phoneToShow, setPhoneToShow] = useState('');
|
|
73
77
|
const [openModal, setOpenModal] = useState(false)
|
|
74
|
-
|
|
78
|
+
const allowDriverUpdateData = user?.level !== 4 || configs?.allow_driver_update_data?.value === "1"
|
|
75
79
|
useEffect(() => {
|
|
76
80
|
if (phoneInputData.phone.cellphone) {
|
|
77
|
-
const codeNumberPhone = phoneInputData.phone.
|
|
78
|
-
const numberPhone = phoneInputData.phone.cellphone
|
|
79
|
-
3,
|
|
80
|
-
phoneInputData.phone.cellphone?.length,
|
|
81
|
-
);
|
|
81
|
+
const codeNumberPhone = phoneInputData.phone.country_phone_code
|
|
82
|
+
const numberPhone = phoneInputData.phone.cellphone
|
|
82
83
|
setPhoneToShow(`(${codeNumberPhone}) ${numberPhone}`);
|
|
83
84
|
}
|
|
84
85
|
}, [phoneInputData.phone.cellphone]);
|
|
@@ -116,14 +117,15 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
116
117
|
maxWidth: 200,
|
|
117
118
|
includeBase64: true,
|
|
118
119
|
},
|
|
119
|
-
(
|
|
120
|
-
|
|
120
|
+
(image: any) => {
|
|
121
|
+
const response = image?.assets?.[0];
|
|
122
|
+
if (response?.didCancel) {
|
|
121
123
|
console.log('User cancelled image picker');
|
|
122
|
-
} else if (response
|
|
124
|
+
} else if (response?.errorMessage) {
|
|
123
125
|
console.log('ImagePicker Error: ', response.errorMessage);
|
|
124
126
|
showToast(ToastType.Error, response.errorMessage);
|
|
125
127
|
} else {
|
|
126
|
-
if (response
|
|
128
|
+
if (response?.uri) {
|
|
127
129
|
const url = `data:${response.type};base64,${response.base64}`;
|
|
128
130
|
handleButtonUpdateClick(null, true, url);
|
|
129
131
|
} else {
|
|
@@ -207,6 +209,22 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
207
209
|
}
|
|
208
210
|
}, [user?.country_phone_code]);
|
|
209
211
|
|
|
212
|
+
useEffect(() => {
|
|
213
|
+
setUserState({ ...userState, ...props.userState })
|
|
214
|
+
}, [props.userState])
|
|
215
|
+
|
|
216
|
+
useEffect(() => {
|
|
217
|
+
if (!user?.id) return
|
|
218
|
+
|
|
219
|
+
setUserState({
|
|
220
|
+
...userState,
|
|
221
|
+
result: {
|
|
222
|
+
error: true,
|
|
223
|
+
result: user
|
|
224
|
+
}
|
|
225
|
+
})
|
|
226
|
+
}, [user, props.isFocused])
|
|
227
|
+
|
|
210
228
|
const styles = StyleSheet.create({
|
|
211
229
|
label: {
|
|
212
230
|
color: theme.colors.textGray,
|
|
@@ -243,19 +261,21 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
243
261
|
|
|
244
262
|
return (
|
|
245
263
|
<>
|
|
246
|
-
{validationFields?.error && (
|
|
264
|
+
{validationFields?.error && !loading && (
|
|
247
265
|
<NotFoundSource
|
|
248
266
|
content={
|
|
249
|
-
validationFields?.error[0] ||
|
|
250
|
-
validationFields?.error[0]?.message ||
|
|
267
|
+
validationFields?.error?.[0] ||
|
|
268
|
+
validationFields?.error?.[0]?.message ||
|
|
251
269
|
t('NETWORK_ERROR', 'Network Error')
|
|
252
270
|
}
|
|
253
271
|
image={theme.images.general.notFound}
|
|
254
272
|
conditioned={false}
|
|
273
|
+
onClickButton={() => loadOriginalValidationFields({ forceLoading: true })}
|
|
274
|
+
btnTitle={t('REFRESH_PROFILE', 'Refresh profile')}
|
|
255
275
|
/>
|
|
256
276
|
)}
|
|
257
277
|
|
|
258
|
-
{(formState?.loading ||
|
|
278
|
+
{(formState?.loading || sessionLoading) && !validationFields.error && (
|
|
259
279
|
<View
|
|
260
280
|
style={{
|
|
261
281
|
backgroundColor: theme.colors.backgroundLight,
|
|
@@ -326,7 +346,7 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
326
346
|
</View>
|
|
327
347
|
)}
|
|
328
348
|
|
|
329
|
-
{!formState?.loading
|
|
349
|
+
{!(formState?.loading || sessionLoading) && !validationFields.error && (
|
|
330
350
|
<ScrollView showsVerticalScrollIndicator={false} style={{ flex: 1 }}>
|
|
331
351
|
<CenterView>
|
|
332
352
|
<OIcon
|
|
@@ -336,17 +356,18 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
336
356
|
height={150}
|
|
337
357
|
style={{ borderRadius: 7.2 }}
|
|
338
358
|
/>
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
359
|
+
{allowDriverUpdateData && (
|
|
360
|
+
<OIconButton
|
|
361
|
+
icon={theme.images.general.camera}
|
|
362
|
+
borderColor={theme.colors.clear}
|
|
363
|
+
iconStyle={{ width: 21, height: 21 }}
|
|
364
|
+
style={{ maxWidth: 40 }}
|
|
365
|
+
onClick={() => handleImagePicker()}
|
|
366
|
+
/>
|
|
367
|
+
)}
|
|
347
368
|
</CenterView>
|
|
348
369
|
|
|
349
|
-
{user?.level === 4 &&
|
|
370
|
+
{user?.level === 4 && (
|
|
350
371
|
<EnabledStatusDriver>
|
|
351
372
|
<View style={{ flex: 1 }}>
|
|
352
373
|
<OText
|
|
@@ -354,29 +375,33 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
354
375
|
adjustsFontSizeToFit
|
|
355
376
|
style={{ ...styles.label, paddingHorizontal: 0 }}>
|
|
356
377
|
{t(
|
|
357
|
-
'AVAILABLE_TO_RECEIVE_ORDERS
|
|
358
|
-
'Available to receive orders
|
|
378
|
+
`${!isShowDriverStatus ? 'NOT_' : ''}AVAILABLE_TO_RECEIVE_ORDERS`,
|
|
379
|
+
`${!isShowDriverStatus ? 'You are not ' : ''}Available to receive orders`
|
|
359
380
|
)}
|
|
360
381
|
</OText>
|
|
361
382
|
</View>
|
|
362
383
|
|
|
363
|
-
{
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
384
|
+
{isShowDriverStatus && (
|
|
385
|
+
<>
|
|
386
|
+
{userState.loadingDriver ? (
|
|
387
|
+
<ActivityIndicator size="small" color={theme.colors.primary} />
|
|
388
|
+
) : (
|
|
389
|
+
<ToggleSwitch
|
|
390
|
+
isOn={userState?.result?.result?.available}
|
|
391
|
+
onColor={theme.colors.primary}
|
|
392
|
+
offColor={theme.colors.offColor}
|
|
393
|
+
size="small"
|
|
394
|
+
onToggle={() =>
|
|
395
|
+
handleToggleAvalaibleStatusDriver &&
|
|
396
|
+
handleToggleAvalaibleStatusDriver(
|
|
397
|
+
!userState?.result?.result?.available,
|
|
398
|
+
)
|
|
399
|
+
}
|
|
400
|
+
disabled={userState?.loading}
|
|
401
|
+
animationSpeed={200}
|
|
402
|
+
/>
|
|
403
|
+
)}
|
|
404
|
+
</>
|
|
380
405
|
)}
|
|
381
406
|
</EnabledStatusDriver>
|
|
382
407
|
)}
|
|
@@ -439,7 +464,6 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
439
464
|
/>
|
|
440
465
|
|
|
441
466
|
<OText style={styles.label}>{t('PHONE', 'Phone')}</OText>
|
|
442
|
-
|
|
443
467
|
<OInput
|
|
444
468
|
isSecured={true}
|
|
445
469
|
placeholder={
|
|
@@ -462,6 +486,7 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
462
486
|
handleCancelEdit={handleCancelEdit}
|
|
463
487
|
toggleIsEdit={toggleIsEdit}
|
|
464
488
|
isAlsea={isAlsea}
|
|
489
|
+
allowDriverUpdateData={allowDriverUpdateData}
|
|
465
490
|
/>
|
|
466
491
|
</View>
|
|
467
492
|
)}
|
|
@@ -479,9 +504,34 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
479
504
|
/>
|
|
480
505
|
</EditButton>
|
|
481
506
|
)}
|
|
482
|
-
|
|
507
|
+
{!props.isBusinessApp ? (
|
|
508
|
+
<Pressable style={{ marginBottom: 10 }} onPress={() => setOpenModal(true)}>
|
|
509
|
+
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
|
|
510
|
+
<OText size={16}>{t('SCHEDULE', 'Schedule')}</OText>
|
|
511
|
+
<AntDesignIcon size={18} name='right' />
|
|
512
|
+
</View>
|
|
513
|
+
<View style={{
|
|
514
|
+
borderBottomColor: theme.colors.tabBar,
|
|
515
|
+
borderBottomWidth: 1,
|
|
516
|
+
marginTop: 10
|
|
517
|
+
}} />
|
|
518
|
+
</Pressable>
|
|
519
|
+
) : (
|
|
520
|
+
<Pressable style={{ marginBottom: 10 }} onPress={() => navigation.navigate('PrinterSetup')}>
|
|
521
|
+
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
|
|
522
|
+
<OText size={16}>{t('PRINTER_SETTINGS', 'Printer Settings')}</OText>
|
|
523
|
+
<AntDesignIcon size={18} name='right' />
|
|
524
|
+
</View>
|
|
525
|
+
<View style={{
|
|
526
|
+
borderBottomColor: theme.colors.tabBar,
|
|
527
|
+
borderBottomWidth: 1,
|
|
528
|
+
marginTop: 10
|
|
529
|
+
}} />
|
|
530
|
+
</Pressable>
|
|
531
|
+
)}
|
|
532
|
+
<Pressable style={{ marginBottom: 10 }} onPress={() => navigation.navigate('Sessions')}>
|
|
483
533
|
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
|
|
484
|
-
<OText size={16}>{t('
|
|
534
|
+
<OText size={16}>{t('SESSIONS', 'Sessions')}</OText>
|
|
485
535
|
<AntDesignIcon size={18} name='right' />
|
|
486
536
|
</View>
|
|
487
537
|
<View style={{
|
|
@@ -501,7 +551,9 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
501
551
|
entireModal
|
|
502
552
|
hideIcons
|
|
503
553
|
>
|
|
504
|
-
|
|
554
|
+
{!props.isBusinessApp && (
|
|
555
|
+
<DriverSchedule schedule={user?.schedule} />
|
|
556
|
+
)}
|
|
505
557
|
</OModal>
|
|
506
558
|
</ScrollView>
|
|
507
559
|
)}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { useLanguage, useUtils, WebsocketStatus as WebsocketStatusController } from 'ordering-components/native'
|
|
3
|
+
import { TouchableOpacity, View, StyleSheet } from 'react-native'
|
|
4
|
+
import MaterialIcon from 'react-native-vector-icons/MaterialCommunityIcons';
|
|
5
|
+
import { useTheme } from 'styled-components/native'
|
|
6
|
+
import RNRestart from 'react-native-restart'
|
|
7
|
+
import { OModal, OButton, OText, OIcon } from '../shared'
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
Container,
|
|
11
|
+
ModalContainer,
|
|
12
|
+
ModalTitle,
|
|
13
|
+
StatusItemWrapper,
|
|
14
|
+
StatusText
|
|
15
|
+
} from './styles'
|
|
16
|
+
|
|
17
|
+
const SocketStatusUI = (props: any) => {
|
|
18
|
+
const {
|
|
19
|
+
socketStatus,
|
|
20
|
+
connectedDate
|
|
21
|
+
} = props
|
|
22
|
+
|
|
23
|
+
const theme = useTheme()
|
|
24
|
+
const [, t] = useLanguage()
|
|
25
|
+
const [{ parseDate }] = useUtils()
|
|
26
|
+
const [openModal, setOpenModal] = useState(false)
|
|
27
|
+
|
|
28
|
+
const styles = StyleSheet.create({
|
|
29
|
+
btnBackArrow: {
|
|
30
|
+
borderWidth: 0,
|
|
31
|
+
width: 32,
|
|
32
|
+
height: 32,
|
|
33
|
+
tintColor: theme.colors.textGray,
|
|
34
|
+
backgroundColor: theme.colors.clear,
|
|
35
|
+
borderColor: theme.colors.clear,
|
|
36
|
+
shadowColor: theme.colors.clear,
|
|
37
|
+
paddingLeft: 0,
|
|
38
|
+
paddingRight: 0,
|
|
39
|
+
marginBottom: 30,
|
|
40
|
+
marginTop: 30
|
|
41
|
+
},
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
const getStatusColor = (status: number) => {
|
|
45
|
+
switch (status) {
|
|
46
|
+
case 0:
|
|
47
|
+
return '#FF9922';
|
|
48
|
+
case 1:
|
|
49
|
+
return '#00D27A';
|
|
50
|
+
case 2:
|
|
51
|
+
return '#E63757';
|
|
52
|
+
default:
|
|
53
|
+
return '#FF9922';
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<Container>
|
|
59
|
+
<TouchableOpacity
|
|
60
|
+
style={{
|
|
61
|
+
flexDirection: 'row',
|
|
62
|
+
alignItems: 'center',
|
|
63
|
+
justifyContent: 'center',
|
|
64
|
+
backgroundColor: theme.colors.inputChat,
|
|
65
|
+
borderRadius: 7.6,
|
|
66
|
+
marginVertical: 10,
|
|
67
|
+
paddingVertical: 10,
|
|
68
|
+
paddingHorizontal: 15,
|
|
69
|
+
}}
|
|
70
|
+
activeOpacity={0.6}
|
|
71
|
+
onPress={() => setOpenModal(true)}
|
|
72
|
+
>
|
|
73
|
+
<OText
|
|
74
|
+
style={{ color: theme.colors.backArrow, fontSize: 16, marginBottom: 0, lineHeight: 16 }}
|
|
75
|
+
>
|
|
76
|
+
{t('CONNECTION_STATUS_SHORT', 'Status')}
|
|
77
|
+
</OText>
|
|
78
|
+
<MaterialIcon
|
|
79
|
+
name='circle'
|
|
80
|
+
size={12}
|
|
81
|
+
color={getStatusColor(socketStatus)}
|
|
82
|
+
style={{ marginLeft: 8 }}
|
|
83
|
+
/>
|
|
84
|
+
</TouchableOpacity>
|
|
85
|
+
|
|
86
|
+
<OModal
|
|
87
|
+
open={openModal}
|
|
88
|
+
onClose={() => setOpenModal(false)}
|
|
89
|
+
entireModal
|
|
90
|
+
customClose
|
|
91
|
+
>
|
|
92
|
+
<ModalContainer nestedScrollEnabled={true}>
|
|
93
|
+
<TouchableOpacity
|
|
94
|
+
onPress={() => setOpenModal(false)}
|
|
95
|
+
style={styles.btnBackArrow}
|
|
96
|
+
>
|
|
97
|
+
<OIcon src={theme.images.general.arrow_left} color={theme.colors.textGray} />
|
|
98
|
+
</TouchableOpacity>
|
|
99
|
+
<View>
|
|
100
|
+
<ModalTitle>{t('CONNECTION_STATUS', 'Connection status')}</ModalTitle>
|
|
101
|
+
<OText style={{ marginBottom: 20 }}>
|
|
102
|
+
{t('LAST_UPDATE', 'Last update')}: {parseDate(connectedDate)}
|
|
103
|
+
</OText>
|
|
104
|
+
<StatusItemWrapper>
|
|
105
|
+
<MaterialIcon
|
|
106
|
+
name='circle'
|
|
107
|
+
size={12}
|
|
108
|
+
color={getStatusColor(1)}
|
|
109
|
+
style={{ marginTop: 10, marginHorizontal: 8 }}
|
|
110
|
+
/>
|
|
111
|
+
<View style={{ marginLeft: 16 }}>
|
|
112
|
+
<StatusText>{t('OK', 'Ok')}</StatusText>
|
|
113
|
+
<OText style={{ color: theme.colors.backArrow, fontSize: 14 }}>{t('WEBSOCKET_OK', 'The websocket works normally.')}</OText>
|
|
114
|
+
</View>
|
|
115
|
+
</StatusItemWrapper>
|
|
116
|
+
<StatusItemWrapper>
|
|
117
|
+
<MaterialIcon
|
|
118
|
+
name='circle'
|
|
119
|
+
size={12}
|
|
120
|
+
color={getStatusColor(0)}
|
|
121
|
+
style={{ marginTop: 10, marginHorizontal: 8 }}
|
|
122
|
+
/>
|
|
123
|
+
<View style={{ marginLeft: 16 }}>
|
|
124
|
+
<StatusText>{t('CONNECTING', 'Connecting')}</StatusText>
|
|
125
|
+
<OText style={{ color: theme.colors.backArrow, fontSize: 14 }}>{t('WEBSOCKET_CONNECTING', 'The websocket is connecting.')}</OText>
|
|
126
|
+
</View>
|
|
127
|
+
</StatusItemWrapper>
|
|
128
|
+
<StatusItemWrapper>
|
|
129
|
+
<MaterialIcon
|
|
130
|
+
name='circle'
|
|
131
|
+
size={12}
|
|
132
|
+
color={getStatusColor(2)}
|
|
133
|
+
style={{ marginTop: 10, marginHorizontal: 8 }}
|
|
134
|
+
/>
|
|
135
|
+
<View style={{ marginLeft: 16 }}>
|
|
136
|
+
<StatusText>{t('DISCONNECTED', 'Disconnected')}</StatusText>
|
|
137
|
+
<OText style={{ color: theme.colors.backArrow, fontSize: 14 }}>{t('WEBSOCKET_DISCONNECTED', 'The server is slow, please reload.')}</OText>
|
|
138
|
+
</View>
|
|
139
|
+
</StatusItemWrapper>
|
|
140
|
+
|
|
141
|
+
<View style={{ flexDirection: 'row', marginTop: 50 }}>
|
|
142
|
+
<OButton
|
|
143
|
+
onClick={() => setOpenModal(false)}
|
|
144
|
+
bgColor={theme.colors.white}
|
|
145
|
+
borderColor={theme.colors.primary}
|
|
146
|
+
textStyle={{ color: theme.colors.primary }}
|
|
147
|
+
style={{ borderRadius: 8, height: 48 }}
|
|
148
|
+
text={t('CLOSE', 'Close')}
|
|
149
|
+
/>
|
|
150
|
+
<OButton
|
|
151
|
+
onClick={() => RNRestart.Restart()}
|
|
152
|
+
borderColor={theme.colors.primary}
|
|
153
|
+
textStyle={{ color: theme.colors.white }}
|
|
154
|
+
style={{ borderRadius: 8, marginLeft: 16, height: 48 }}
|
|
155
|
+
text={t('UPDATE', 'Update')}
|
|
156
|
+
/>
|
|
157
|
+
</View>
|
|
158
|
+
</View>
|
|
159
|
+
</ModalContainer>
|
|
160
|
+
</OModal>
|
|
161
|
+
</Container>
|
|
162
|
+
)
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export const WebsocketStatus = (props: any) => {
|
|
166
|
+
const socketProps = {
|
|
167
|
+
...props,
|
|
168
|
+
UIComponent: SocketStatusUI
|
|
169
|
+
}
|
|
170
|
+
return <WebsocketStatusController {...socketProps} />
|
|
171
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import styled from 'styled-components/native'
|
|
2
|
+
|
|
3
|
+
export const Container = styled.View`
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
`
|
|
7
|
+
export const ModalContainer = styled.ScrollView`
|
|
8
|
+
padding: 0px 30px;
|
|
9
|
+
`
|
|
10
|
+
export const ModalTitle = styled.Text`
|
|
11
|
+
font-family: Poppins;
|
|
12
|
+
font-style: normal;
|
|
13
|
+
font-weight: bold;
|
|
14
|
+
font-size: 20px;
|
|
15
|
+
color: ${(props: any) => props.theme.colors.textGray};
|
|
16
|
+
margin-bottom: 10px;
|
|
17
|
+
`
|
|
18
|
+
export const StatusItemWrapper = styled.View`
|
|
19
|
+
flex-direction: row;
|
|
20
|
+
margin-bottom: 16px;
|
|
21
|
+
`
|
|
22
|
+
export const StatusText = styled.Text`
|
|
23
|
+
font-family: Poppins;
|
|
24
|
+
font-style: normal;
|
|
25
|
+
font-weight: 500;
|
|
26
|
+
font-size: 18px;
|
|
27
|
+
color: ${(props: any) => props.theme.colors.textGray};
|
|
28
|
+
`
|
|
@@ -64,6 +64,7 @@ interface Props extends TextInputProps {
|
|
|
64
64
|
onSubmitEditing?: any;
|
|
65
65
|
blurOnSubmit?: any;
|
|
66
66
|
color?: any;
|
|
67
|
+
isValueSync?: boolean
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
const OInput = (props: Props): React.ReactElement => {
|
|
@@ -118,6 +119,7 @@ const OInput = (props: Props): React.ReactElement => {
|
|
|
118
119
|
selectionColor={props.selectionColor}
|
|
119
120
|
color={props.color}
|
|
120
121
|
maxLength={props.maxLength || 1000}
|
|
122
|
+
value={props.isValueSync && props.value}
|
|
121
123
|
/>
|
|
122
124
|
|
|
123
125
|
{props.iconRight && (
|
|
@@ -4,8 +4,10 @@ import { useTheme } from 'styled-components/native';
|
|
|
4
4
|
|
|
5
5
|
const Wrapper = styled.View`
|
|
6
6
|
border-radius: 10px;
|
|
7
|
-
border: 1px
|
|
7
|
+
border-width: 1px;
|
|
8
|
+
border-color: ${(props: any) => props.theme.colors.lightGray};
|
|
8
9
|
`;
|
|
10
|
+
|
|
9
11
|
const Inner = styled.TextInput`
|
|
10
12
|
height: 100px;
|
|
11
13
|
padding: 5px 10px 5px 10px;
|
|
@@ -29,16 +31,13 @@ const OTextarea = (props: Props) => {
|
|
|
29
31
|
ref={props.textTareaRef}
|
|
30
32
|
onFocus={() => props.onFocus()}
|
|
31
33
|
onChangeText={(txt: any) => props.onChange(txt)}
|
|
32
|
-
textAlignVertical={'top'}
|
|
33
34
|
placeholder={props.placeholder}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
placeholderTextColor={theme.colors.lightGray}
|
|
36
|
+
numberOfLines={props.lines}
|
|
37
|
+
underlineColorAndroid={'transparent'}
|
|
38
|
+
value={props.value}
|
|
39
|
+
multiline={true}
|
|
38
40
|
autoFocus={props.autoFocus}
|
|
39
|
-
multiline={true}
|
|
40
|
-
selectionColor={theme.colors.primary}
|
|
41
|
-
color={theme.colors.textGray}
|
|
42
41
|
/>
|
|
43
42
|
</Wrapper>
|
|
44
43
|
);
|
|
@@ -48,8 +48,8 @@ export const useLocation = () => {
|
|
|
48
48
|
GeoLocation.getCurrentPosition(
|
|
49
49
|
({ coords }) => {
|
|
50
50
|
resolve({
|
|
51
|
-
latitude: coords.latitude,
|
|
52
|
-
longitude: coords.longitude,
|
|
51
|
+
latitude: typeof coords.latitude === 'number' && !Number.isNaN(coords.latitude) ? coords.latitude : 0,
|
|
52
|
+
longitude: typeof coords.longitude === 'number' && !Number.isNaN(coords.longitude) ? coords.longitude : 0,
|
|
53
53
|
speed: coords.speed,
|
|
54
54
|
});
|
|
55
55
|
},
|
|
@@ -63,9 +63,10 @@ export const useLocation = () => {
|
|
|
63
63
|
watchId.current = GeoLocation.watchPosition(
|
|
64
64
|
({ coords }) => {
|
|
65
65
|
if (!isMounted.current) return;
|
|
66
|
+
if (typeof coords.latitude !== 'number' || typeof coords.longitude !== 'number') return
|
|
66
67
|
const location: Location = {
|
|
67
|
-
latitude: coords.latitude,
|
|
68
|
-
longitude: coords.longitude,
|
|
68
|
+
latitude: coords.latitude || 0,
|
|
69
|
+
longitude: coords.longitude || 0,
|
|
69
70
|
speed: coords.speed,
|
|
70
71
|
};
|
|
71
72
|
setUserLocation(location);
|
|
@@ -57,7 +57,9 @@ export interface ProfileParams {
|
|
|
57
57
|
showField?: any;
|
|
58
58
|
isRequiredField?: any;
|
|
59
59
|
isAlsea?: boolean;
|
|
60
|
-
|
|
60
|
+
isShowDriverStatus?: boolean;
|
|
61
|
+
isFocused?: boolean;
|
|
62
|
+
isBusinessApp?: boolean;
|
|
61
63
|
}
|
|
62
64
|
|
|
63
65
|
export interface AddressListParams {
|
|
@@ -173,6 +175,7 @@ export interface BusinessControllerParams {
|
|
|
173
175
|
isBusinessOpen?: boolean;
|
|
174
176
|
businessWillCloseSoonMinutes?: number;
|
|
175
177
|
updateBusiness?: (id: any, value: any) => {};
|
|
178
|
+
navigation?: any;
|
|
176
179
|
}
|
|
177
180
|
export interface BusinessProductsListingParams {
|
|
178
181
|
navigation?: any;
|
|
@@ -301,6 +304,7 @@ export interface OrdersOptionParams {
|
|
|
301
304
|
filtered?: any;
|
|
302
305
|
handleClickOrder?: any;
|
|
303
306
|
orderGroupStatusCustom?: {
|
|
307
|
+
active?: Array<number>;
|
|
304
308
|
pending?: Array<number>;
|
|
305
309
|
inProgress?: Array<number>;
|
|
306
310
|
completed?: Array<number>;
|
|
@@ -388,7 +392,7 @@ export interface OrderDetailsParams {
|
|
|
388
392
|
urlToShare?: string;
|
|
389
393
|
messages?: any;
|
|
390
394
|
handleAssignDriver?: (id: any) => {};
|
|
391
|
-
handleChangeOrderStatus?: (status: any) => {};
|
|
395
|
+
handleChangeOrderStatus?: (status: any, isAcceptOrReject: any) => {};
|
|
392
396
|
order?: any;
|
|
393
397
|
isFromRoot?: any;
|
|
394
398
|
handleOrderRedirect?: () => {};
|
|
@@ -492,6 +496,7 @@ export interface FloatingButtonParams {
|
|
|
492
496
|
firstColorCustom?: string;
|
|
493
497
|
secondColorCustom?: string;
|
|
494
498
|
paddingBottomIos?: any;
|
|
499
|
+
isHideRejectButtons?: boolean
|
|
495
500
|
}
|
|
496
501
|
export interface MomentOptionParams {
|
|
497
502
|
navigation: any;
|
|
@@ -592,6 +597,7 @@ export interface AcceptOrRejectOrderParams {
|
|
|
592
597
|
isPage?: boolean
|
|
593
598
|
navigation?: any
|
|
594
599
|
route?: any
|
|
600
|
+
isLoadingOrder?: boolean
|
|
595
601
|
}
|
|
596
602
|
|
|
597
603
|
export interface MapViewParams {
|
|
@@ -626,3 +632,11 @@ export interface OrderDetailsLogisticParams {
|
|
|
626
632
|
orderAssingId: number,
|
|
627
633
|
order: any
|
|
628
634
|
}
|
|
635
|
+
|
|
636
|
+
export interface SessionsParams {
|
|
637
|
+
navigation: any,
|
|
638
|
+
sessionsList: any,
|
|
639
|
+
actionState: any,
|
|
640
|
+
handleDeleteSession: any,
|
|
641
|
+
handleDeleteAllSessions: any
|
|
642
|
+
}
|
|
@@ -146,6 +146,11 @@ export const transformCountryCode = (countryCode: number) => {
|
|
|
146
146
|
return code?.countryCode;
|
|
147
147
|
};
|
|
148
148
|
|
|
149
|
+
export const findExitingCode = (countryCode: string) => {
|
|
150
|
+
const code = CODES.find((code: any) => code.countryCode === (countryCode || '').toUpperCase())
|
|
151
|
+
return code?.countryCode
|
|
152
|
+
}
|
|
153
|
+
|
|
149
154
|
/**
|
|
150
155
|
* Function to check if a number is decimal or not
|
|
151
156
|
* @param {*} value number to check if decimal or not
|
|
@@ -197,7 +197,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
197
197
|
{isFarAway && (
|
|
198
198
|
<FarAwayMessage style={styles.farAwayMsg}>
|
|
199
199
|
<Ionicons name='md-warning-outline' style={styles.iconStyle} />
|
|
200
|
-
<OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', '
|
|
200
|
+
<OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
|
|
201
201
|
</FarAwayMessage>
|
|
202
202
|
)}
|
|
203
203
|
{!auth && (
|
|
@@ -410,8 +410,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
410
410
|
textInputProps={{
|
|
411
411
|
returnKeyType: 'next',
|
|
412
412
|
onSubmitEditing: () => inputRef?.current?.focus?.(),
|
|
413
|
-
style: { borderWidth: 0, fontSize: 12 }
|
|
414
|
-
maxLength: 10
|
|
413
|
+
style: { borderWidth: 0, fontSize: 12 }
|
|
415
414
|
}}
|
|
416
415
|
textWrapStyle={{ borderColor: theme.colors.clear, borderWidth: 0, height: 40, paddingStart: 0 }}
|
|
417
416
|
/>
|
|
@@ -155,7 +155,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
155
155
|
{isFarAway && (
|
|
156
156
|
<FarAwayMessage style={styles.farAwayMsg}>
|
|
157
157
|
<Ionicons name='md-warning-outline' style={styles.iconStyle} />
|
|
158
|
-
<OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', '
|
|
158
|
+
<OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
|
|
159
159
|
</FarAwayMessage>
|
|
160
160
|
)}
|
|
161
161
|
<View style={styles.wrapperOrderOptions}>
|