From e8fd14efe8d7b81f2672fb521a4ac773527fb5b3 Mon Sep 17 00:00:00 2001 From: Sukhdev Bajiya Date: Tue, 2 Apr 2024 03:18:43 +0530 Subject: [PATCH] google login remove --- src/Pages/Home/Home.jsx | 9 +++------ src/Pages/Images/Images.jsx | 3 ++- src/Pages/Result/Result.jsx | 3 ++- src/Pages/Videos/Videos.jsx | 3 ++- src/Redux/Firebase.js | 24 ------------------------ src/compenent/Navbar/Navbar.jsx | 1 + 6 files changed, 10 insertions(+), 33 deletions(-) delete mode 100644 src/Redux/Firebase.js diff --git a/src/Pages/Home/Home.jsx b/src/Pages/Home/Home.jsx index 21d4a47..6500472 100644 --- a/src/Pages/Home/Home.jsx +++ b/src/Pages/Home/Home.jsx @@ -3,7 +3,6 @@ import "./Home.css" import GoMasaiLogo from "../../assets/images/gomasai.png"; // import GoMasaiLogo from "../../assets/images/gomasaiLogo.png"; import { Link, useNavigate } from 'react-router-dom'; -import { auth, provider } from '../../Redux/Firebase' import { useSelector, useDispatch } from "react-redux"; import { setSearchinput, setUserlog } from "../../Redux/action"; @@ -21,19 +20,17 @@ function Home() { } const signIn = () => { - auth.signInWithPopup(provider) - .then(res => userDataAddInDatabase(res.user.multiFactor.user)) - .catch(err => alert(err)); } const [user, setUser] = React.useState(JSON.parse(localStorage.getItem('userlogindata')) || { userauth: false, - name: "", - email: "", + name: "Guest", + email: "guest@gomasai.com", photo: "https://upload.wikimedia.org/wikipedia/commons/thumb/7/7e/Circle-icons-profile.svg/1024px-Circle-icons-profile.svg.png" }) + // eslint-disable-next-line no-unused-vars function userDataAddInDatabase(data) { let userObject = { diff --git a/src/Pages/Images/Images.jsx b/src/Pages/Images/Images.jsx index 17377bc..dee634f 100644 --- a/src/Pages/Images/Images.jsx +++ b/src/Pages/Images/Images.jsx @@ -23,9 +23,10 @@ function Images() { dispatch(setLoaderspinner(true)) fetch(`https://pixabay.com/api/?key=${process.env.REACT_APP_IMAGE_API_KEY}&q=${navbar_searchValur}&per_page=175&page=${pageNumber}`) .then((res) => res.json()) - .then((data) => { return setImageData(data), dispatch(setLoaderspinner(false)) }) + .then((data) => { return (setImageData(data), dispatch(setLoaderspinner(false))) }) .catch((err) => console.log(err)) } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [navbar_searchValur, pageNumber]); return ( diff --git a/src/Pages/Result/Result.jsx b/src/Pages/Result/Result.jsx index 0a1343d..8d36607 100644 --- a/src/Pages/Result/Result.jsx +++ b/src/Pages/Result/Result.jsx @@ -24,10 +24,11 @@ function Result() { ) .then((res) => res.json()) .then((res) => { - return setResultData(res), dispatch(setLoaderspinner(false)); + return (setResultData(res), dispatch(setLoaderspinner(false))); }) .catch((err) => console.log(err)); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [navbar_searchValur, pageNumber]); return ( diff --git a/src/Pages/Videos/Videos.jsx b/src/Pages/Videos/Videos.jsx index b32ea30..d89a660 100644 --- a/src/Pages/Videos/Videos.jsx +++ b/src/Pages/Videos/Videos.jsx @@ -22,9 +22,10 @@ function Videos() { dispatch(setLoaderspinner(true)) fetch(`https://youtube.googleapis.com/youtube/v3/search?type=video&part=snippet&maxResults=50&q=${navbar_searchValur}&key=${process.env.REACT_APP_VIDEO_API_KEY}`) .then((res) => res.json()) - .then((data) => { return setVideoData(data), dispatch(setLoaderspinner(false)) }) + .then((data) => { return (setVideoData(data), dispatch(setLoaderspinner(false))) }) .catch((err) => console.log(err)) } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [navbar_searchValur]); return ( diff --git a/src/Redux/Firebase.js b/src/Redux/Firebase.js deleted file mode 100644 index 4d91335..0000000 --- a/src/Redux/Firebase.js +++ /dev/null @@ -1,24 +0,0 @@ -import firebase from 'firebase/compat/app'; -import 'firebase/compat/auth'; -import 'firebase/compat/firestore'; - -const firebaseConfig = { - apiKey: "AIzaSyBqApVcJnWWIlp1Gy7X5ALzLB_LdYSPlj4", - authDomain: "gomasai.firebaseapp.com", - projectId: "gomasai", - storageBucket: "gomasai.appspot.com", - messagingSenderId: "348925847050", - appId: "1:348925847050:web:f401a8febe117cf00721f3", - measurementId: "G-ZLG0LBCXJK" -}; - -// Use this to initialize the firebase App -const firebaseApp = firebase.initializeApp(firebaseConfig); - -// Use these for db & auth -const db = firebaseApp.firestore(); -const auth = firebase.auth(); - -const provider = new firebase.auth.GoogleAuthProvider(); - -export { auth, db, provider }; \ No newline at end of file diff --git a/src/compenent/Navbar/Navbar.jsx b/src/compenent/Navbar/Navbar.jsx index 51d1321..86232f0 100644 --- a/src/compenent/Navbar/Navbar.jsx +++ b/src/compenent/Navbar/Navbar.jsx @@ -35,6 +35,7 @@ const Navbar = () => { val = searchValue + " " + finalTranscript; } setSearchValue(val); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [finalTranscript]); if (!browserSupportsSpeechRecognition) {