Merge branch 'feat/v2-main' into feat/v2-main-docusaurus-netlify-monorepo
This commit is contained in:
commit
de412f2eef
61 files changed
+1980
-629
No files matched your search
@@ -3,18 +3,18 @@ import PropTypes from 'prop-types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import classNames from 'classnames';
|
||||
// TODO: This may fail if package is split from PWA build
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { NavBar, Svg, Icon, IconButton, Dropdown } from '@ohif/ui';
|
||||
|
||||
function Header({ children, menuOptions, isReturnEnabled, isSticky, WhiteLabeling }) {
|
||||
const { t } = useTranslation('Header');
|
||||
const history = useHistory();
|
||||
const navigate = useNavigate();
|
||||
|
||||
// TODO: this should be passed in as a prop instead and the react-router-dom
|
||||
// dependency should be dropped
|
||||
const onReturnHandler = () => {
|
||||
if (isReturnEnabled) {
|
||||
history.push('/');
|
||||
navigate('/');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
//import { hotkeys } from '@ohif/core';
|
||||
import { hotkeys } from '@ohif/core';
|
||||
import Input from '../Input';
|
||||
|
||||
//import { getKeys, formatKeysForInput } from './utils';
|
||||
import { formatKeysForInput } from './utils';
|
||||
import { getKeys, formatKeysForInput } from './utils';
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* HotkeyField
|
||||
@@ -25,16 +27,16 @@ const HotkeyField = ({ disabled, keys, onChange, className, modifierKeys }) => {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
||||
/*hotkeys.record(sequence => {
|
||||
hotkeys.record(sequence => {
|
||||
const keys = getKeys({ sequence, modifierKeys });
|
||||
hotkeys.unpause();
|
||||
onChange(keys);
|
||||
});*/
|
||||
});
|
||||
};
|
||||
|
||||
const onFocus = () => {
|
||||
/*hotkeys.pause();
|
||||
hotkeys.startRecording();*/
|
||||
hotkeys.pause();
|
||||
hotkeys.startRecording();
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -35,9 +35,10 @@ const HotkeysPreferences = ({ disabled, hotkeyDefinitions, errors: controlledErr
|
||||
|
||||
setErrors(prevState => {
|
||||
const errors = { ...prevState, [id]: error };
|
||||
onChange(id, definition, errors);
|
||||
return errors;
|
||||
});
|
||||
|
||||
onChange(id, definition, { ...errors, [id]: error });
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -84,7 +85,7 @@ const HotkeysPreferences = ({ disabled, hotkeyDefinitions, errors: controlledErr
|
||||
onChange={onChangeHandler}
|
||||
className='text-lg h-8'
|
||||
/>
|
||||
{error && <span className='p-2 text-red-600 text-sm'>{error}</span>}
|
||||
{error && <span className='p-2 text-left text-red-600 text-sm'>{error}</span>}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user