Skip to content

Commit

Permalink
feat(profile): remake adaptive due to new template
Browse files Browse the repository at this point in the history
  • Loading branch information
elrouss committed Oct 23, 2023
1 parent fb03d74 commit 461d4a6
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,52 +21,37 @@

&_title {
@extend %heading-size-small;

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

@media screen and (max-width: $media-tablet-large) {
font-weight: 700;
line-height: $font-line-height-text-large;
letter-spacing: normal;
}

@media screen and (max-width: $media-tablet-small) {
font-size: $font-size-text-large;
}
}

&_inputs {
margin: 32px 0 28px;

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

> div {
&:not(:first-child) {
margin-top: 15px;

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

@media screen and (max-width: $media-tablet-large) {
margin-bottom: 25px;
margin-bottom: 22px;
}

@media screen and (max-width: calc($media-tablet-small-extra - 1px)) {
margin-top: 24px;
margin-bottom: 21px;
margin-top: 18px;
margin-bottom: 18px;
}
}

&_button {
width: 100%;

@media screen and (max-width: $media-tablet-large) {
max-width: 335px;
}
}

&_nav {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
schemaPassword,
schemaCurrentPassword,
} from 'utils/data/validation/yup-schema';
import { tabletAlbumOrientation } from 'utils/constants';
import { desktopMedium } from 'utils/constants';
import styles from './password-changing.module.scss';

interface IPasswordChangingProps {
Expand All @@ -24,7 +24,7 @@ export const PasswordChanging: FC<IPasswordChangingProps> = ({
current_password: string[];
}>(null);

const isSmallScreenDevice = useWindowDimensions() <= tabletAlbumOrientation;
const isMediumScreenDevice = useWindowDimensions() <= desktopMedium;

const formik = useFormik({
initialValues: {
Expand Down Expand Up @@ -101,7 +101,7 @@ export const PasswordChanging: FC<IPasswordChangingProps> = ({
extraClass={styles.userProfile_button}
type="submit"
label="Сохранить новый пароль"
size={isSmallScreenDevice ? 'small' : 'medium'}
size={isMediumScreenDevice ? 'small' : 'medium'}
hasSpinner
spinnerSize="small"
spinnerColor="white"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,31 +40,38 @@

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

@media screen and (max-width: $media-desktop-large) {
font-weight: 700;
letter-spacing: normal;
}

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

&_inputs {
margin: 28px 0 7px;
margin: 28px 0 6px;

@media screen and (max-width: calc($media-tablet-small-extra - 1px)) {
margin-bottom: 2px;
@media screen and (max-width: calc($media-desktop-medium - 1px)) {
margin: 20px 0 3px;
}

@media screen and (max-width: $media-tablet-large) {
margin-bottom: 6px;
}

> div {
&:not(:first-child) {
margin-top: 5px;

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

> div {
background-color: $color-neutral-100;
border-color: $color-neutral-150;
Expand All @@ -83,10 +90,6 @@
}
}
}

&:not(:first-child) {
margin-top: 4px;
}
}
}

Expand Down
8 changes: 8 additions & 0 deletions src/components/user-profile/user-profile.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
column-gap: 7px;
}
}

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

@media screen and (max-width: $media-tablet-large) {
Expand Down Expand Up @@ -117,6 +121,10 @@
@media screen and (max-width: $media-tablet-large) {
margin-top: 30px;
}

@media screen and (max-width: calc($media-tablet-small-extra - 1px)) {
margin-top: 32px;
}
}

&_button_password {
Expand Down
7 changes: 6 additions & 1 deletion src/shared/input/input.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
@extend %text-size-medium;
color: $color-neutral-700;

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

&--disabled {
color: $color-neutral-400;
}
Expand All @@ -41,7 +46,7 @@
&--medium {
padding: 19px 12px;

@media screen and (max-width: $media-tablet-large) {
@media screen and (max-width: calc($media-desktop-medium - 1px)) {
padding-top: 11px;
padding-bottom: 11px;
}
Expand Down

0 comments on commit 461d4a6

Please sign in to comment.