-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#284 fe restore password #285
Conversation
return <div className={css['dot-row']}>{dots}</div>; | ||
}; | ||
|
||
function DotDecorComponent(props) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add prop-types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
import styles from './RestorePasswordForm.module.css'; | ||
import { RestorePasswordFormContentComponent } from './restorepassword-form/RestorePasswordFormContent'; | ||
import { useState } from 'react'; | ||
import { Link } from 'react-router-dom'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: libs import usually is above than custom component/styles. It would be nice to add eslint rule for it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
email: 'Email не відповідає вимогам', | ||
}; | ||
|
||
const emailPattern = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we use emailPattern
only here? It would be good to create a constant for it and reuse it in all places (Login, Register...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
const formIsValid = isValid; | ||
setIsValid(formIsValid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use isValid
directly w/o reasigning?
color: var(--red-red-100, #f34444); | ||
|
||
/* Body/regular */ | ||
font-family: Roboto, sans-serif; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we use this font for most of the text boxes it makes sense to define it as a global style and do to duplicate it every time
confirmPassword: 'Паролі не збігаються', | ||
}; | ||
|
||
const passwordPattern = /^(?=.*[0-9])(?=.*[a-zA-Z])[a-zA-Z0-9]{8,20}$/; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to use the same patter for Register and Login. It makes sense to export it from one place
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
|
||
axios({ | ||
method: 'post', | ||
url: `${process.env.REACT_APP_BASE_API_URL}/api/auth/users/reset_password/`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need to use this env var? I thought that we decided to use the relative path since API leaves on the same domain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not have any information about it
<div> | ||
|
||
<div className={styles['reset-password-form']}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bad formatting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
|
||
export function RestorePasswordModalPage() { | ||
return ( | ||
<div className={styles['modal']}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we create a shared modal component and reuse it for the rest modals?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking comments. But I would appreciate these improvements
Info about reset password
Page about sending email
Form for resetting password
Password successfully restored
Password restored failed