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 &&
|
||||
@@ -1,27 +1,25 @@
|
||||
import { initializeApp } from "firebase/app";
|
||||
import { getAuth, onAuthStateChanged } from "firebase/auth";
|
||||
import { getAuth } from "firebase/auth";
|
||||
import env from "../env";
|
||||
import { store } from "../redux/store";
|
||||
import { signInSuccess, unauthorizedUser } from "../redux/user/user.actions";
|
||||
|
||||
initializeApp(env.firebase);
|
||||
|
||||
export const auth = getAuth();
|
||||
|
||||
export const unsubscribe = onAuthStateChanged(auth, (user) => {
|
||||
console.log("Auth State Check", user);
|
||||
store.dispatch(
|
||||
user
|
||||
? signInSuccess({
|
||||
uid: user.uid,
|
||||
email: user.email,
|
||||
displayName: user.displayName,
|
||||
photoURL: user.photoURL,
|
||||
authorized: true,
|
||||
})
|
||||
: unauthorizedUser()
|
||||
);
|
||||
});
|
||||
// export const unsubscribe = onAuthStateChanged(auth, (user) => {
|
||||
// console.log("Auth State Check", user);
|
||||
// store.dispatch(
|
||||
// user
|
||||
// ? signInSuccess({
|
||||
// uid: user.uid,
|
||||
// email: user.email,
|
||||
// displayName: user.displayName,
|
||||
// photoURL: user.photoURL,
|
||||
// authorized: true,
|
||||
// })
|
||||
// : unauthorizedUser()
|
||||
// );
|
||||
// });
|
||||
|
||||
export const getCurrentUser = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
@@ -2,5 +2,8 @@ const { getDefaultConfig } = require("metro-config");
|
||||
const { resolver: defaultResolver } = getDefaultConfig.getDefaultValues();
|
||||
exports.resolver = {
|
||||
...defaultResolver,
|
||||
sourceExts: [...defaultResolver.sourceExts, "cjs", "jsx"],
|
||||
sourceExts: [
|
||||
...defaultResolver.sourceExts,
|
||||
"cjs", //"jsx"
|
||||
],
|
||||
};
|
||||
|
||||
51
package.json
51
package.json
@@ -26,23 +26,24 @@
|
||||
"axios": "^0.24.0",
|
||||
"cloudinary-core": "^2.12.0",
|
||||
"dinero.js": "^1.9.1",
|
||||
"expo": "^44.0.0",
|
||||
"expo-app-loading": "~1.3.0",
|
||||
"expo-av": "~10.2.0",
|
||||
"expo-camera": "~12.1.0",
|
||||
"expo-constants": "~13.0.0",
|
||||
"expo-device": "~4.1.0",
|
||||
"expo-file-system": "~13.1.0",
|
||||
"expo-firebase-analytics": "~6.0.0",
|
||||
"expo-font": "~10.0.4",
|
||||
"expo": "^43.0.0",
|
||||
"expo-app-loading": "~1.2.1",
|
||||
"expo-av": "~10.1.3",
|
||||
"expo-camera": "~12.0.3",
|
||||
"expo-constants": "~12.1.3",
|
||||
"expo-device": "~4.0.3",
|
||||
"expo-file-system": "~13.0.3",
|
||||
"expo-firebase-analytics": "~5.0.3",
|
||||
"expo-firebase-core": "~4.0.3",
|
||||
"expo-font": "~10.0.3",
|
||||
"expo-images-picker": "^2.2.3",
|
||||
"expo-localization": "~12.0.0",
|
||||
"expo-media-library": "~14.0.0",
|
||||
"expo-permissions": "~13.1.0",
|
||||
"expo-status-bar": "~1.2.0",
|
||||
"expo-updates": "~0.11.3",
|
||||
"expo-video-thumbnails": "~6.1.0",
|
||||
"firebase": "9.6.1",
|
||||
"expo-localization": "~11.0.0",
|
||||
"expo-media-library": "~13.0.3",
|
||||
"expo-permissions": "~13.0.3",
|
||||
"expo-status-bar": "~1.1.0",
|
||||
"expo-updates": "~0.10.15",
|
||||
"expo-video-thumbnails": "~6.0.3",
|
||||
"firebase": "^9.6.2",
|
||||
"formik": "^2.2.9",
|
||||
"graphql": "^16.2.0",
|
||||
"i18next": "^21.6.4",
|
||||
@@ -50,33 +51,33 @@
|
||||
"lodash": "^4.17.20",
|
||||
"luxon": "^2.2.0",
|
||||
"moment": "^2.29.1",
|
||||
"react": "17.0.2",
|
||||
"react-dom": "17.0.2",
|
||||
"react": "17.0.1",
|
||||
"react-dom": "17.0.1",
|
||||
"react-i18next": "^11.15.2",
|
||||
"react-native": "0.64.3",
|
||||
"react-native-gesture-handler": "~2.1.0",
|
||||
"react-native-gesture-handler": "~1.10.2",
|
||||
"react-native-image-gallery": "^2.1.5",
|
||||
"react-native-indicators": "^0.17.0",
|
||||
"react-native-pager-view": "5.4.9",
|
||||
"react-native-pager-view": "5.4.6",
|
||||
"react-native-paper": "^4.11.1",
|
||||
"react-native-progress": "^5.0.0",
|
||||
"react-native-reanimated": "~2.3.1",
|
||||
"react-native-reanimated": "~2.2.0",
|
||||
"react-native-safe-area-context": "3.3.2",
|
||||
"react-native-screens": "~3.10.1",
|
||||
"react-native-screens": "~3.8.0",
|
||||
"react-native-tab-view": "3.1.1",
|
||||
"react-native-web": "0.17.5",
|
||||
"react-native-web": "0.17.1",
|
||||
"react-redux": "^7.2.6",
|
||||
"redux": "^4.1.2",
|
||||
"redux-logger": "^3.0.6",
|
||||
"redux-persist": "^6.0.0",
|
||||
"redux-saga": "^1.1.3",
|
||||
"reselect": "^4.1.5",
|
||||
"sentry-expo": "^4.0.0",
|
||||
"sentry-expo": "^4.0.5",
|
||||
"subscriptions-transport-ws": "^0.11.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.12.9",
|
||||
"babel-preset-expo": "9.0.2",
|
||||
"babel-preset-expo": "8.5.1",
|
||||
"eslint": "^8.5.0",
|
||||
"eslint-plugin-react": "^7.28.0",
|
||||
"eslint-plugin-react-native": "^4.0.0"
|
||||
|
||||
Reference in New Issue
Block a user