Skip to content

Commit

Permalink
change file names and fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
javtran committed Aug 21, 2024
1 parent 9171e7c commit 6ad332b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
4 changes: 2 additions & 2 deletions client/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { AdminUsers } from './pages/admin/users/AdminUsers';

import Context from './Context';
import AdminPendingUsers from './pages/admin/pending-users/AdminPendingUsers';
import PasswordReset from './pages/auth/password-reset/passwordReset';
import PasswordForgot from './pages/auth/password-forgot/passwordForgot';
import AuthLayout from './stories/AuthLayout/AuthLayout';

const RedirectProps = {
Expand Down Expand Up @@ -109,7 +109,7 @@ function App() {
<Route element={<AuthLayout />}>
<Route path="/register" element={<Register />} />
<Route path="/login" element={<Login />} />
<Route path="/password-reset" element={<PasswordReset />} />
<Route path="/password-reset" element={<PasswordForgot />} />
</Route>
</Route>
</Routes>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import { Button, Container, Loader, TextInput } from '@mantine/core';
import PropTypes from 'prop-types';
import classes from './passwordReset.module.css';
import classes from './passwordForgot.module.css';

const resetFormProps = {
const formProps = {
email: PropTypes.string.isRequired,
emailError: PropTypes.string,
onEmailChange: PropTypes.func.isRequired,
Expand All @@ -13,9 +13,9 @@ const resetFormProps = {
};
/**
* Reset Form component for Password Reset page
* @param {PropTypes.InferProps<typeof resetFormProps>} props
* @param {PropTypes.InferProps<typeof formProps>} props
*/
export function ResetForm({
export function PasswordForgotForm({
email,
emailError,
onEmailChange,
Expand Down Expand Up @@ -62,4 +62,4 @@ export function ResetForm({
);
}

ResetForm.propTypes = resetFormProps;
PasswordForgotForm.propTypes = formProps;
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
import React, { useState } from 'react';
import classes from './passwordReset.module.css';
import classes from './passwordForgot.module.css';
import { Flex } from '@mantine/core';
import { ResetForm } from './ResetForm';
import { PasswordForgotForm } from './PasswordForgotForm';

/**
* Password reset page
*/
function PasswordReset() {
function PasswordForgot() {
const [email, setEmail] = useState('');
const [emailError, setEmailError] = useState(null);
const [isLoading, setIsLoading] = useState(false);
const [formState, setFormState] = useState(1);

/**
* Password Reset Page
*/
function sendPasswordReset() {
setEmailError(null);
setIsLoading(true);
Expand Down Expand Up @@ -48,7 +51,7 @@ function PasswordReset() {
</p>
</div>
<Flex direction="column" gap="md">
<ResetForm
<PasswordForgotForm
email={email}
emailError={emailError}
onEmailChange={(event) => {
Expand All @@ -64,4 +67,4 @@ function PasswordReset() {
);
}

export default PasswordReset;
export default PasswordForgot;
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import '@mantine/core/styles.css';
import { ResetForm } from './ResetForm';
import { PasswordForgotForm } from './PasswordForgotForm';

export default {
title: 'Reset Form',
component: ResetForm,
title: 'Password Forgot Form',
component: PasswordForgotForm,
tags: ['autodocs'],
parameters: {
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
Expand Down

0 comments on commit 6ad332b

Please sign in to comment.