mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): tidy hotkeysmodal state
This commit is contained in:
parent
bbca053b48
commit
ac04a834ef
@ -41,11 +41,7 @@ type HotkeysModalProps = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const HotkeysModal = ({ children }: HotkeysModalProps) => {
|
const HotkeysModal = ({ children }: HotkeysModalProps) => {
|
||||||
const {
|
const { isOpen, onOpen, onClose } = useDisclosure();
|
||||||
isOpen: isHotkeyModalOpen,
|
|
||||||
onOpen: onHotkeysModalOpen,
|
|
||||||
onClose: onHotkeysModalClose,
|
|
||||||
} = useDisclosure();
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [hotkeyFilter, setHotkeyFilter] = useState('');
|
const [hotkeyFilter, setHotkeyFilter] = useState('');
|
||||||
const clearHotkeyFilter = useCallback(() => setHotkeyFilter(''), []);
|
const clearHotkeyFilter = useCallback(() => setHotkeyFilter(''), []);
|
||||||
@ -88,14 +84,9 @@ const HotkeysModal = ({ children }: HotkeysModalProps) => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{cloneElement(children, {
|
{cloneElement(children, {
|
||||||
onClick: onHotkeysModalOpen,
|
onClick: onOpen,
|
||||||
})}
|
})}
|
||||||
<InvModal
|
<InvModal isOpen={isOpen} onClose={onClose} isCentered size="2xl">
|
||||||
isOpen={isHotkeyModalOpen}
|
|
||||||
onClose={onHotkeysModalClose}
|
|
||||||
isCentered
|
|
||||||
size="2xl"
|
|
||||||
>
|
|
||||||
<InvModalOverlay />
|
<InvModalOverlay />
|
||||||
<InvModalContent maxH="80vh" h="80vh">
|
<InvModalContent maxH="80vh" h="80vh">
|
||||||
<InvModalHeader>{t('hotkeys.keyboardShortcuts')}</InvModalHeader>
|
<InvModalHeader>{t('hotkeys.keyboardShortcuts')}</InvModalHeader>
|
||||||
|
Loading…
Reference in New Issue
Block a user