Skip to content

Commit

Permalink
feat: relocate HamburgerMenu atom from WEB
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzhastin-Nikita authored and the-homeless-god committed May 26, 2022
1 parent eee03b6 commit c7e0de4
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
@import 'src/scss/mixins';

.hamburger-menu {
height: 25px;
width: 25px;
cursor: pointer;
position: relative;
z-index: 2;
display: flex;
flex-wrap: wrap;
align-items: stretch;

&:hover {
color: $color-light;
}
}

.line {
position: absolute;
top: 50%;
width: 100%;
height: 5px;
background-color: $color-base;

&:nth-of-type(2) {
top: calc(44% - 6px);
}

&:nth-of-type(3) {
top: calc(63% + 5px);
}
}

.transition {
@include devices {
.line {
transition: all 1s;

&:nth-of-type(1) {
top: 50%;
transform: rotate(45deg);
}

&:nth-of-type(2) {
display: none;
}

&:nth-of-type(3) {
top: 50%;
transform: rotate(-45deg);
}
}
}
}
26 changes: 26 additions & 0 deletions src/components/atoms/HamburgerMenu/HamburgerMenu.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from 'react'

import cx from 'classnames'

import css from './HamburgerMenu.styles.module.scss'

export type HamburgerMenuProps = {
isHamburger: boolean
className?: string
onClick: () => void
}

export const HamburgerMenu = ({ className, onClick, isHamburger }: HamburgerMenuProps) => {
return (
<div
onClick={onClick}
className={cx(css.hamburgerMenu, className, {
[css.transition]: isHamburger
})}
>
<div className={css.line} />
<div className={css.line} />
<div className={css.line} />
</div>
)
}
Empty file.
1 change: 1 addition & 0 deletions src/components/atoms/HamburgerMenu/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './HamburgerMenu'

0 comments on commit c7e0de4

Please sign in to comment.