-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from jogeshgupta963/main
Auth Pages and minor changes
- Loading branch information
Showing
11 changed files
with
353 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 9 additions & 11 deletions
20
acm-member-dashboard/src/components/Contribution/Contribution.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
import React from 'react' | ||
import React from "react"; | ||
import Tilt from "react-parallax-tilt"; | ||
import './Contribution.css' | ||
import "./Contribution.css"; | ||
|
||
const Contribution = () => { | ||
return ( | ||
<a href="https://github.com/ACM-Thapar/CS_COURSE_GUIDE"> | ||
<Tilt> | ||
<div className="cscourseguide"> | ||
CS_COURSE_GUIDE | ||
</div> | ||
</Tilt> | ||
<a href="https://github.com/ACM-Thapar/CS_COURSE_GUIDE" target="__blank"> | ||
<Tilt> | ||
<div className="cscourseguide">CS_COURSE_GUIDE</div> | ||
</Tilt> | ||
</a> | ||
) | ||
} | ||
); | ||
}; | ||
|
||
export default Contribution | ||
export default Contribution; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
acm-member-dashboard/src/pages/ForgotPassword/ForgotPass.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import "../login/Login.css"; | ||
import acmlogo from "../../imgs/acmlogo.png"; | ||
import axios from "axios"; | ||
import { useRef } from "react"; | ||
|
||
import { | ||
Link, | ||
Navigate, | ||
useLocation, | ||
useNavigate, | ||
useParams, | ||
} from "react-router-dom"; | ||
import Cookies from "js-cookie"; | ||
import { useEffect } from "react"; | ||
import { useState } from "react"; | ||
|
||
function ForgotPass() { | ||
const pass = useRef(""); | ||
const conPass = useRef(""); | ||
const navigate = useNavigate(); | ||
const [sent, setSent] = useState(0); | ||
const { id } = useParams(); | ||
const resetPassword = async () => { | ||
try { | ||
if (pass.current.value !== conPass.current.value) { | ||
console.log("Passwords dont match"); | ||
} | ||
const { data } = await axios.post(`/auth/resetPassword/${id}`, { | ||
password: pass.current.value, | ||
}); | ||
if (data) { | ||
navigate("/login"); | ||
} | ||
} catch (error) { | ||
setSent(0); | ||
} | ||
}; | ||
|
||
return ( | ||
<> | ||
{Cookies.get("ACM_THAPAR") && <Navigate to="/" />} | ||
<div className="main"> | ||
<div className="sub-main"> | ||
<div> | ||
<div className="imgs"> | ||
<div className="container-image"> | ||
<img src={acmlogo} alt="profile" className="profile" /> | ||
</div> | ||
</div> | ||
<div> | ||
<h1>Reset Password</h1> | ||
|
||
<div className="inputs"> | ||
<input | ||
ref={pass} | ||
type="password" | ||
placeholder="Password" | ||
className="name" | ||
/> | ||
</div> | ||
<div className="inputs"> | ||
<input | ||
ref={conPass} | ||
type="password" | ||
placeholder="confirm password" | ||
className="name" | ||
/> | ||
</div> | ||
<div onClick={resetPassword} className="login-button"> | ||
<button>Reset Password</button> | ||
</div> | ||
{sent ? ( | ||
<> | ||
<div> | ||
<p>An email has been sent to you to change your password</p> | ||
</div> | ||
</> | ||
) : null} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
} | ||
|
||
export default ForgotPass; |
Oops, something went wrong.