Skip to content

Commit

Permalink
google login remove
Browse files Browse the repository at this point in the history
  • Loading branch information
Sukhdev Bajiya committed Apr 1, 2024
1 parent cb6b2e7 commit e8fd14e
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 33 deletions.
9 changes: 3 additions & 6 deletions src/Pages/Home/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand All @@ -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 = {
Expand Down
3 changes: 2 additions & 1 deletion src/Pages/Images/Images.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion src/Pages/Result/Result.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion src/Pages/Videos/Videos.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
24 changes: 0 additions & 24 deletions src/Redux/Firebase.js

This file was deleted.

1 change: 1 addition & 0 deletions src/compenent/Navbar/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const Navbar = () => {
val = searchValue + " " + finalTranscript;
}
setSearchValue(val);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [finalTranscript]);

if (!browserSupportsSpeechRecognition) {
Expand Down

0 comments on commit e8fd14e

Please sign in to comment.