Commit 2a2cc011 authored by Øyvind Julsrud's avatar Øyvind Julsrud Committed by Oyvind
Browse files

DEICH-5954: deichman.no: minor variable rename

parent 220128b5
......@@ -11,7 +11,7 @@ const CommandSearch = ({
onClickMenuItem,
isTypingCommandSearch
}) => {
const forwardSlash = useKeyPress("/");
const isForwardSlashPressed = useKeyPress("/");
const [isShowing, setIsShowing] = useState(isTypingCommandSearch);
const [searchList, setSearchList] = useState(commandSearch);
const [commandSearchText, setCommandSearchText] = useState("");
......@@ -36,7 +36,7 @@ const CommandSearch = ({
useEffect(
() => {
if (forwardSlash) {
if (isForwardSlashPressed) {
setIsShowing(true);
}
......@@ -50,7 +50,7 @@ const CommandSearch = ({
setIsShowing(false);
}
},
[forwardSlash, searchText, isTypingCommandSearch]
[isForwardSlashPressed, searchText, isTypingCommandSearch]
);
return (
......
......@@ -8,11 +8,11 @@ const CommandSearchListItem = ({
onClickMenuItem,
commandSearchText
}) => {
const enter = useKeyPress("Enter");
const isEnterPressed = useKeyPress("Enter");
const handleMenuItemOnClick = (value, commandSearchText, e) => {
return e => {
if (!e.key || enter) {
if (!e.key || isEnterPressed) {
onClickMenuItem(value, commandSearchText);
}
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment