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

Updated to Expo 51 SDK #228

Merged
merged 5 commits into from
Aug 17, 2024
Merged
Show file tree
Hide file tree
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 client/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://docs.expo.dev/guides/using-eslint/
module.exports = {
extends: "universe/native",
extends: 'expo',
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FirebaseError } from "firebase/app";
import { User } from "firebase/auth";
import { FirebaseError } from "@firebase/app";
import { User } from "@firebase/auth";
import React from "react";
import { StyleSheet, Text, Dimensions, TouchableOpacity } from "react-native";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const NearbyCount: React.FC<CounterProps> = ({ count }) => {
<View style={styles.iconAndCount}>
<Image
style={styles.iconImage}
source={require("../../../assets/nearby_icon.png")}
source={require("../../../assets/icons/misc/nearby_icon.png")}
/>
<Text style={styles.countText}>{count}</Text>
</View>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { API_KEY, AUTH_DOMAIN } from "@env"; // Don't worry about this env error!

Check failure on line 1 in client/app/configs/firebaseConfig.ts

View workflow job for this annotation

GitHub Actions / lint (21.x)

Unable to resolve path to module '@env'
import AsyncStorage from "@react-native-async-storage/async-storage";
import { initializeApp, getApp, getApps } from "firebase/app";
import { initializeApp, getApp, getApps } from "@firebase/app";
import {
initializeAuth,
getReactNativePersistence,
getAuth,
Auth,
} from "firebase/auth";
} from "@firebase/auth";

const firebaseConfig = {
apiKey: API_KEY || "Mock-Key",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 5 additions & 8 deletions client/App.tsx → client/app/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { NavigationContainer } from "@react-navigation/native";
import React from "react";
import { Text } from "react-native";

// Navigation
import AppNavigator from "./src/navigation/AppNavigator";
import AuthNavigator from "./src/navigation/AuthNavigator";
import AppNavigator from "./navigation/AppNavigator";
import AuthNavigator from "./navigation/AuthNavigator";
// Services/Hooks/Styles
import { AuthStore } from "./src/services/AuthStore";
import { useGlobalFonts } from "./src/styles/fonts";
import { AuthStore } from "./services/AuthStore";
import { useGlobalFonts } from "./styles/fonts";

const App = () => {
const { initialized, isLoggedin } = AuthStore.useState();
Expand All @@ -18,9 +17,7 @@ const App = () => {
if (!initialized) return <Text>Loading...</Text>;

return (
<NavigationContainer>
{isLoggedin ? <AppNavigator /> : <AuthNavigator />}
</NavigationContainer>
isLoggedin ? <AppNavigator /> : <AuthNavigator />
);
};

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
onAuthStateChanged,
signInWithEmailAndPassword,
signOut,
} from "firebase/auth";
} from "@firebase/auth";
import { Store } from "pullstate";

import { auth } from "../configs/firebaseConfig";
Expand All @@ -21,10 +21,10 @@
userAuthInfo: null,
});

const unsub = onAuthStateChanged(auth, (user) => {

Check warning on line 24 in client/app/services/AuthStore.ts

View workflow job for this annotation

GitHub Actions / lint (21.x)

'unsub' is assigned a value but never used
console.log("onAuthStateChanged", user);
AuthStore.update((store) => {
(store.initialized = true),

Check warning on line 27 in client/app/services/AuthStore.ts

View workflow job for this annotation

GitHub Actions / lint (21.x)

Expected an assignment or function call and instead saw an expression
(store.isLoggedin = !!user),
(store.userAuthInfo = user);
});
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions client/app/types/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module '@env' {

export const EXPO_IP: string;
export const API_KEY, AUTH_DOMAIN, PROJECT_ID, STORAGE_BUCKET, MESSAGING_SENDER_ID, APP_ID: string;
}
File renamed without changes.
1 change: 0 additions & 1 deletion client/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module.exports = function (api) {
return {
presets: ["babel-preset-expo"],
plugins: [
"expo-router/babel",
[
"module:react-native-dotenv",
{
Expand Down
Loading
Loading