fixes for hotkeys usage in docusaurus

This commit is contained in:
Erik Ziegler committed 2021-07-21 12:58:15 +02:00
1 parent 7a9f113b91
commit ff28a2264b
24 files changed
+61 -659

No files matched your search

@@ -2,7 +2,6 @@ import React, { useEffect } from 'react';
import PropTypes from 'prop-types';
import Input from '../Input';
import { hotkeys } from '../../utils/'
import { getKeys, formatKeysForInput } from './utils';
/**
@@ -16,7 +15,7 @@ import { getKeys, formatKeysForInput } from './utils';
* @param {string} props.className input classes
* @param {Array[]} props.modifierKeys
*/
const HotkeyField = ({ disabled, keys, onChange, className, modifierKeys }) => {
const HotkeyField = ({ disabled, keys, onChange, className, modifierKeys, hotkeys }) => {
const inputValue = formatKeysForInput(keys);
useEffect(() => {
@@ -57,6 +56,13 @@ HotkeyField.propTypes = {
className: PropTypes.string,
modifierKeys: PropTypes.array,
disabled: PropTypes.bool,
hotkeys: PropTypes.object({
initialize: PropTypes.func.isRequired,
pause: PropTypes.func.isRequired,
unpause: PropTypes.func.isRequired,
startRecording: PropTypes.func.isRequired,
record: PropTypes.func.isRequired,
}).isRequired
};
HotkeyField.defaultProps = {