ordering-ui-react-native 0.18.3-release → 0.18.4-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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.18.3-release",
3
+ "version": "0.18.4-release",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -39,7 +39,6 @@ import { NotFoundSource } from '../NotFoundSource';
39
39
  import AntDesignIcon from 'react-native-vector-icons/AntDesign'
40
40
  const ProfileUI = (props: ProfileParams) => {
41
41
  const {
42
- navigation,
43
42
  formState,
44
43
  isEdit,
45
44
  validationFields,
@@ -48,9 +47,7 @@ const ProfileUI = (props: ProfileParams) => {
48
47
  cleanFormState,
49
48
  handleToggleAvalaibleStatusDriver,
50
49
  userState,
51
- isAvailableLoading,
52
- isAlsea,
53
- isHideDriverStatus
50
+ isAlsea
54
51
  } = props;
55
52
 
56
53
  const [{ user }] = useSession();
@@ -60,6 +57,8 @@ const ProfileUI = (props: ProfileParams) => {
60
57
  const { errors } = useForm();
61
58
  const theme = useTheme();
62
59
 
60
+ const isShowDriverStatus = user?.level === 4 && (props.isShowDriverStatus || (!props.isShowDriverStatus && !userState?.result?.result?.available))
61
+
63
62
  const [phoneInputData, setPhoneInputData] = useState({
64
63
  error: '',
65
64
  phone: {
@@ -346,7 +345,7 @@ const ProfileUI = (props: ProfileParams) => {
346
345
  />
347
346
  </CenterView>
348
347
 
349
- {user?.level === 4 && !isHideDriverStatus && (
348
+ {isShowDriverStatus && (
350
349
  <EnabledStatusDriver>
351
350
  <View style={{ flex: 1 }}>
352
351
  <OText
@@ -374,7 +373,7 @@ const ProfileUI = (props: ProfileParams) => {
374
373
  !userState?.result?.result?.available,
375
374
  )
376
375
  }
377
- disabled={userState?.loading}
376
+ disabled={userState?.loading || userState?.result?.result?.available}
378
377
  animationSpeed={200}
379
378
  />
380
379
  )}
@@ -57,7 +57,7 @@ export interface ProfileParams {
57
57
  showField?: any;
58
58
  isRequiredField?: any;
59
59
  isAlsea?: boolean;
60
- isHideDriverStatus?: boolean;
60
+ isShowDriverStatus?: boolean;
61
61
  }
62
62
 
63
63
  export interface AddressListParams {