Skip to content

Commit

Permalink
mobile header functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
samgildea committed Mar 26, 2021
1 parent 08e9d0f commit c61da5e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/components/header/header.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from "react"
import React, { useState } from "react"
import styled from "styled-components"
import dimensions from "../../style/dimensions"
import Hamburger from "../../vectors/hamburger.svg"

const NavContainer = styled.div``

const Logo = styled.div`
Expand All @@ -13,7 +14,6 @@ const Logo = styled.div`
text-align: center;
font-size: 20px;
padding-top: 24px;
}
`

Expand All @@ -35,24 +35,25 @@ const NavLink = styled.div`
`

const MobileIcon = styled.div`
@media (min-width: ${dimensions.maxwidthTablet}px) {
@media (min-width: ${dimensions.maxwidthTablet}px) {
display: none;
}
@media (max-width: ${dimensions.maxwidthTablet}px) {
left: 24px;
top: 32px;
position: absolute;
}
`

export default function header() {
export const Header = () => {
const [open, setOpen] = useState(false)

return (
<NavContainer>
<Logo>PowerHouse</Logo>

<MobileIcon>
<MobileIcon onClick={() => setOpen(!open)} className={open ? "open" : ""}>
<Hamburger />
</MobileIcon>
<NavLinks>
Expand All @@ -64,3 +65,4 @@ export default function header() {
</NavContainer>
)
}
export default Header

0 comments on commit c61da5e

Please sign in to comment.