Skip to content

Commit

Permalink
chore: updating open state names for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
zstix committed Apr 27, 2020
1 parent 6d7253b commit dd6346d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/components/HamburgerMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import cx from 'classnames';

import './HamburgerMenu.scss';

const HamburgerMenu = ({ toggle, open }) => (
const HamburgerMenu = ({ toggle, isOpen }) => (
<button
aria-expanded={open}
aria-label="Mobile Menu"
type="button"
className={cx('HamburgerMenu', { HamburgerMenu__open: open })}
className={cx('HamburgerMenu', { HamburgerMenu__open: isOpen })}
onClick={() => toggle()}
>
<div />
Expand All @@ -20,11 +20,11 @@ const HamburgerMenu = ({ toggle, open }) => (

HamburgerMenu.propTypes = {
toggle: PropTypes.func.isRequired,
open: PropTypes.bool,
isOpen: PropTypes.bool,
};

HamburgerMenu.defaultProps = {
open: false,
isOpen: false,
};

export default HamburgerMenu;
6 changes: 3 additions & 3 deletions src/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import HamburgerMenu from './HamburgerMenu';
import './Header.scss';

const Header = ({ pages }) => {
const [menuOpen, setMenuOpen] = useState(false);
const [isOpen, setIsOpen] = useState(false);

// NOTE: we may want to abstract this
const data = useStaticQuery(graphql`
Expand All @@ -34,7 +34,7 @@ const Header = ({ pages }) => {

return (
<header
className={cx('Header--main', { 'Header--main__menuOpen': menuOpen })}
className={cx('Header--main', { 'Header--main__menuOpen': isOpen })}
>
<Container>
<nav
Expand Down Expand Up @@ -72,7 +72,7 @@ const Header = ({ pages }) => {
<Link to="/">{'</>'} New Relic Developers</Link>
</h1>

<HamburgerMenu toggle={() => setMenuOpen(!menuOpen)} open={menuOpen} />
<HamburgerMenu toggle={() => setIsOpen(!isOpen)} isOpen={isOpen} />

<nav role="navigation" aria-label="Main" className="Header-nav--main">
<h3 className="u-hideOnDesktop">Developers</h3>
Expand Down

0 comments on commit dd6346d

Please sign in to comment.