-
Notifications
You must be signed in to change notification settings - Fork 2
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 #18 from ViktorSvertoka/header-continue
Style(SCSS) Code style edits. Header
- Loading branch information
Showing
5 changed files
with
67 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
import { Link } from 'react-router-dom'; | ||
import { HeaderContainer } from './Header.styled'; | ||
import { HeaderContainer, LogoLink, UserContainer } from './Header.styled'; | ||
import { UserMenu } from '../UserMenu/UserMenu'; | ||
import MobileMenu from '../MobileMenu/MobileMenu'; | ||
import { MobileMenuButton } from '../MobileMenuButton/MobileMenuButton'; | ||
import { useState } from 'react'; | ||
|
||
export const Header = () => { | ||
const [isOpen, setIsOpen] = useState(false); | ||
const handleClick = () => { | ||
const onClickMenuBtn = () => { | ||
setIsOpen({ isOpen: !isOpen }); | ||
}; | ||
return ( | ||
<HeaderContainer> | ||
<Link to="/"> | ||
<LogoLink to="/"> | ||
<svg width={152} height={17}> | ||
<use href="../../../src/images/sprite.svg#icon-logo"></use> | ||
</svg> | ||
</Link> | ||
<UserMenu /> | ||
<MobileMenuButton onClick={handleClick} /> | ||
<MobileMenu isOpen={isOpen} /> | ||
</LogoLink> | ||
<UserContainer> | ||
<UserMenu /> | ||
<MobileMenuButton onClick={onClickMenuBtn} /> | ||
<MobileMenu isOpen={isOpen} /> | ||
</UserContainer> | ||
</HeaderContainer> | ||
); | ||
}; |
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 |
---|---|---|
@@ -1,12 +1,34 @@ | ||
import { Link } from 'react-router-dom'; | ||
import styled from 'styled-components'; | ||
|
||
export const HeaderContainer = styled.div` | ||
max-width: 1440px; | ||
display: flex; | ||
justify-content: space-between; | ||
justify-content: center; | ||
align-items: center; | ||
padding: 10px; | ||
padding: 0 18px; | ||
margin: 0 auto; | ||
background-color: var('--black-color'); | ||
@media screen and (min-width: 768px) { | ||
padding: 0 32px; | ||
} | ||
@media screen and (min-width: 1439px) { | ||
padding: 0 96px; | ||
} | ||
`; | ||
|
||
export const LogoLink = styled(Link)` | ||
margin-right: auto; | ||
`; | ||
|
||
export const UserContainer = styled.div` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
margin: 0; | ||
padding: 0; | ||
background-color: black; | ||
`; |
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