Skip to content

Commit 2bcc196

Browse files
Revert "Added Google Authentication (#97)" (#99)
This reverts commit 968a645.
1 parent 968a645 commit 2bcc196

File tree

8 files changed

+16143
-952
lines changed

8 files changed

+16143
-952
lines changed

package-lock.json

Lines changed: 16126 additions & 809 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,11 @@
1414
"@testing-library/react": "^11.2.6",
1515
"@testing-library/user-event": "^12.8.3",
1616
"bootstrap": "^5.1.3",
17-
"firebase": "^9.6.11",
1817
"font-awesome": "^4.7.0",
1918
"react": "^17.0.2",
2019
"react-bootstrap": "^2.2.0",
2120
"react-dom": "^17.0.2",
22-
"react-google-login": "^5.2.2",
2321
"react-helmet": "^6.1.0",
24-
"react-icons": "^4.3.1",
2522
"react-router": "^5.2.0",
2623
"react-router-dom": "^5.2.0",
2724
"react-scripts": "^5.0.1",

src/App.jsx

Lines changed: 10 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, {useState, lazy, Suspense } from "react";
1+
import React, { lazy, Suspense } from "react";
22
import { Route, Switch, Redirect } from "react-router-dom";
33
import "../node_modules/bootstrap/dist/css/bootstrap.min.css";
44
import { withRouter } from "react-router";
@@ -8,8 +8,7 @@ import NotFound from "./pages/404/NotFound";
88
import "./index.scss";
99
import Preloader from "./components/Preloader/Preloader";
1010
import Scroll from "./components/Scroll/Scroll";
11-
import { authentication } from "./firebase-config";
12-
import { Router } from "react-router-dom";
11+
1312
const Home = lazy(() => import("./pages/Home/Home"));
1413
const Explore = lazy(() => import("./pages/Explore/Explore"));
1514
const DetailPage = lazy(() => import("./pages/DetailPage/DetailPage"));
@@ -20,70 +19,31 @@ const Reset = lazy(() => import("./pages/ResetPassword/Reset"));
2019
const Report = lazy(() => import("./pages/ReportaBug/Report"));
2120
const Signup = lazy(() => import("./pages/SignupPage/Signup"));
2221
function App({ location }) {
23-
24-
const [userLoggedIn, setUserLoggedIn] = useState(true);
25-
26-
authentication.onAuthStateChanged((user)=> {
27-
if(user){
28-
return setUserLoggedIn(true);
29-
}
30-
setUserLoggedIn(false);
31-
32-
})
33-
34-
if(userLoggedIn === true){
35-
36-
return (
37-
38-
<Suspense fallback={<Preloader />}>
39-
{location.pathname !== "/404" && (
40-
<Header currentRoute={location.pathname} />
41-
)}
42-
<Scroll showBelow={200} />
43-
<Switch>
44-
<Route path="/" exact component={Home} />
45-
<Route path="/contact" exact component={ContactUs} />
46-
<Route path="/explore" exact component={Explore} />
47-
<Route path="/e/:slug" exact component={DetailPage} />
48-
<Route path="/jobs" exact component={ContactUs} />
49-
<Route path="/feed" exact component={ContactUs} />
50-
<Route path="/report" component={Report} />
51-
<Route path="/404" exact component={NotFound} />
52-
<Redirect to="/" component={Home} />
53-
</Switch>
54-
{location.pathname !== "/404" && <Footer fill={"#0D1017"} />}
55-
</Suspense>
56-
);
57-
}else{
58-
return (
59-
<Suspense fallback={<Preloader />}>
22+
return (
23+
<Suspense fallback={<Preloader />}>
6024
{location.pathname !== "/404" && (
6125
<Header currentRoute={location.pathname} />
6226
)}
6327
<Scroll showBelow={200} />
6428
<Switch>
6529
<Route path="/" exact component={Home} />
66-
<Route path="/signin" exact component={Login} />
6730
<Route path="/contact" exact component={ContactUs} />
31+
<Route path="/explore" exact component={Explore} />
6832
<Route path="/e/:slug" exact component={DetailPage} />
6933
<Route path="/jobs" exact component={ContactUs} />
7034
<Route path="/feed" exact component={ContactUs} />
35+
<Route path="/signin" exact component={Login} />
7136
<Route path="/signup" exact component={Signup} />
7237
<Route path="/forget" component={Forget} />
7338
<Route path="/reset" component={Reset} />
39+
<Route path="/report" component={Report} />
7440
<Route path="/404" exact component={NotFound} />
75-
<Redirect to="/explore" />
41+
42+
<Redirect to="/404" />
7643
</Switch>
7744
{location.pathname !== "/404" && <Footer fill={"#0D1017"} />}
7845
</Suspense>
79-
80-
)
81-
82-
}
83-
84-
85-
86-
46+
);
8747
}
8848

8949
export default withRouter(App);

src/components/Header/Header.jsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { Link } from "react-router-dom";
33
import styles from "./header.module.scss";
44
import Logo from "./../../assets/_logo/logo.png";
55
import { AccountCircle, Add, ExitToApp, Settings } from "@material-ui/icons";
6-
import { authentication } from "../../firebase-config";
76
import {
87
IconButton,
98
makeStyles,
@@ -15,14 +14,6 @@ import {
1514
} from "@material-ui/core";
1615

1716
function Header(props) {
18-
19-
20-
21-
22-
23-
24-
25-
2617
const { currentRoute } = props;
2718
const header = useRef(null);
2819

@@ -204,7 +195,7 @@ function Header(props) {
204195
to={"/signin"}
205196
onClick={() => setLoggedin(true)}
206197
>
207-
Signin
198+
Sign in
208199
</Link>
209200
)}
210201
</div>

src/firebase-config.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/pages/Login/Login.jsx

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,8 @@ import React from 'react';
22
import 'font-awesome/css/font-awesome.min.css';
33
import './login.css';
44
import loginIllustartion from '../../assets/socialmedia/login.png';
5-
import { authentication } from '../../firebase-config';
6-
import { signInWithPopup, GoogleAuthProvider } from "firebase/auth";
7-
import {ImGoogle} from "react-icons/im"
8-
import {ImGithub} from "react-icons/im"
9-
export default function Login() {
10-
11-
12-
const handleGoogleLogin = () => {
13-
const provider = new GoogleAuthProvider();
14-
signInWithPopup(authentication, provider)
15-
.then((res) => {
16-
console.log(res);
17-
})
18-
.catch((err)=>{
19-
console.log(err);
20-
})
21-
}
22-
23-
245

6+
export default function Login() {
257
return (
268
<div className="container-ctm-login container">
279
<div className="illustration_img">
@@ -81,15 +63,10 @@ export default function Login() {
8163
<a href="/signup"> Create your account! </a>
8264
</div>
8365

84-
<div className="authBtns">
85-
<button id="googlebutton" onClick={handleGoogleLogin}>
86-
<ImGoogle className='icon' />
87-
Continue with Google
88-
</button>
89-
<button id="githubbutton" >
90-
<ImGithub className='icon' />
91-
Continue with Github
92-
</button>
66+
<div className="icons">
67+
<a href="#" id="facebookIcon"></a>
68+
<a href="#" id="twitterIcon"></a>
69+
<a href="#" id="googleIcon"></a>
9370
</div>
9471
</form>
9572
</div>

src/pages/Login/login.css

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -248,40 +248,3 @@ a:hover {
248248
box-shadow: none;
249249
}
250250
}
251-
252-
253-
#googlebutton{
254-
padding: 1em 2em;
255-
border-radius: 100px;
256-
border: none;
257-
background-color: #24a0ed;
258-
color: white;
259-
display: flex;
260-
justify-content: center;
261-
align-items: center;
262-
gap: 1em;
263-
}
264-
#githubbutton{
265-
padding: 1em 2em;
266-
border-radius: 100px;
267-
border: none;
268-
background-color: #24a0ed;
269-
color: white;
270-
display: flex;
271-
justify-content: center;
272-
align-items: center;
273-
gap: 1em;
274-
}
275-
276-
.authBtns{
277-
display: flex;
278-
flex-direction: column;
279-
justify-content: center;
280-
align-items: center;
281-
gap: 1em;
282-
margin: 1em;
283-
}
284-
285-
.icon{
286-
transform: scale(1.2);
287-
}

src/pages/SignupPage/Signup.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default function Signup() {
77
return (
88
<div className="container-ctm-signup container">
99
<div className="illustration_img">
10-
{/* <img src={signupIllustartion}></img> */}
10+
<img src={signupIllustartion}></img>
1111
</div>
1212
<div className="signup-content">
1313
<form>

0 commit comments

Comments
 (0)