From d454a0fd8163085d19a457ace8f1a4a0177e182c Mon Sep 17 00:00:00 2001 From: Roman-Ojha Date: Fri, 1 Jul 2022 13:49:34 +0545 Subject: [PATCH] fix(signInPage): Separated SignInPages Comp fixes #100 --- .../components/SignInPage/SignInHeader.tsx | 2 +- .../components/SignInPage/SignInRightPart.tsx | 62 +++++++++++++++++++ client/src/pages/SignIn.tsx | 53 +--------------- 3 files changed, 65 insertions(+), 52 deletions(-) create mode 100644 client/src/components/SignInPage/SignInRightPart.tsx diff --git a/client/src/components/SignInPage/SignInHeader.tsx b/client/src/components/SignInPage/SignInHeader.tsx index f2a3e2f..203d426 100644 --- a/client/src/components/SignInPage/SignInHeader.tsx +++ b/client/src/components/SignInPage/SignInHeader.tsx @@ -9,7 +9,7 @@ const SignInHeader = (): JSX.Element => {

{ - history.push("/u"); + history.push("/u/home"); }} className="SignIn_Page_Social_Logo" style={{ cursor: "pointer" }} diff --git a/client/src/components/SignInPage/SignInRightPart.tsx b/client/src/components/SignInPage/SignInRightPart.tsx new file mode 100644 index 0000000..be56ef3 --- /dev/null +++ b/client/src/components/SignInPage/SignInRightPart.tsx @@ -0,0 +1,62 @@ +import React from "react"; +import { toastInfo } from "../../services/toast"; +import Sign_In_Facebook_Logo from "../../assets/Images/Facebook_Logo.png"; +import Sign_In_Google_Logo from "../../assets/Images/Google_Logo.png"; +import SignIn_RightSide_Issustration from "../../assets/svg/SignIn_RightSide_Issustration.svg"; + +const SignInRightPart = (): JSX.Element => { + const signInWithGoogle = async () => { + window.open(`${process.env.REACT_APP_API_BASE_URL}/auth/google`, "_self"); + // window.open("", ""); + // here this will open the google authentication + }; + + const signInWithFacebook = () => { + toastInfo("Facebook auth is under development, Please use Google auth"); + }; + + return ( + <> +
+
+
+ SignIn +
+ + + +
+
+ + ); +}; + +export default SignInRightPart; diff --git a/client/src/pages/SignIn.tsx b/client/src/pages/SignIn.tsx index 4616b3b..5e72787 100644 --- a/client/src/pages/SignIn.tsx +++ b/client/src/pages/SignIn.tsx @@ -1,7 +1,4 @@ import React, { useState } from "react"; -import Sign_In_Facebook_Logo from "../assets/Images/Facebook_Logo.png"; -import Sign_In_Google_Logo from "../assets/Images/Google_Logo.png"; -import SignIn_RightSide_Issustration from "../assets/svg/SignIn_RightSide_Issustration.svg"; import { instance as axios } from "../services/axios"; import { NavLink, useHistory } from "react-router-dom"; import "../styles/pages/signInPage.css"; @@ -14,6 +11,7 @@ import { AxiosError } from "axios"; import { actionCreators } from "../services/redux"; import { bindActionCreators } from "redux"; import SignInHeader from "../components/SignInPage/SignInHeader"; +import SignInRightPart from "../components/SignInPage/SignInRightPart"; const SignIn = (): JSX.Element => { const dispatch = useDispatch(); @@ -38,7 +36,6 @@ const SignIn = (): JSX.Element => { const history = useHistory(); const signingIn = async (e: React.MouseEvent) => { e.preventDefault(); - try { startProgressBar(); const res = await axios({ @@ -75,15 +72,6 @@ const SignIn = (): JSX.Element => { stopProgressBar(); } }; - const signInWithGoogle = async () => { - window.open(`${process.env.REACT_APP_API_BASE_URL}/auth/google`, "_self"); - // window.open("", ""); - // here this will open the google authentication - }; - - const signInWithFacebook = () => { - toastInfo("Facebook auth is under development, Please use Google auth"); - }; return ( <> @@ -133,44 +121,7 @@ const SignIn = (): JSX.Element => {

-
-
-
- SignIn -
- - - -
-
+ );