Rename JSX to JS.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React from "react";
|
||||
import JobListComponent from "../job-list/job-list.component.jsx";
|
||||
import JobListComponent from "../job-list/job-list.component";
|
||||
|
||||
export default function ScreenJobList({ navigation }) {
|
||||
return <JobListComponent />;
|
||||
@@ -2,18 +2,22 @@ import { Ionicons } from "@expo/vector-icons";
|
||||
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
|
||||
import { NavigationContainer } from "@react-navigation/native";
|
||||
import { createStackNavigator } from "@react-navigation/stack";
|
||||
import { onAuthStateChanged } from "firebase/auth";
|
||||
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";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { logImEXEvent } from "../../firebase/firebase.analytics";
|
||||
import { auth } from "../../firebase/firebase.utils";
|
||||
import { setCameraJob, setCameraJobId } from "../../redux/app/app.actions";
|
||||
import {
|
||||
checkUserSession,
|
||||
emailSignInStart,
|
||||
signInSuccess,
|
||||
signOutStart,
|
||||
unauthorizedUser,
|
||||
} from "../../redux/user/user.actions";
|
||||
import {
|
||||
selectBodyshop,
|
||||
@@ -25,7 +29,6 @@ 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();
|
||||
@@ -37,7 +40,8 @@ const mapStateToProps = createStructuredSelector({
|
||||
});
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
checkUserSession: () => dispatch(checkUserSession()),
|
||||
signInSuccess: (user) => dispatch(signInSuccess(user)),
|
||||
unauthorizedUser: () => dispatch(unauthorizedUser()),
|
||||
emailSignInStart: (email, password) =>
|
||||
dispatch(emailSignInStart({ email, password })),
|
||||
signOutStart: () => dispatch(signOutStart()),
|
||||
@@ -159,13 +163,30 @@ const BottomTabsNavigator = () => (
|
||||
);
|
||||
|
||||
export function ScreenMainComponent({
|
||||
checkUserSession,
|
||||
signInSuccess,
|
||||
unauthorizedUser,
|
||||
currentUser,
|
||||
bodyshop,
|
||||
}) {
|
||||
useEffect(() => {
|
||||
checkUserSession;
|
||||
}, [checkUserSession]);
|
||||
const unsubscribe = onAuthStateChanged(auth, (user) => {
|
||||
if (user) {
|
||||
signInSuccess({
|
||||
uid: user.uid,
|
||||
email: user.email,
|
||||
displayName: user.displayName,
|
||||
photoURL: user.photoURL,
|
||||
authorized: true,
|
||||
});
|
||||
} else {
|
||||
unauthorizedUser();
|
||||
}
|
||||
});
|
||||
|
||||
return () => {
|
||||
unsubscribe();
|
||||
};
|
||||
}, []);
|
||||
|
||||
const hasMobileAccess =
|
||||
bodyshop &&
|
||||
Reference in New Issue
Block a user