-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MM-005: Add header with hamburger button
- Loading branch information
Showing
4 changed files
with
64 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.hamburger { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-around; | ||
width: 30px; | ||
height: 30px; | ||
background: transparent; | ||
border: none; | ||
cursor: pointer; | ||
} | ||
|
||
.line { | ||
width: 100%; | ||
height: 3px; | ||
background-color: black; | ||
transition: all 0.3s ease; | ||
} | ||
|
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,24 @@ | ||
import React from 'react'; | ||
import './Hamburgerbutton.scss'; // styling for the hmauburger button icon | ||
|
||
interface HamburgerProps { | ||
onClick: () => void; | ||
} | ||
|
||
const Hamburger: React.FC<HamburgerProps> = ({ onClick }) => { | ||
|
||
const handleClick = () => { | ||
onClick(); | ||
}; | ||
|
||
return ( | ||
<button onClick={handleClick} className="hamburger"> | ||
{/* draw the 3 lines which make up the hmburger */} | ||
<div className="line" /> | ||
<div className="line" /> | ||
<div className="line" /> | ||
</button> | ||
); | ||
}; | ||
|
||
export default Hamburger; |
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,16 @@ | ||
import React from 'react'; | ||
import Hamburger from './Hamburgerbutton'; | ||
|
||
const Header: React.FC = () => { | ||
const handleHamburgerClick = () => { | ||
console.log('Hamburger menu clicked!'); | ||
}; | ||
|
||
return ( | ||
<div className="App"> | ||
<Hamburger onClick={handleHamburgerClick} /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Header; |