-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #440 from Studio-Yandex-Practicum/development_424_…
…edit_account_page Development 424 edit account page
- Loading branch information
Showing
25 changed files
with
536 additions
and
8 deletions.
There are no files selected for viewing
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
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
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
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
File renamed without changes.
File renamed without changes.
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
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
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
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 @@ | ||
@use '../../shared/styles/utils/mixins' as media; | ||
@use '../../shared/styles/utils/variables' as color; | ||
|
||
.editAccountPage { | ||
width: 100%; | ||
|
||
&__pageDescriptor { | ||
width: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 10px; | ||
} | ||
|
||
&__container { | ||
width: 100%; | ||
display: flex; | ||
justify-content: start; | ||
align-items: start; | ||
gap: 20px; | ||
|
||
@include media.respond-to('large') { | ||
flex-direction: column; | ||
gap: 10px; | ||
} | ||
} | ||
|
||
&__contentContainer { | ||
width: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 50px; | ||
} | ||
} |
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,61 @@ | ||
import { FC, Suspense, useState } from 'react' | ||
|
||
import SideBarMenuModal from '@/features/SideBarMenuModal' | ||
import { Routes } from '@/shared/config/routerConfig/routes' | ||
import { useResize } from '@/shared/libs/hooks/useResize' | ||
import Breadcrumbs from '@/shared/ui/Breadcrumbs/Breadcrumbs' | ||
import Heading from '@/shared/ui/Heading/Heading' | ||
import Modal from '@/shared/ui/Modal/Modal' | ||
import Spinner from '@/shared/ui/Spinner/Spinner' | ||
import WrapperForMainContent from '@/shared/ui/WrapperForMainContent/WrapperForMainContent' | ||
import { EditAccount } from '@/widgets/EditAccount/EditAccount' | ||
import { withAdaptiveSideBar } from '@/widgets/SideBarMenu' | ||
|
||
import styles from './EditAccountPage.module.scss' | ||
|
||
const links = [ | ||
{ heading: 'Главная', href: '/' }, | ||
{ heading: 'Личный Кабинет', href: Routes.ACCOUNT }, | ||
{ heading: 'Учетная запись', href: '' } | ||
] | ||
|
||
export const EditAccountPage: FC = () => { | ||
const { isScreenLg } = useResize() | ||
const [isModalOpen, setIsModalOpen] = useState<boolean>(false) | ||
const [isModalClosing, setIsModalClosing] = useState<boolean>(false) | ||
const AdaptiveSideBar = withAdaptiveSideBar(isScreenLg) | ||
|
||
const handleClick = () => { | ||
setIsModalOpen(true) | ||
} | ||
|
||
const changeModalState = () => { | ||
setIsModalOpen(!isModalOpen) | ||
} | ||
|
||
return ( | ||
<WrapperForMainContent> | ||
<div className={styles.editAccountPage__pageDescriptor}> | ||
<Heading>Учетная запись</Heading> | ||
<Breadcrumbs links={links} /> | ||
</div> | ||
<div className={styles.editAccountPage__container}> | ||
<AdaptiveSideBar handleClick={handleClick} /> | ||
<div className={styles.editAccountPage__contentContainer}> | ||
<EditAccount /> | ||
</div> | ||
</div> | ||
{isModalOpen && ( | ||
<Modal | ||
isModalOpen={isModalOpen} | ||
onClose={changeModalState} | ||
isModalClosing={isModalClosing} | ||
setIsModalClosing={setIsModalClosing}> | ||
<Suspense fallback={<Spinner />}> | ||
<SideBarMenuModal handleClose={changeModalState} /> | ||
</Suspense> | ||
</Modal> | ||
)} | ||
</WrapperForMainContent> | ||
) | ||
} |
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
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
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
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
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
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,88 @@ | ||
@use '../../shared/styles/utils/variables' as color; | ||
|
||
@mixin font($size) { | ||
font-size: $size; | ||
font-weight: 500; | ||
line-height: 1.5; | ||
} | ||
|
||
.editAccountform { | ||
width: 100%; | ||
min-height: 400px; | ||
padding: 30px; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
justify-content: flex-start; | ||
gap: 20px; | ||
background-color: color.$white; | ||
border-radius: 5px; | ||
|
||
&__header { | ||
font-size: 20px; | ||
line-height: 1; | ||
font-weight: 700; | ||
} | ||
|
||
&__form { | ||
width: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
justify-content: flex-start; | ||
gap: 20px; | ||
} | ||
|
||
&__label { | ||
width: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 10px; | ||
} | ||
|
||
&__fieldlabel { | ||
@include font(14px); | ||
} | ||
|
||
&__field { | ||
width: 100%; | ||
padding: 10px 16px; | ||
border: none; | ||
outline: none; | ||
background-color: color.$body-bg; | ||
border-radius: 5px; | ||
box-shadow: none; | ||
@include font(14px); | ||
|
||
transition: box-shadow 0.5s; | ||
|
||
&:focus { | ||
box-shadow: 0 0 0 2px color.$theme-primary-color; | ||
} | ||
|
||
&_textfield { | ||
min-height: 100px; | ||
} | ||
} | ||
|
||
&__btnConteiner { | ||
width: 50%; | ||
display: flex; | ||
gap: 10px; | ||
} | ||
|
||
&__submitbtn { | ||
width: 100%; | ||
transition: opacity 0.5s; | ||
|
||
&:hover { | ||
opacity: 0.8; | ||
} | ||
} | ||
|
||
&__msg { | ||
font-size: 18px; | ||
line-height: 25px; | ||
font-weight: 400; | ||
} | ||
} |
Oops, something went wrong.