Skip to content

Commit c7e0de4

Browse files
Uzhastin-Nikitathe-homeless-god
authored andcommitted
feat: relocate HamburgerMenu atom from WEB
1 parent eee03b6 commit c7e0de4

File tree

4 files changed

+81
-0
lines changed

4 files changed

+81
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
@import 'src/scss/mixins';
2+
3+
.hamburger-menu {
4+
height: 25px;
5+
width: 25px;
6+
cursor: pointer;
7+
position: relative;
8+
z-index: 2;
9+
display: flex;
10+
flex-wrap: wrap;
11+
align-items: stretch;
12+
13+
&:hover {
14+
color: $color-light;
15+
}
16+
}
17+
18+
.line {
19+
position: absolute;
20+
top: 50%;
21+
width: 100%;
22+
height: 5px;
23+
background-color: $color-base;
24+
25+
&:nth-of-type(2) {
26+
top: calc(44% - 6px);
27+
}
28+
29+
&:nth-of-type(3) {
30+
top: calc(63% + 5px);
31+
}
32+
}
33+
34+
.transition {
35+
@include devices {
36+
.line {
37+
transition: all 1s;
38+
39+
&:nth-of-type(1) {
40+
top: 50%;
41+
transform: rotate(45deg);
42+
}
43+
44+
&:nth-of-type(2) {
45+
display: none;
46+
}
47+
48+
&:nth-of-type(3) {
49+
top: 50%;
50+
transform: rotate(-45deg);
51+
}
52+
}
53+
}
54+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import React from 'react'
2+
3+
import cx from 'classnames'
4+
5+
import css from './HamburgerMenu.styles.module.scss'
6+
7+
export type HamburgerMenuProps = {
8+
isHamburger: boolean
9+
className?: string
10+
onClick: () => void
11+
}
12+
13+
export const HamburgerMenu = ({ className, onClick, isHamburger }: HamburgerMenuProps) => {
14+
return (
15+
<div
16+
onClick={onClick}
17+
className={cx(css.hamburgerMenu, className, {
18+
[css.transition]: isHamburger
19+
})}
20+
>
21+
<div className={css.line} />
22+
<div className={css.line} />
23+
<div className={css.line} />
24+
</div>
25+
)
26+
}

src/components/atoms/HamburgerMenu/HamburgerMenu.utils.ts

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './HamburgerMenu'

0 commit comments

Comments
 (0)