Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Max/fix node saas version #86

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app.json
Original file line number Diff line number Diff line change
@@ -32,6 +32,7 @@
"packagerOpts": {
"config": "metro.config.js",
"sourceExts": ["tsx", "scss", "png", "jpeg", "gif"]
}
},
"sdkVersion": "41.0.0"
}
}
22,795 changes: 11,873 additions & 10,922 deletions package-lock.json

Large diffs are not rendered by default.

37 changes: 20 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -17,26 +17,29 @@
"@react-navigation/native": "^5.8.2",
"@react-navigation/stack": "^5.11.1",
"axios": "^0.21.0",
"expo": "~39.0.2",
"expo-barcode-scanner": "~9.0.0",
"expo-camera": "^9.0.0",
"expo-cli": "^3.28.5",
"expo-font": "~8.3.0",
"expo-image-picker": "^9.1.1",
"expo-linking": "^1.0.5",
"expo-status-bar": "~1.0.2",
"node-sass": "^5.0.0",
"expo": "~41.0.0",
"expo-barcode-scanner": "~10.1.2",
"expo-camera": "~11.0.2",
"expo-cli": "^5.0.3",
"expo-font": "~9.1.0",
"expo-image-picker": "~10.1.4",
"expo-intent-launcher": "~9.0.0",
"expo-linking": "~2.2.3",
"expo-location": "^14.0.1",
"expo-modules-core": "^0.6.4",
"expo-status-bar": "~1.0.4",
"node-sass": "^7.0.1",
"npm": "^6.14.8",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-39.0.4.tar.gz",
"react-native": "https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz",
"react-native-elements": "^3.0.0-alpha.1",
"react-native-gesture-handler": "~1.7.0",
"react-native-maps": "^0.27.1",
"react-native-reanimated": "~1.13.0",
"react-native-safe-area-context": "3.1.4",
"react-native-gesture-handler": "~1.10.2",
"react-native-maps": "0.27.1",
"react-native-reanimated": "~2.1.0",
"react-native-safe-area-context": "3.2.0",
"react-native-sass-transformer": "^1.4.0",
"react-native-screens": "~2.10.1",
"react-native-screens": "~3.0.0",
"react-native-vector-icons": "^7.1.0",
"react-native-web": "~0.13.12"
},
@@ -53,9 +56,9 @@
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-sort-imports-es6-autofix": "^0.5.0",
"firebase": "^4.8.0",
"firebase": "8.2.3",
"prettier": "^2.1.2",
"typescript": "~3.9.5"
"typescript": "~4.0.0"
},
"private": true
}
4 changes: 2 additions & 2 deletions src/containers/Auth/FormUtils.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { FirebaseError } from 'firebase';
import firebase from 'firebase';
import { GestureResponderEvent, View } from 'react-native';
import { Icon, Input } from 'react-native-elements';
import React, { useState } from 'react';

// Handles error codes that may be returned from Firebase Auth calls
function handleAuthErrors(error: FirebaseError) {
function handleAuthErrors(error: firebase.FirebaseError) {
switch (error.code) {
case 'auth/user-disabled':
return {
10 changes: 5 additions & 5 deletions src/containers/Auth/LoginScreen.tsx
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ import { styles } from './FormStyles';
import Axios from 'axios';
import Form from './Form';
import React, { useContext, useEffect, useState } from 'react';
import firebase, { FirebaseError } from 'firebase';
import firebase from 'firebase';

type Props = {
navigation: StackNavigationProp<RootStackParamList, 'Login'>;
@@ -61,8 +61,8 @@ const LoginScreen = ({ navigation }: Props) => {
.auth()
.signInWithEmailAndPassword(email, password)
// Fetch Firebase JWT
.then((user: firebase.User) => {
return Promise.all([user, user.getIdToken(true)]);
.then((user) => {
return Promise.all([user, user.user?.getIdToken(true)]);
})
// Fetch user data
.then(([user, token]) => {
@@ -81,15 +81,15 @@ const LoginScreen = ({ navigation }: Props) => {
user: {
_id: userData._id,
eventId: userData.eventId,
uid: user.uid,
uid: user.user?.uid || '',
},
});
dispatch({
type: 'SET_ENTERPRISE_MODE',
isEnterpriseMode: userData.eventId !== null,
});
})
.catch((error: FirebaseError | any) => {
.catch((error: firebase.FirebaseError | any) => {
if (error.type === 'FirebaseError')
setFormErrors(handleAuthErrors(error));
else {
8 changes: 4 additions & 4 deletions src/containers/Auth/PasswordResetScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Button, Input, Text } from 'react-native-elements';
import { Ctx } from '../../components/StateProvider';
import { FirebaseError } from 'firebase';
import firebase from 'firebase';
import { RootStackParamList } from '../../../App';
import { StackNavigationProp } from '@react-navigation/stack';
import { handleAuthErrors } from './FormUtils';
@@ -78,7 +78,7 @@ const PasswordResetEmailForm = ({ nextStage }: { nextStage: () => void }) => {
.then(() => {
nextStage();
})
.catch((error: FirebaseError) => {
.catch((error: firebase.FirebaseError) => {
setFormError(handleAuthErrors(error).email);
});
}}
@@ -112,7 +112,7 @@ const ChangePasswordForm = ({ nextStage }: { nextStage: () => void }) => {
setConfirmed(true);
setFormError('');
})
.catch((error: FirebaseError) => {
.catch((error: firebase.FirebaseError) => {
setFormError(handleAuthErrors(error).password);
});
}}
@@ -137,7 +137,7 @@ const ChangePasswordForm = ({ nextStage }: { nextStage: () => void }) => {
.then(() => {
nextStage();
})
.catch((error: FirebaseError) => {
.catch((error: firebase.FirebaseError) => {
setFormError(handleAuthErrors(error).password);
});
}}
8 changes: 4 additions & 4 deletions src/containers/Auth/SignupScreen.tsx
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ import { styles } from './FormStyles';
import Axios from 'axios';
import Form from './Form';
import React, { useContext, useEffect, useState } from 'react';
import firebase, { FirebaseError } from 'firebase';
import firebase from 'firebase';

type Props = {
navigation: StackNavigationProp<RootStackParamList, 'Signup'>;
@@ -62,7 +62,7 @@ const SignupScreen = ({ navigation }: Props) => {
.auth()
.createUserWithEmailAndPassword(email, password)
// Fetch Firebase JWT
.then((user) => Promise.all([user, user.getIdToken(true)]))
.then((user) => Promise.all([user, user.user?.getIdToken(true)]))
// Init user data in Mongo
.then(([user, token]) => {
return Promise.all([
@@ -82,11 +82,11 @@ const SignupScreen = ({ navigation }: Props) => {
user: {
_id: userData._id,
eventId: userData.eventId,
uid: user.uid,
uid: user.user?.uid || '',
},
});
})
.catch((error: FirebaseError | any) => {
.catch((error: firebase.FirebaseError | any) => {
setSigningIn(false);
// Only FirebaseError has code
if (error.code) setFormErrors(handleAuthErrors(error));
11 changes: 4 additions & 7 deletions src/containers/Map/MapScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as IntentLauncher from 'expo-intent-launcher';
import * as Linking from 'expo-linking';
import * as Loc from 'expo-location';
import * as Permissions from 'expo-permissions';
import { Alert, Dimensions, Platform, StyleSheet, View } from 'react-native';
import React, { useContext, useEffect, useState } from 'react';

@@ -15,7 +15,6 @@ import { ItemProps, MapMenuProps } from '../../types/inventoryTypes';
import { Location, MapScreenProps, MarkerData } from './mapTypes';

import { Ctx } from '../../components/StateProvider';
import { IntentLauncher } from 'expo';
import { MAP_REFRESH_RATE } from '../../config';
import Bot from '../../assets/robot.png';
import CampusData from '../../assets/campusCoords.json';
@@ -53,10 +52,8 @@ const MapScreen = ({ route, navigation }: MapScreenProps) => {

// Bot that was selected to send to some map node, used when showing map nodes
const botS: MarkerData | null = botSelected ? botSelected : null;
const [
selectedBotForOrder,
setSelectedBotForOrder,
] = useState<MarkerData | null>(botS);
const [selectedBotForOrder, setSelectedBotForOrder] =
useState<MarkerData | null>(botS);

// true -> map nodes displayed on map, false -> bots displayed on map
const [showMapNodes, setShowMapNodes] = useState(!!selectedBotForOrder);
@@ -214,7 +211,7 @@ const MapScreen = ({ route, navigation }: MapScreenProps) => {

useEffect(() => {
if (hasLocationPermission !== 'granted') {
Permissions.askAsync(Permissions.LOCATION).then((res) => {
Loc.getForegroundPermissionsAsync().then((res) => {
setLocationPermission(res.status);
if (res.status === 'granted') {
setAlert(true);
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -15,5 +15,6 @@
"node_modules/@types",
"src/types"
]
}
}
},
"extends": "expo/tsconfig.base"
}