Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
neopromic committed Sep 30, 2023
2 parents 5349f54 + 84ba13a commit ce074b4
Show file tree
Hide file tree
Showing 11 changed files with 64 additions and 55 deletions.
21 changes: 0 additions & 21 deletions firebase.ts

This file was deleted.

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ForDevs</title>
<link rel="shortcut icon" href="/assets/logo.png" type="image/png">
<link rel="shortcut icon" href="/assets/favicon.ico">
</head>
<body>
<div id="root"></div>
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"react-dom": "^18.2.0",
"react-router-dom": "^6.15.0",
"tailwind-merge": "^1.14.0",
"tailwindcss-animate": "^1.0.7"
"tailwindcss-animate": "^1.0.7",
"vite-plugin-env-compatible": "^1.1.1"
},
"devDependencies": {
"@klarr-agency/circum-icons-react": "^2.0.2",
Expand Down
13 changes: 13 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 0 additions & 20 deletions public/api/user/authContextApi/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/pages/SignIn/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Header from "../../components/ui/Header";
import "./SignIn.css";
import { useState } from "react";
import { signInWithEmailAndPassword } from "firebase/auth"
import { auth } from "../../../firebase"
import { auth } from "@/utils/api/auth/config/index"
import { Button } from "@/components/ui/button";

export default function SignIn() {
Expand Down
22 changes: 13 additions & 9 deletions src/pages/SignUp/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,30 @@ import { Link } from "react-router-dom";
import Header from "../../components/ui/Header";
import "./SignUp.css";
import { useState } from "react";
import {auth} from "../../../firebase";
import { auth } from "@/utils/api/auth/config"
import { createUserWithEmailAndPassword } from "firebase/auth";

export default function SignUp() {
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const [username, setUsername] = useState("");
const [username, setUsername] = useState("");
const signUp = (e) => {
e.preventDefault()
e.preventDefault();

createUserWithEmailAndPassword(auth, email, password)
.then((userCredential) => {
console.log(userCredential)
}).catch((error) => console.error(error))
}
.then((userCredential) => {
console.log(userCredential);
})
.catch((error) => console.error(error));
};
return (
<>
<Header />
<div className="h-screen flex items-center justify-center p-4 overflow-hidden">
<form className="max-w-xl" onSubmit={signUp}>
<div className="form-header">
<img
src="/assets/logo.png"
src="/assets/favicon.ico"
className="w-8 h-8 object-cover rounded-full"
/>
<h1>Começando no Fordevs</h1>
Expand Down Expand Up @@ -63,7 +64,10 @@ export default function SignUp() {
Iniciar jornada!
</button>
<span className="text-sm">
Já possui conta? <Link to="/login" className="text-violet-500 font-bold">Entrar agora!</Link>
Já possui conta?{" "}
<Link to="/login" className="text-violet-500 font-bold">
Entrar agora!
</Link>
</span>
</form>
</div>
Expand Down
8 changes: 8 additions & 0 deletions src/utils/api/auth/authContextApi/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { createContext } from "react";

createContext(authContext)


export function authContext() {
return;
}
22 changes: 22 additions & 0 deletions src/utils/api/auth/config/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { initializeApp } from "firebase/app";
import { getFirestore } from "firebase/firestore"
import { Auth, getAuth } from "firebase/auth"


const firebaseConfig = {
apiKey: import.meta.env.REACT_APP_FIREBASE_KEY,
authDomain: import.meta.env.REACT_APP_FIREBASE_DOMAIN,
databaseURL: import.meta.env.REACT_APP_FIREBASE_DATABASE_URL,
projectId: import.meta.env.REACT_APP_FIREBASE_PROJECT_ID,
storageBucket: import.meta.env.REACT_APP_FIREBASE_BUCKET,
messagingSenderId: import.meta.env.REACT_APP_FIREBASE_SENDER_ID,
appId: import.meta.env.REACT_APP_FIREBASE_APP_ID,
measurementId: import.meta.env.REACT_APP_FIREBASE_MEANSUREMENT_ID
};

// Initialize Firebase
const app = initializeApp(firebaseConfig);
const auth: Auth = getAuth(app);
const db = getFirestore(app);

export { db, app, auth }
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"./src/*",
],
"@api/*": [
"./public/api/*",
"src/utils/api/*",
]
},
"target": "ES2020",
Expand Down
4 changes: 3 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import path from "path"
import react from "@vitejs/plugin-react"
// import envCompatible from 'vite-plugin-env-compatible'
import { defineConfig } from "vite"

export default defineConfig({
plugins: [react()],
envPrefix: "REACT_APP_",
plugins: [react(),],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
Expand Down

0 comments on commit ce074b4

Please sign in to comment.