From 687efd078053555d5869ae983ed35d47193dbf0e Mon Sep 17 00:00:00 2001
From: Ojas Arora <127867874+Ojas-Arora@users.noreply.github.com>
Date: Wed, 24 Jul 2024 15:26:46 +0530
Subject: [PATCH] Adding Facebook Authentication
---
src/App.js | 19 +++-
src/Components/Firebase/Firebase.js | 7 +-
src/Components/Login.css | 3 +-
src/Components/Login.js | 61 +++++++++---
src/Components/feedback/feedback.css | 92 ++++++++++++++-----
.../footer_section/Pricing/pricing.js | 5 +-
6 files changed, 144 insertions(+), 43 deletions(-)
diff --git a/src/App.js b/src/App.js
index 55a15301..e8f53331 100644
--- a/src/App.js
+++ b/src/App.js
@@ -52,9 +52,22 @@ function App() {
-
-
-
+
+
+
+
>
);
diff --git a/src/Components/Firebase/Firebase.js b/src/Components/Firebase/Firebase.js
index 93942398..4b4a51fc 100644
--- a/src/Components/Firebase/Firebase.js
+++ b/src/Components/Firebase/Firebase.js
@@ -2,7 +2,7 @@
import { initializeApp } from "firebase/app";
import { getAnalytics } from "firebase/analytics";
import { getFirestore } from "firebase/firestore";
-import { getAuth, GoogleAuthProvider, signInWithPopup, GithubAuthProvider, RecaptchaVerifier, signInWithPhoneNumber } from "firebase/auth";
+import { getAuth, GoogleAuthProvider, GithubAuthProvider, FacebookAuthProvider, signInWithPopup, RecaptchaVerifier, signInWithPhoneNumber } from "firebase/auth";
// Your web app's Firebase configuration
const firebaseConfig = {
@@ -21,8 +21,9 @@ const analytics = getAnalytics(firebaseApp);
const db = getFirestore(firebaseApp);
const googleProvider = new GoogleAuthProvider();
const githubProvider = new GithubAuthProvider();
+const facebookProvider = new FacebookAuthProvider();
const auth = getAuth(firebaseApp);
-export { auth, signInWithPopup, githubProvider, googleProvider, GithubAuthProvider, RecaptchaVerifier, signInWithPhoneNumber };
+export { auth, signInWithPopup, githubProvider, googleProvider, facebookProvider, GithubAuthProvider, FacebookAuthProvider, RecaptchaVerifier, signInWithPhoneNumber };
export { db, analytics, firebaseApp as app };
-export default firebaseApp;
\ No newline at end of file
+export default firebaseApp;
diff --git a/src/Components/Login.css b/src/Components/Login.css
index 8acec7fe..d213dfe4 100644
--- a/src/Components/Login.css
+++ b/src/Components/Login.css
@@ -289,9 +289,10 @@ form.sign-in-form {
}
.panel p {
- font-size: 0.95rem;
+ font-size: 1.1rem;
padding: 0.8rem 0;
color: white;
+ font-family:Arial, Helvetica, sans-serif;
}
.btn.transparent {
diff --git a/src/Components/Login.js b/src/Components/Login.js
index 7c6ef4c8..eca6a885 100644
--- a/src/Components/Login.js
+++ b/src/Components/Login.js
@@ -5,7 +5,7 @@ import '@fortawesome/fontawesome-free/css/all.min.css';
import logImg from './Profile/log.svg';
import registerImg from './Profile/register.svg';
import homeIcon from './FreeLancer/homeicon.png';
-import { auth, googleProvider, githubProvider } from './Firebase/Firebase.js';
+import { auth, googleProvider, githubProvider, facebookProvider } from './Firebase/Firebase.js';
import {
signInWithPopup,
signInWithEmailAndPassword,
@@ -49,7 +49,18 @@ const LogIn = () => {
console.error('GitHub sign-in error:', error);
}
};
-
+ const handleFacebookSignIn = async () => {
+ try {
+ const result = await signInWithPopup(auth, facebookProvider);
+ const user = result.user;
+ localStorage.setItem('user', JSON.stringify(user));
+ console.log('Facebook sign-in success:', user);
+ navigate('/');
+ } catch (error) {
+ console.error('Facebook sign-in error:', error);
+ }
+ };
+
const handleLogin = async (e) => {
e.preventDefault();
const emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
@@ -243,9 +254,9 @@ const LogIn = () => {
Connect with Social Magic
-
+
-
+
@@ -341,9 +352,9 @@ const LogIn = () => {
Connect with Social Magic
-
+
-
+
@@ -372,9 +383,22 @@ const LogIn = () => {
Join us today and start collaborating with students from
universities worldwide!
-
+
+
@@ -385,9 +409,22 @@ const LogIn = () => {
Log in to access your account and continue collaborating and
innovating.
-
+
+
diff --git a/src/Components/feedback/feedback.css b/src/Components/feedback/feedback.css
index 7cad6307..b2b54ad9 100644
--- a/src/Components/feedback/feedback.css
+++ b/src/Components/feedback/feedback.css
@@ -1,25 +1,37 @@
.headingFeedback {
font-size: 80px;
- font-weight: 600;
+ font-family: Arial, Helvetica, sans-serif; /* Update font family */
max-width: 1000px;
width: 85vw;
margin: auto;
text-align: center;
margin-bottom: 80px;
- color: #ff21bc;
+ color: white;
margin-top: 40px;
- font-weight: bold;
+ font-weight: bold; /* Make text bold */
+ animation: fadeIn 1.5s ease-in-out forwards;
}
.formFeedback {
width: 65vw;
height: auto;
- outline: 5px solid #ff21bc;
+ font-family: Arial, Helvetica, sans-serif; /* Update font family */
+ outline: 3px solid white;
transition: 0.2s box-shadow ease-in-out;
margin: auto;
- box-shadow: 0px 0px 11px 4px #ff21bc;
+ box-shadow: 7px 7px 32px 20px #6052ff;
margin-bottom: 100px;
padding: 20px;
+ border-radius: 50px;
+ font-size: 22px;
+}
+
+.formforFeedback {
+ display: flex;
+ flex-direction: column;
+ align-items: center; /* Center the form elements */
+ gap: 30px;
+ font-family: Arial, Helvetica, sans-serif; /* Update font family */
}
.componentsFormFeedback {
@@ -27,18 +39,15 @@
gap: 50px;
display: flex;
flex-direction: column;
+ align-items: center; /* Center the labels */
+ text-align: center; /* Center-align text */
gap: 10px;
+ font-family: Arial, Helvetica, sans-serif; /* Update font family */
}
.componentsFormFeedback label {
font-size: large;
- font-weight: bold;
-}
-
-.formforFeedback {
- display: flex;
- flex-direction: column;
- gap: 30px;
+ font-weight: bold; /* Make text bold */
}
.star-rating {
@@ -60,44 +69,81 @@
}
.star-rating input[type="radio"]:checked~label {
- color: #ff5c5c;
+ color: #ff21bc;
}
.star-rating label:hover,
.star-rating label:hover~label {
- color: #ff5c5c;
+ color: #ff21bc;
}
-#star5,#star4,#star3,#star2,#star1{
+
+#star5, #star4, #star3, #star2, #star1 {
font-size: 120px;
}
-#issue{
+#issue {
background-color: #201d41;
font-weight: 600;
+ font-size: 18px;
height: 35px;
text-align: center;
+ border: 1px solid #ccc;
+ border-bottom: 4px solid aliceblue;
}
-#comments{
+#comments {
min-height: 200px;
- font-size: 18px;
+ font-size: 22px;
+ border: 1px solid #ccc;
+ border-bottom: 4px solid aliceblue;
+}
+
+#email {
+ border: 1px solid #ccc;
+ border-bottom: 4px solid aliceblue;
+}
+
+#nameFeedback {
+ border: 1px solid #ccc;
+ border-bottom: 4px solid aliceblue;
+}
+
+button {
+ background-color: #ff21bc; /* Set button color */
+ color: white;
+ padding: 10px 20px;
+ border: none;
+ border-radius: 5px;
+ cursor: pointer;
+ transition: background-color 0.3s ease;
+ font-size: 22px; /* Match the form font size */
+ font-weight: bold; /* Make the button text bold */
+ font-family: Arial, Helvetica, sans-serif; /* Update font family */
+}
+
+button:hover {
+ background-color: #201d41; /* Change hover color */
}
-@media only screen and (max-width:900px){
- .formFeedback{
+
+@media only screen and (max-width: 900px) {
+ .formFeedback {
width: 80vw;
}
}
-@media only screen and (max-width:750px) {
+
+@media only screen and (max-width: 750px) {
.headingFeedback {
font-size: 60px;
}
}
-@media only screen and (max-width:550px) {
+
+@media only screen and (max-width: 550px) {
.headingFeedback {
font-size: 50px;
}
}
-@media only screen and (max-width:450px) {
+
+@media only screen and (max-width: 450px) {
.headingFeedback {
font-size: 40px;
}
diff --git a/src/Components/footer_section/Pricing/pricing.js b/src/Components/footer_section/Pricing/pricing.js
index 5719e82e..ba074a2c 100644
--- a/src/Components/footer_section/Pricing/pricing.js
+++ b/src/Components/footer_section/Pricing/pricing.js
@@ -3,12 +3,15 @@ import React from "react";
import './pricing.css';
import Arrow from '../../projects/arrow.png'
import { Link } from "react-router-dom";
+import homeIcon from '../../../img/homeicon.png';
function Pricing() {
return (
-
+
+
+
Start your 7 day free trial today
Unlock Advanced Features and Maximize Your Potential with UniCollab Pro.