Skip to content

Commit

Permalink
Merge pull request #188 from agiledev-students-fall2023/charlotte
Browse files Browse the repository at this point in the history
add password recovery page frontend
  • Loading branch information
lunnnnnn authored Dec 7, 2023
2 parents a5f798b + e9aa4e9 commit abaf9b7
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
2 changes: 2 additions & 0 deletions front-end/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import FavoriteList from './pages/FavoriteList/FavoriteList';
import AppLayout from './AppLayout';
import AuthLayout from './pages/Authenticate/AuthLayout';
import AccountWithLogin from './pages/Account/AccountWithLogin';
import ResetPassword from './pages/Account/ResetPassword';

import MapLayout from './pages/MainMap/MapLayout';
const App = () => {
Expand All @@ -36,6 +37,7 @@ const App = () => {
<Route path="/account" element={<AccountEdit />} />
<Route path="/accountLog" element={<AccountWithLogin />} />
<Route path="/*" element={<Error />} />
<Route path="/resetpassword" element={<ResetPassword />} />

</Route>

Expand Down
34 changes: 34 additions & 0 deletions front-end/src/pages/Account/ResetPassword.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import React, { useRef } from 'react'; // Import React and useRef
import {FormInputs} from '../../components/form/formInput';
import FormBtn from '../../components/form/formBtn';
import AuthHeader from '../Authenticate/authHeader';
import NavBar from "../../components/common/navBar";
import LeftBtn from "../../components/common/leftBtn";

const ResetPassword = ({ loginMessage, handleLogin, handleGuest }) => {
const formRef = useRef(null); // Assuming you have useRef imported from 'react'
const fields = ["newPassword", "confirmPassword"]; // Fields for the form

return (
<>
<div className="flex flex-col">
<NavBar relative="1">
<LeftBtn />
</NavBar>
<div className="flex flex-col w-[80%] max-w-[30rem] mx-auto justify-center items-center bg-gray-100 pt-4 mt-24">
<AuthHeader header="Reset Password" message={loginMessage} />
<div className="w-full max-w-xs">
<form ref={formRef} onSubmit={handleLogin} className="bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4">
<FormInputs fields={fields} />
<div className='flex justify-center mt-4'>
<FormBtn type="submit" value="Reset Password" />
</div>
</form>
</div>
</div>
</div>
</>
);
};

export default ResetPassword;

0 comments on commit abaf9b7

Please sign in to comment.