Resolve jobs list refresh.

This commit is contained in:
Patrick Fic
2022-01-12 15:26:50 -08:00
parent 972d2e3d3c
commit 352d57bb36
4 changed files with 182 additions and 92 deletions

View File

@@ -5,7 +5,7 @@ import { createStackNavigator } from "@react-navigation/stack";
import i18n from "i18next";
import React, { useEffect } from "react";
import { Button } from "react-native-paper";
import { SafeAreaView } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { logImEXEvent } from "../../firebase/firebase.analytics";
@@ -25,7 +25,7 @@ import ScreenMediaBrowser from "../screen-media-browser/screen-media-browser.com
import ScreenSettingsComponent from "../screen-settings/screen-settings.component";
import ScreenSignIn from "../screen-sign-in/screen-sign-in.component";
import ScreenSplash from "../screen-splash/screen-splash.component";
import moment from "moment";
const JobStack = createStackNavigator();
const MoreStack = createStackNavigator();
const BottomTabs = createBottomTabNavigator();
@@ -107,6 +107,15 @@ const MoreStackNavigator = () => (
const BottomTabsNavigator = () => (
<BottomTabs.Navigator
screenOptions={({ route }) => ({
// tabBarActiveTintColor: "dodgerblue",
// tabBarInactiveTintColor: "slategrey",
// tabBarStyle: [
// {
// display: "flex",
// },
// null,
// ],
// eslint-disable-next-line react/display-name
tabBarIcon: ({ color, size }) => {
let iconName;
@@ -123,24 +132,27 @@ const BottomTabsNavigator = () => (
return <Ionicons name={iconName} size={size} color={color} />;
},
})}
tabBarOptions={{
activeTintColor: "dodgerblue",
inactiveTintColor: "slategrey",
}}
>
<BottomTabs.Screen
name="JobTab"
options={{ title: i18n.t("joblist.titles.jobtab") }}
options={{
title: i18n.t("joblist.titles.jobtab"),
headerShown: false,
}}
component={JobStackNavigator}
/>
<BottomTabs.Screen
name="MediaBrowserTab"
options={{ title: i18n.t("mediabrowser.titles.mediabrowsertab") }}
options={{
title: i18n.t("mediabrowser.titles.mediabrowsertab"),
headerShown: false,
}}
component={MediaBrowserStackNavigator}
/>
<BottomTabs.Screen
name="MoreTab"
options={{ title: i18n.t("more.titles.moretab") }}
options={{ title: i18n.t("more.titles.moretab"), headerShown: false }}
component={MoreStackNavigator}
/>
</BottomTabs.Navigator>
@@ -155,27 +167,16 @@ export function ScreenMainComponent({
checkUserSession();
}, [checkUserSession]);
const hasMobileAccess =
bodyshop &&
bodyshop.features &&
(bodyshop.features.allAccess === true ||
moment(bodyshop.features.mobile).isAfter(moment()));
console.log(
"🚀 ~ file: screen-main.component.jsx ~ line 171 ~ hasMobileAccess",
hasMobileAccess,
bodyshop && bodyshop.features
);
return (
<SafeAreaView style={{ flex: 1 }}>
<NavigationContainer>
{currentUser.authorized === null ? (
<ScreenSplash />
) : currentUser.authorized ? (
bodyshop && hasMobileAccess ? (
bodyshop ? (
<BottomTabsNavigator />
) : (
<ScreenSplash noAccess />
<ScreenSplash />
)
) : (
<ScreenSignIn />