Code Cleanup & Minor Bug Fixes
This commit is contained in:
@@ -4,6 +4,7 @@ import { NavigationContainer } from "@react-navigation/native";
|
||||
import { createStackNavigator } from "@react-navigation/stack";
|
||||
import i18n from "i18next";
|
||||
import React, { useEffect } from "react";
|
||||
import { SafeAreaView } from "react-native-safe-area-context";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import {
|
||||
@@ -15,21 +16,14 @@ import {
|
||||
selectBodyshop,
|
||||
selectCurrentUser,
|
||||
} from "../../redux/user/user.selectors";
|
||||
//import ScreenCamera from "../screen-camera/screen-camera";
|
||||
import ScreenJobDetail from "../screen-job-detail/screen-job-detail.component";
|
||||
import ScreenJobList from "../screen-job-list/screen-job-list.component";
|
||||
import ScreenMediaBrowser from "../screen-media-browser/screen-media-browser.component";
|
||||
//import ScreenMediaCache from "../screen-media-cache/screen-media-cache.component";
|
||||
//import ScreenMessagingConversation from "../screen-messaging-conversation/screen-messaging-conversation.component";
|
||||
//import ScreenMessagingList from "../screen-messaging-list/screen-messaging-list.component";
|
||||
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";
|
||||
|
||||
const JobStack = createStackNavigator();
|
||||
//const CameraStack = createStackNavigator();
|
||||
//const MessagingStack = createStackNavigator();
|
||||
//const MediaCacheStack = createStackNavigator();
|
||||
const MoreStack = createStackNavigator();
|
||||
const BottomTabs = createBottomTabNavigator();
|
||||
const MediaBrowserStack = createStackNavigator();
|
||||
@@ -64,38 +58,9 @@ const JobStackNavigator = () => (
|
||||
i18n.t("joblist.labels.detail"),
|
||||
})}
|
||||
/>
|
||||
{/* <JobStack.Screen
|
||||
name="MediaBrowser"
|
||||
component={ScreenMediaBrowser}
|
||||
// options={({ route }) => ({
|
||||
// title:
|
||||
// (route.params && route.params.title) ||
|
||||
// i18n.t("joblist.labels.detail"),
|
||||
// })}
|
||||
/> */}
|
||||
</JobStack.Navigator>
|
||||
);
|
||||
|
||||
// const CameraStackNavigator = () => (
|
||||
// <CameraStack.Navigator initialRouteName="TabCameraScreen">
|
||||
// <CameraStack.Screen
|
||||
// name="TabCameraScreen"
|
||||
// options={{ headerShown: false }}
|
||||
// component={ScreenCamera}
|
||||
// />
|
||||
// </CameraStack.Navigator>
|
||||
// );
|
||||
|
||||
// const MediaCacheStackNavigator = () => (
|
||||
// <MediaCacheStack.Navigator initialRouteName="TabMediaCache">
|
||||
// <MediaCacheStack.Screen
|
||||
// name="MediaCache"
|
||||
// options={{ title: i18n.t("mediacache.titles.mediacachetab") }}
|
||||
// component={ScreenMediaCache}
|
||||
// />
|
||||
// </MediaCacheStack.Navigator>
|
||||
// );
|
||||
|
||||
const MediaBrowserStackNavigator = () => (
|
||||
<MediaBrowserStack.Navigator initialRouteName="MediaBrowser">
|
||||
<MediaBrowserStack.Screen
|
||||
@@ -106,19 +71,6 @@ const MediaBrowserStackNavigator = () => (
|
||||
</MediaBrowserStack.Navigator>
|
||||
);
|
||||
|
||||
// const MessagingStackNavigator = () => (
|
||||
// <MessagingStack.Navigator>
|
||||
// <MessagingStack.Screen
|
||||
// name="MessagingList"
|
||||
// component={ScreenMessagingList}
|
||||
// />
|
||||
// <MessagingStack.Screen
|
||||
// name="MessagingConversation"
|
||||
// component={ScreenMessagingConversation}
|
||||
// />
|
||||
// </MessagingStack.Navigator>
|
||||
// );
|
||||
|
||||
const MoreStackNavigator = () => (
|
||||
<MoreStack.Navigator>
|
||||
<MoreStack.Screen
|
||||
@@ -139,16 +91,9 @@ const BottomTabsNavigator = () => (
|
||||
let iconName;
|
||||
if (route.name === "JobTab") {
|
||||
iconName = "ios-list";
|
||||
} else if (route.name === "MessagingTab") {
|
||||
iconName = "ios-chatboxes";
|
||||
} else if (route.name === "MoreTab") {
|
||||
iconName = "ios-settings";
|
||||
} else if (route.name === "CameraTab") {
|
||||
iconName = "ios-camera";
|
||||
} else if (
|
||||
route.name === "MediaCacheTab" ||
|
||||
route.name === "MediaBrowserTab"
|
||||
) {
|
||||
} else if (route.name === "MediaBrowserTab") {
|
||||
iconName = "ios-photos";
|
||||
} else {
|
||||
//iconName = "customerservice";
|
||||
@@ -172,20 +117,6 @@ const BottomTabsNavigator = () => (
|
||||
options={{ title: i18n.t("mediabrowser.titles.mediabrowsertab") }}
|
||||
component={MediaBrowserStackNavigator}
|
||||
/>
|
||||
{/* <BottomTabs.Screen
|
||||
name="MediaCacheTab"
|
||||
options={{ title: i18n.t("mediacache.titles.mediacachetab") }}
|
||||
component={MediaCacheStackNavigator}
|
||||
/> */}
|
||||
{/* <BottomTabs.Screen
|
||||
name="CameraTab"
|
||||
options={{ title: i18n.t("camera.titles.cameratab") }}
|
||||
component={CameraStackNavigator}
|
||||
/> <BottomTabs.Screen
|
||||
name="MessagingTab"
|
||||
options={{ title: i18n.t("messaging.titles.messagingtab") }}
|
||||
component={MessagingStackNavigator}
|
||||
/> */}
|
||||
<BottomTabs.Screen
|
||||
name="MoreTab"
|
||||
options={{ title: i18n.t("more.titles.moretab") }}
|
||||
@@ -204,19 +135,21 @@ export function ScreenMainComponent({
|
||||
}, [checkUserSession]);
|
||||
|
||||
return (
|
||||
<NavigationContainer>
|
||||
{currentUser.authorized === null ? (
|
||||
<ScreenSplash />
|
||||
) : currentUser.authorized ? (
|
||||
bodyshop ? (
|
||||
<BottomTabsNavigator />
|
||||
) : (
|
||||
<SafeAreaView style={{ flex: 1 }}>
|
||||
<NavigationContainer>
|
||||
{currentUser.authorized === null ? (
|
||||
<ScreenSplash />
|
||||
)
|
||||
) : (
|
||||
<ScreenSignIn />
|
||||
)}
|
||||
</NavigationContainer>
|
||||
) : currentUser.authorized ? (
|
||||
bodyshop ? (
|
||||
<BottomTabsNavigator />
|
||||
) : (
|
||||
<ScreenSplash />
|
||||
)
|
||||
) : (
|
||||
<ScreenSignIn />
|
||||
)}
|
||||
</NavigationContainer>
|
||||
</SafeAreaView>
|
||||
);
|
||||
}
|
||||
export default connect(
|
||||
|
||||
Reference in New Issue
Block a user