import React from 'react' import { Trans, WithTranslation, withTranslation } from 'react-i18next'; import Modal from './Modal' type ModalShortcutsInternalProps = { isOpen: boolean onOpenToggle(...args: unknown[]): unknown } & WithTranslation; class ModalShortcutsInternal extends React.Component { render() { const t = this.props.t; const help = [ { key: ?, text: t("Shortcuts menu") }, { key: o, text: t("Open modal") }, { key: e, text: t("Export modal") }, { key: d, text: t("Data Sources modal") }, { key: s, text: t("Style Settings modal") }, { key: i, text: t("Toggle inspect") }, { key: m, text: t("Focus map") }, { key: !, text: t("Debug modal") }, ] const mapShortcuts = [ { key: +, text: t("Increase the zoom level by 1.",) }, { key: <>Shift + +, text: t("Increase the zoom level by 2.",) }, { key: -, text: t("Decrease the zoom level by 1.",) }, { key: <>Shift + -, text: t("Decrease the zoom level by 2.",) }, { key: Up, text: t("Pan up by 100 pixels.",) }, { key: Down, text: t("Pan down by 100 pixels.",) }, { key: Left, text: t("Pan left by 100 pixels.",) }, { key: Right, text: t("Pan right by 100 pixels.",) }, { key: <>Shift + Right, text: t("Increase the rotation by 15 degrees.",) }, { key: <>Shift + Left, text: t("Decrease the rotation by 15 degrees.") }, { key: <>Shift + Up, text: t("Increase the pitch by 10 degrees.") }, { key: <>Shift + Down, text: t("Decrease the pitch by 10 degrees.") }, ] return

Press ESC to lose focus of any active elements, then press one of:

{help.map((item, idx) => { return
{item.key}
{item.text}
})}

{t("If the Map is in focused you can use the following shortcuts")}

    {mapShortcuts.map((item, idx) => { return
  • {item.key} {item.text}
  • })}
} } const ModalShortcuts = withTranslation()(ModalShortcutsInternal); export default ModalShortcuts;