import { Button, Modal, Row, Col } from 'react-bootstrap' import PropTypes from 'prop-types' import { Trans, useTranslation } from 'react-i18next' import AccessibleModal from '../../../shared/components/accessible-modal' import HotkeysModalBottomText from './hotkeys-modal-bottom-text' export default function HotkeysModal({ animation = true, handleHide, show, isMac = false, trackChangesVisible = false, newSourceEditor = false, }) { const { t } = useTranslation() const goToLineSuffix = newSourceEditor ? 'Shift + L' : 'L' const ctrl = isMac ? 'Cmd' : 'Ctrl' const modalTitle = newSourceEditor ? `${t('hotkeys')} (Source editor)` : `${t('hotkeys')} (Legacy source editor)` return ( {modalTitle}

{t('common')}

{t('navigation')}

{t('editing')}

{t('autocomplete')}

}} />

{trackChangesVisible && ( <>

{t('review')}

)}
) } HotkeysModal.propTypes = { animation: PropTypes.bool, isMac: PropTypes.bool, show: PropTypes.bool.isRequired, handleHide: PropTypes.func.isRequired, trackChangesVisible: PropTypes.bool, newSourceEditor: PropTypes.bool, } function Hotkey({ combination, description }) { return (
{combination} {description}
) } Hotkey.propTypes = { combination: PropTypes.string.isRequired, description: PropTypes.string.isRequired, }