Skip to content

Commit

Permalink
Merge pull request #657 from Yashop181/googlesign
Browse files Browse the repository at this point in the history
Googlesign
  • Loading branch information
MastanSayyad committed Aug 1, 2024
2 parents d7aaf77 + 27f171d commit 58adbc0
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 11 deletions.
7 changes: 6 additions & 1 deletion src/Components/Login/Login.css
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,9 @@ p a:hover {
.eye:hover {
color: #007efc;
cursor: pointer;
}
}
.google-login-wrapper {
width: 100%;
display: flex;
justify-content: center;
}
2 changes: 2 additions & 0 deletions src/Components/Login/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const Login = ({ isDarkMode }) => {
<div className={`login-container ${isDarkMode ? 'dark-mode' : ''}`}>
<h2>Login</h2>
<div className="input-container">
<label>Email</label>
<input
type="email"
placeholder="Email"
Expand All @@ -84,6 +85,7 @@ const Login = ({ isDarkMode }) => {
{warnings.email && <p style={{ color: "red" }} className="warningmsg">{warnings.email}</p>}

<div className="input-container">
<label>Password</label>
<input
type={isVisible ? "text" : "password"}
placeholder="Password"
Expand Down
10 changes: 9 additions & 1 deletion src/Components/Signup/Signup.css
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,12 @@ input.valid {
input.invalid {
border-color: red;
/* Red border for invalid inputs */
}
}


/* style for google login button */
.google-login-wrapper {
width: 100%;
display: flex;
justify-content: center;
}
22 changes: 13 additions & 9 deletions src/Components/Signup/Signup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,19 @@ const Signup = () => {
<p>
Already have an account? <NavLink to="/login">Login</NavLink>
</p>
<GoogleLogin
onSuccess={(credentialResponse) => {
const credentialDecoded = jwtDecode(credentialResponse.credential);
console.log(credentialDecoded);
}}
onError={() => {
console.log("Sign-Up Failed");
}}
/>
<div className="google-login-wrapper">
<GoogleLogin
onSuccess={(credentialResponse) => {
const credentialDecoded = jwtDecode(credentialResponse.credential);
console.log(credentialDecoded);
}}
onError={() => {
console.log("Sign-Up Failed!");
}}
/>
</div>


</div>
</div>
);
Expand Down

0 comments on commit 58adbc0

Please sign in to comment.