generated from ita-social-projects/DevTemplate
-
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
32bb0a9
Create page for email sending
whooaami 6c873eb
Create page for reset password
whooaami ca42c75
Fix styles
whooaami 01d830b
Create new pages about success operation and fail
whooaami 3d2279f
Fix error output
whooaami 0a9435c
Fix. Add prop-types
whooaami 080efde
Fix formatting
whooaami a93e57c
Fix imports
whooaami 37f571a
Fix. Create file with constants
whooaami File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
FrontEnd/src/components/RestorePassword/UI/dotDecor/DotDecor.js
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,35 @@ | ||
import css from './DotDecor.module.css'; | ||
|
||
const DotRow = () => { | ||
const circle = ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="5" | ||
height="5" | ||
viewBox="0 0 5 5" | ||
fill="none" | ||
> | ||
<circle cx="2.5" cy="2.5" r="2.5" fill="#1F9A7C" /> | ||
</svg> | ||
); | ||
|
||
const dots = [...Array(7)].map(() => circle); | ||
|
||
return <div className={css['dot-row']}>{dots}</div>; | ||
}; | ||
|
||
function DotDecorComponent(props) { | ||
const blockPosition = props.position; | ||
return ( | ||
<div className={`${css['dot-block']} ${css[blockPosition]}`}> | ||
<DotRow /> | ||
<DotRow /> | ||
<DotRow /> | ||
<DotRow /> | ||
<DotRow /> | ||
<DotRow /> | ||
</div> | ||
); | ||
} | ||
|
||
export default DotDecorComponent; |
25 changes: 25 additions & 0 deletions
25
FrontEnd/src/components/RestorePassword/UI/dotDecor/DotDecor.module.css
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,25 @@ | ||
.dot-block { | ||
display: inline-flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
gap: 24px; | ||
position: absolute; | ||
z-index: 1; | ||
} | ||
|
||
.dot-block.up-right { | ||
top: 205px; | ||
left: 971px; | ||
} | ||
|
||
.dot-block.down-left { | ||
top: 530px; | ||
left: 358px; | ||
} | ||
|
||
.dot-row { | ||
display: flex; | ||
align-items: flex-start; | ||
gap: 24px; | ||
} | ||
|
33 changes: 33 additions & 0 deletions
33
FrontEnd/src/components/RestorePassword/components/restorepassword/RestorePasswordForm.js
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,33 @@ | ||
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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Fixed |
||
|
||
|
||
export function RestorePasswordFormComponent() { | ||
const [isValid, setIsValid] = useState(false); | ||
const updateIsValid = (value) => { | ||
setIsValid(value); | ||
}; | ||
return ( | ||
<div className={styles['form__container']}> | ||
<div className={styles['form__header']}>Відновлення паролю</div> | ||
<RestorePasswordFormContentComponent setIsValid={updateIsValid}/> | ||
<div className={styles['form__footer']}> | ||
<div className={styles['button-container']}> | ||
<Link className={styles['main-page__button']} to="/"> | ||
Головна | ||
</Link> | ||
<button | ||
disabled={!isValid} | ||
form="resetPasswordForm" | ||
className={isValid ? styles['sign-up__button'] : styles['sign-up__button__disabled']} | ||
type="submit" | ||
> | ||
Зберегти | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |
131 changes: 131 additions & 0 deletions
131
.../src/components/RestorePassword/components/restorepassword/RestorePasswordForm.module.css
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,131 @@ | ||
.form__container { | ||
display: flex; | ||
width: 572px; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
|
||
border-radius: 2px; | ||
background: var(--conditional-pop-over, #fff); | ||
|
||
/* drop-shadow/0.12+0.8+0.5 */ | ||
box-shadow: 0px 9px 28px 8px rgba(0, 0, 0, 0.05), | ||
0px 6px 16px 0px rgba(0, 0, 0, 0.08), 0px 3px 6px -4px rgba(0, 0, 0, 0.12); | ||
} | ||
|
||
.form__header { | ||
display: flex; | ||
padding: 16px 24px; | ||
align-items: flex-start; | ||
gap: 36px; | ||
align-self: stretch; | ||
background: var(--main-white, #fff); | ||
|
||
/* border & divider/divider ↓ */ | ||
box-shadow: 0px -1px 0px 0px #f0f0f0 inset; | ||
color: var(--character-title-85, rgba(0, 0, 0, 0.85)); | ||
font-feature-settings: "calt" off; | ||
|
||
/* Text/Body/16-Semi bold */ | ||
font-family: Inter, sans-serif; | ||
font-size: 16px; | ||
font-style: normal; | ||
font-weight: 600; | ||
line-height: 20px; | ||
/* 125% */ | ||
letter-spacing: -0.16px; | ||
} | ||
|
||
.form__footer { | ||
display: flex; | ||
padding: 10px 16px; | ||
justify-content: flex-end; | ||
align-items: center; | ||
gap: 8px; | ||
align-self: stretch; | ||
background: var(--main-white, #fff); | ||
|
||
/* border & divider/divider ↑ */ | ||
box-shadow: 0px 1px 0px 0px #f0f0f0 inset; | ||
} | ||
|
||
.button-container { | ||
display: flex; | ||
align-items: flex-start; | ||
gap: 12px; | ||
} | ||
|
||
.main-page__button { | ||
display: flex; | ||
padding: 5px 15px; | ||
justify-content: center; | ||
align-items: center; | ||
gap: 10px; | ||
border-radius: 4px; | ||
border: 1px solid var(--primary-green-80, #1f9a7c); | ||
background: var(--main-white, #fff); | ||
|
||
/* drop-shadow/button-secondary */ | ||
box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.02); | ||
|
||
color: var(--primary-green-80, #1f9a7c); | ||
text-align: center; | ||
font-feature-settings: "calt" off; | ||
|
||
/* Text/Body/16-Semi bold */ | ||
font-family: Inter, sans-serif; | ||
font-size: 16px; | ||
font-style: normal; | ||
font-weight: 600; | ||
line-height: 20px; | ||
/* 125% */ | ||
letter-spacing: -0.16px; | ||
text-decoration: none; | ||
|
||
cursor: pointer; | ||
} | ||
|
||
.main-page__button:hover { | ||
border: 1px solid var(--primary-green-80, #1f9a7c); | ||
background: var(--primary-green-80, #1f9a7c); | ||
color: var(--main-white, #fff); | ||
} | ||
|
||
.sign-up__button, | ||
.sign-up__button__disabled { | ||
display: flex; | ||
padding: 5px 15px; | ||
justify-content: center; | ||
align-items: center; | ||
gap: 10px; | ||
border-radius: 4px; | ||
border: 1px solid var(--primary-green-80, #1f9a7c); | ||
background: var(--primary-green-80, #1f9a7c); | ||
|
||
/* drop-shadow/button-primary */ | ||
box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.04); | ||
color: var(--main-white, #fff); | ||
text-align: center; | ||
font-feature-settings: "calt" off; | ||
|
||
/* Text/Body/16-Semi bold */ | ||
font-family: Inter, sans-serif; | ||
font-size: 16px; | ||
font-style: normal; | ||
font-weight: 600; | ||
line-height: 20px; | ||
/* 125% */ | ||
letter-spacing: -0.16px; | ||
|
||
cursor: pointer; | ||
} | ||
|
||
.sign-up__button__disabled { | ||
opacity: 50%; | ||
cursor: default; | ||
} | ||
|
||
.sign-up__button:hover { | ||
border: 1px solid var(--primary-green-80, #1f9a7c); | ||
background: var(--main-white, #fff); | ||
color: var(--primary-green-80, #1f9a7c); | ||
} |
43 changes: 43 additions & 0 deletions
43
FrontEnd/src/components/RestorePassword/components/restorepassword/SendEmailForm.js
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,43 @@ | ||
import styles from './SendEmailForm.module.css'; | ||
import { SendEmailRestorePasswordFormContentComponent } from './restorepassword-form/EmailFormContent'; | ||
import { useState } from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
export function SendEmailRestorePasswordFormComponent() { | ||
const [isValid, setIsValid] = useState(false); | ||
|
||
return ( | ||
<div className={styles['form__container']}> | ||
<div className={styles['form__header']}> | ||
Забули пароль | ||
</div> | ||
<div className={styles['form__footer']}> | ||
<p> | ||
Введіть електронну адресу вказану при реєстрації для відновлення паролю. <br /> | ||
На зазначену Вами електронну пошту буде відправлено листа з посиланням | ||
для відновлення паролю. <br /> | ||
</p> | ||
</div> | ||
<SendEmailRestorePasswordFormContentComponent setIsValid={setIsValid} /> | ||
<div className={styles['form__footer']}> | ||
<div className={styles['button-container']}> | ||
<Link className={styles['login-page__button']} to="/login"> | ||
Скасувати | ||
</Link> | ||
<button | ||
disabled={!isValid} | ||
form="signUpForm" | ||
className={ | ||
isValid | ||
? styles['send-email__button'] | ||
: styles['send-email__button__disabled'] | ||
} | ||
type="submit" | ||
> | ||
Надіслати | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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