Changed image viewer and added mobile feature check.
This commit is contained in:
@@ -3,6 +3,7 @@ import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
|
||||
import { NavigationContainer } from "@react-navigation/native";
|
||||
import { createStackNavigator } from "@react-navigation/stack";
|
||||
import i18n from "i18next";
|
||||
import moment from "moment";
|
||||
import React, { useEffect } from "react";
|
||||
import { Button } from "react-native-paper";
|
||||
import { SafeAreaView } from "react-native-safe-area-context";
|
||||
@@ -174,7 +175,11 @@ export function ScreenMainComponent({
|
||||
<ScreenSplash />
|
||||
) : currentUser.authorized ? (
|
||||
bodyshop ? (
|
||||
<BottomTabsNavigator />
|
||||
HasAccess(bodyshop) ? (
|
||||
<BottomTabsNavigator />
|
||||
) : (
|
||||
<ScreenSplash noAccess />
|
||||
)
|
||||
) : (
|
||||
<ScreenSplash />
|
||||
)
|
||||
@@ -189,3 +194,10 @@ export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(ScreenMainComponent);
|
||||
|
||||
function HasAccess({ features }) {
|
||||
if (features.mobile === undefined) return true;
|
||||
if (features.mobile === false) return false;
|
||||
const d = moment(moment(features.mobile));
|
||||
if (d.isValid()) return d.isAfter(moment());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user