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

[FIN 2] Setup Firebase #3

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Prev Previous commit
update import statements from root
DystoriaX committed Mar 26, 2023
commit 427210a761d2331229d0afceee400ffc4e6d46ab
2 changes: 1 addition & 1 deletion src/api/auth.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { auth } from "../firebase/config";
import { auth } from "firebase/config";
import {
createUserWithEmailAndPassword,
signInWithEmailAndPassword,
4 changes: 2 additions & 2 deletions src/api/profile.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { UserCredential } from "firebase/auth";
import { auth, db } from "../firebase/config";
import { auth, db } from "firebase/config";
import { doc, setDoc, updateDoc, getDoc } from "@firebase/firestore";
import { UserProfile } from "../types/profile";
import { UserProfile } from "types/profile";

const USER_PATH = "users";

2 changes: 1 addition & 1 deletion src/context/AuthContext.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { onAuthStateChanged } from "firebase/auth";
import { auth } from "../firebase/config";
import { auth } from "firebase/config";
import { getUserData } from "api/profile";
import { UserProfile } from "types/profile";

4 changes: 2 additions & 2 deletions src/pages/Login.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import { login } from "api/auth";
import { FirebaseError } from "firebase/app";
import { useNotification } from "hooks/notification";
import React from "react";
import Login, { LoginFields } from "../components/auth/Login";
import Login, { LoginFields } from "components/auth/Login";

const LoginPage = () => {
const { showSuccess, showError } = useNotification();
6 changes: 3 additions & 3 deletions src/pages/Signup.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import { FirebaseError } from "firebase/app";
import { useNotification } from "hooks/notification";
import React from "react";
import { signUp } from "../api/auth";
import Signup, { SignupFields } from "../components/auth/Signup";
import { signUp } from "api/auth";
import Signup, { SignupFields } from "components/auth/Signup";

const SignupPage = () => {
const { showSuccess, showError } = useNotification();
47 changes: 27 additions & 20 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"baseUrl": "./src"
},
"include": ["src", "src/custom.d.ts"]
}
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"baseUrl": "./src"
},
"include": [
"src",
"src/custom.d.ts"
]
}