Skip to content

Commit

Permalink
feat(adaptive): adaptive for reset password
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandrDronov committed Oct 21, 2023
1 parent a95f953 commit b37adba
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/components/entry/entry.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
}
}

&_signIn {
&_signInAndReset {
composes: formWrapper_signUp;

@media screen and (max-width: $media-tablet-large) {
Expand All @@ -115,7 +115,7 @@
}
}

&_notSignUp {
&_notSignUpAndSignInAndReset {
@media screen and (max-width: $media-tablet-large) {
padding-top: 72px;
}
Expand Down Expand Up @@ -156,7 +156,7 @@
}

&_notSignUp {
@media screen and (max-width: calc($media-tablet-large - 1px)) {
@media screen and (max-width: $media-tablet-large) {
text-align: center;
}
}
Expand Down
22 changes: 18 additions & 4 deletions src/components/entry/entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ const Entry: FC<IEntryProps> = ({
</>
);

const formClassListSignInAndReset = [
'Вход в аккаунт',
'Восстановление пароля',
'Придумайте новый пароль',
'Пароль успешно изменён',
'При сохранении пароля произошла ошибка',
];

return (
<main className={styles.main}>
{isAboveTabletScreens ? (
Expand All @@ -80,15 +88,21 @@ const Entry: FC<IEntryProps> = ({
<div
className={classNames(styles.formWrapper, {
[styles.formWrapper_signUp]: heading === 'Регистрация',
[styles.formWrapper_signIn]: heading === 'Вход в аккаунт',
[styles.formWrapper_notSignUp]:
heading !== 'Регистрация' && heading !== 'Вход в аккаунт',
[styles.formWrapper_signInAndReset]:
formClassListSignInAndReset.includes(heading),
[styles.formWrapper_notSignUpAndSignInAndReset]:
!formClassListSignInAndReset.includes(heading) &&
heading !== 'Регистрация',
})}
>
<h2
className={classNames(styles.heading, {
[styles.heading_notSignUp]:
heading !== 'Регистрация' && heading !== 'Вход в аккаунт',
heading !== 'Регистрация' &&
heading !== 'Вход в аккаунт' &&
(heading !== 'Восстановление пароля' ||
buttonType === 'button') &&
heading !== 'Придумайте новый пароль',
})}
>
{heading}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,36 @@
@import 'assets/styles/abstracts/variables/media-queries';

.content {
display: flex;
flex-direction: column;
row-gap: 12px;
margin-bottom: 24px;

@media screen and (max-width: calc($media-desktop-medium - 1px)) {
margin-bottom: 20px;
}

@media screen and (max-width: $media-tablet-large) {
row-gap: 28px;
margin-bottom: 36px;
}

> div > label {
@media screen and (max-width: calc($media-desktop-medium - 1px)) {
display: block;
}
}

&--response {
align-items: center;
margin: 26px 0 58px;
margin: 68px 0 58px;

@media screen and (max-width: calc($media-desktop-medium - 1px)) {
margin: 44px 0 46px;
}

@media screen and (max-width: $media-tablet-large) {
margin-bottom: 36px;
}
}
}
65 changes: 65 additions & 0 deletions src/pages/reset-password/reset-password.module.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
@import 'assets/styles/abstracts/variables/colors';
@import 'assets/styles/abstracts/variables/fonts';
@import 'assets/styles/abstracts/placeholders';
@import 'assets/styles/abstracts/variables/media-queries';
@import 'assets/styles/abstracts/functions';

.content,
.iconWrapper {
Expand All @@ -11,25 +13,88 @@
.content {
row-gap: 12px;
margin-bottom: 24px;

@media screen and (max-width: calc($media-desktop-medium - 1px)) {
row-gap: 6px;
margin-bottom: 16px;
}

@media screen and (max-width: $media-tablet-large) {
row-gap: 12px;
margin-bottom: 42px;
}
}

.instruction {
@extend %text-size-large;
color: $color-neutral-500;

@media screen and (max-width: calc($media-desktop-large - 1px)) {
font-size: calc-fluid-element(
calc($font-size-text-medium * 10),
calc($font-size-text-large * 10),
$media-desktop-small,
$media-desktop-large
);
}

@media screen and (max-width: calc($media-desktop-medium - 1px)) {
line-height: $font-line-height-text-medium;
letter-spacing: $font-letter-spacing-main;
}

@media screen and (max-width: calc($media-desktop-small - 1px)) {
font-size: $font-size-text-medium;
}

&_success {
@media screen and (max-width: $media-tablet-large) {
text-align: center;
}
}
}

.iconWrapper {
align-items: center;
margin: 28px 0 16px;
min-height: 235px;

@media screen and (max-width: calc($media-desktop-large - 1px)) {
min-height: calc-fluid-element(
172px,
235px,
$media-desktop-small,
$media-desktop-large
);
}

@media screen and (max-width: calc($media-desktop-medium - 1px)) {
margin: 20px 0 0;
}

@media screen and (max-width: calc($media-desktop-small - 1px)) {
min-height: 172px;
}

@media screen and (max-width: $media-tablet-large) {
margin: 46px 0 60px;
}

div {
margin-right: 8%;

@media screen and (max-width: calc($media-desktop-medium - 1px)) {
margin-right: 0;
}
}
}

.buttonBack {
display: flex;
justify-content: center;
margin-top: 30px;

@media screen and (max-width: calc($media-desktop-medium - 1px)) {
margin-top: 26px;
}
}
8 changes: 5 additions & 3 deletions src/pages/reset-password/reset-password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Button from 'shared/buttons/button/button';
import { resetPassword } from 'utils/api';
import { schemaEmail } from 'utils/data/validation/yup-schema';
import { filterFormValues } from 'utils/functions/filter-form-values';
import classNames from 'classnames';
import routes from 'utils/routes';
import styles from './reset-password.module.scss';

Expand Down Expand Up @@ -63,7 +64,7 @@ export const ResetPasswordPage = () => {
const initialState = (
<>
<p className={styles.instruction}>
Введите email, который вы использовали при&nbsp;регистрации
Введите email, который вы&nbsp;использовали при&nbsp;регистрации
</p>
<Input
name="email"
Expand All @@ -83,8 +84,9 @@ export const ResetPasswordPage = () => {

const successState = (
<>
<p className={styles.instruction}>
Мы отправили инструкцию по восстановлению пароля на указанную почту
<p className={classNames(styles.instruction, styles.instruction_success)}>
Мы отправили инструкцию по&nbsp;восстановлению пароля на&nbsp;указанную
почту
</p>
<div className={styles.iconWrapper}>
<MailWithIcon hasStatusIcon statusIcon="success" />
Expand Down
3 changes: 1 addition & 2 deletions src/shared/buttons/button/button.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}

&--small {
padding: 12px 63px;
padding: 12px 38px;
}

&--medium {
Expand Down Expand Up @@ -66,7 +66,6 @@
justify-content: center;
align-items: center;
column-gap: 4.5px;
text-wrap: nowrap;
}

.button--primary {
Expand Down

0 comments on commit b37adba

Please sign in to comment.