mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
working typescript compiling and fixing linting issues
This commit is contained in:
1 parent
b1babd88c2
commit
3273d192c9
49 files changed
+271
-110
No files matched your search
@@ -2,7 +2,7 @@ import React, { useEffect } from "react";
|
||||
import { makeStyles } from "@material-ui/core/styles";
|
||||
import { Paper } from "@material-ui/core";
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
const useStyles = makeStyles(() => ({
|
||||
root: {
|
||||
zIndex: 10,
|
||||
background: "#424242",
|
||||
@@ -31,16 +31,16 @@ export const Modal = ({ children, visible, handleClose }) => {
|
||||
|
||||
// when the user presses escape we should close the modal
|
||||
const _handleEscape = (e) => {
|
||||
const isEscapeKey = e.key == "Escape" || e.key == "Esc";
|
||||
const isEscapeKey = e.key === "Escape" || e.key === "Esc";
|
||||
if (isEscapeKey) {
|
||||
e.preventDefault();
|
||||
handleClose();
|
||||
}
|
||||
};
|
||||
useEffect(() => {
|
||||
const listener = window.addEventListener("keydown", _handleEscape, true);
|
||||
return () => window.removeEventListener("keydown", listener);
|
||||
}, []);
|
||||
window.addEventListener("keydown", _handleEscape, true);
|
||||
return () => window.removeEventListener("keydown", _handleEscape);
|
||||
});
|
||||
|
||||
const showHideClassName = visible
|
||||
? classes.displayBlock
|
||||
|
||||
Reference in new issue
Block a user