Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkendis committed Jan 7, 2021
1 parent 76f7332 commit 17027c6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion client/components/GearButton/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const GearButton = ({
setPressed(!pressed);
onClick();
};

return (
<IconButton
className={button}
Expand Down
24 changes: 11 additions & 13 deletions client/components/LeftDrawer/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { useEffect } from 'react';
import PropTypes from 'proptypes';
import { makeStyles, useTheme } from '@material-ui/core/styles';
import Drawer from '@material-ui/core/Drawer';
Expand Down Expand Up @@ -90,20 +90,18 @@ const PersistentDrawerLeft = ({ menuIsOpen, toggleMenu }) => {
// TODO ADD FUNCTIONALITY
};

const escFunction = e => {
e.preventDefault();
if (e.key === 'Escape'
) {
toggleMenu();
}
};
useEffect(() => {
const escFunction = e => {
e.preventDefault();
if (e.key === 'Escape') {
toggleMenu();
}
};

React.useEffect(() => {
document.addEventListener('keypress', escFunction, false);
return () => {
document.removeEventListener('keypress', escFunction, false);
};
}, [escFunction]);

return () => document.removeEventListener('keypress', escFunction, false);
}, [toggleMenu]);

return (
<div className={classes.root}>
Expand Down

0 comments on commit 17027c6

Please sign in to comment.