mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-25 09:18:51 +01:00
Replace onClick with onClose
This commit is contained in:
parent
bee32cc781
commit
dfe727b702
1 changed files with 2 additions and 16 deletions
|
@ -30,24 +30,10 @@ export default memo(function KeyboardShortcutsHelp() {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
const escRef = useHotkeys('esc', onClose, []);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
!!snapStates.showKeyboardShortcutsHelp && (
|
!!snapStates.showKeyboardShortcutsHelp && (
|
||||||
<Modal
|
<Modal class="light" onClose={onClose}>
|
||||||
class="light"
|
<div id="keyboard-shortcuts-help-container" class="sheet" tabindex="-1">
|
||||||
onClick={(e) => {
|
|
||||||
if (e.target === e.currentTarget) {
|
|
||||||
onClose();
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
id="keyboard-shortcuts-help-container"
|
|
||||||
class="sheet"
|
|
||||||
tabindex="-1"
|
|
||||||
ref={escRef}
|
|
||||||
>
|
|
||||||
<button type="button" class="sheet-close" onClick={onClose}>
|
<button type="button" class="sheet-close" onClick={onClose}>
|
||||||
<Icon icon="x" />
|
<Icon icon="x" />
|
||||||
</button>
|
</button>
|
||||||
|
|
Loading…
Reference in a new issue