ordering-ui-react-native 0.22.35 → 0.22.37

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.22.35",
3
+ "version": "0.22.37",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -11,7 +11,8 @@ import {
11
11
  useToast,
12
12
  useLanguage,
13
13
  useUtils,
14
- useConfig
14
+ useConfig,
15
+ useValidationFields
15
16
  } from 'ordering-components/native';
16
17
  import {
17
18
  CenterView,
@@ -57,7 +58,8 @@ const ProfileUI = (props: ProfileParams) => {
57
58
  const [, t] = useLanguage();
58
59
  const [, { showToast }] = useToast();
59
60
  const [{ optimizeImage }] = useUtils();
60
- const [{ configs }] = useConfig()
61
+ const [{ configs }] = useConfig();
62
+ const [{ loading }, { loadOriginalValidationFields }] = useValidationFields()
61
63
  const { errors } = useForm();
62
64
  const theme = useTheme();
63
65
 
@@ -262,15 +264,17 @@ const ProfileUI = (props: ProfileParams) => {
262
264
 
263
265
  return (
264
266
  <>
265
- {validationFields?.error && (
267
+ {validationFields?.error && !loading && (
266
268
  <NotFoundSource
267
269
  content={
268
- validationFields?.error[0] ||
269
- validationFields?.error[0]?.message ||
270
+ validationFields?.error?.[0] ||
271
+ validationFields?.error?.[0]?.message ||
270
272
  t('NETWORK_ERROR', 'Network Error')
271
273
  }
272
274
  image={theme.images.general.notFound}
273
275
  conditioned={false}
276
+ onClickButton={() => loadOriginalValidationFields({ forceLoading: true })}
277
+ btnTitle={t('REFRESH_PROFILE', 'Refresh profile')}
274
278
  />
275
279
  )}
276
280
 
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useState, useRef } from 'react';
2
- import { StyleSheet, View, Keyboard, Modal } from 'react-native';
2
+ import { StyleSheet, View, Keyboard, Modal, Platform } from 'react-native';
3
3
  import Spinner from 'react-native-loading-spinner-overlay';
4
4
  import { useForm, Controller } from 'react-hook-form';
5
5
  import { PhoneInputNumber } from '../PhoneInputNumber';
@@ -108,7 +108,7 @@ const LoginFormUI = (props: LoginParams) => {
108
108
 
109
109
  const googleLoginEnabled = configs?.google_login_enabled?.value === '1' || !configs?.google_login_enabled?.enabled
110
110
  const facebookLoginEnabled = configs?.facebook_login_enabled?.value === '1' || !configs?.facebook_login_enabled?.enabled
111
- const appleLoginEnabled = configs?.apple_login_enabled?.value === '1' || !configs?.apple_login_enabled?.enabled
111
+ const appleLoginEnabled = Platform.OS === 'ios' && configs?.apple_login_enabled?.value === '1' || !configs?.apple_login_enabled?.enabled
112
112
 
113
113
  const loginStyle = StyleSheet.create({
114
114
  btnOutline: {
@@ -270,7 +270,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
270
270
  title: t('DRIVER', 'Driver'),
271
271
  icon:
272
272
  order?.driver?.photo ||
273
- 'https://res.cloudinary.com/demo/image/fetch/c_thumb,g_face,r_max/https://www.freeiconspng.com/thumbs/driver-icon/driver-icon-14.png',
273
+ theme?.images?.general?.driverPng,
274
274
  },
275
275
  {
276
276
  ...order?.business?.location,