2022-10-24 16:33:13 -04:00
|
|
|
import { useState } from 'react'
|
|
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
import { useProjectContext } from '../../../shared/context/project-context'
|
|
|
|
import HotkeysModal from '../../hotkeys-modal/components/hotkeys-modal'
|
2022-11-24 09:26:38 -05:00
|
|
|
import useScopeValue from '../../../shared/hooks/use-scope-value'
|
2022-10-24 16:33:13 -04:00
|
|
|
import LeftMenuButton from './left-menu-button'
|
|
|
|
|
|
|
|
export default function HelpShowHotkeys() {
|
|
|
|
const [showModal, setShowModal] = useState(false)
|
2022-11-24 09:26:38 -05:00
|
|
|
const [newSourceEditor] = useScopeValue('editor.newSourceEditor')
|
2022-10-24 16:33:13 -04:00
|
|
|
const { t } = useTranslation()
|
|
|
|
const { features } = useProjectContext()
|
|
|
|
const isMac = /Mac/.test(window.navigator?.platform)
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<LeftMenuButton
|
|
|
|
onClick={() => setShowModal(true)}
|
|
|
|
icon={{
|
|
|
|
type: 'keyboard-o',
|
|
|
|
fw: true,
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{t('show_hotkeys')}
|
|
|
|
</LeftMenuButton>
|
|
|
|
<HotkeysModal
|
|
|
|
show={showModal}
|
|
|
|
handleHide={() => setShowModal(false)}
|
|
|
|
isMac={isMac}
|
|
|
|
trackChangesVisible={features?.trackChangesVisible}
|
2022-11-24 09:26:38 -05:00
|
|
|
newSourceEditor={newSourceEditor}
|
2022-10-24 16:33:13 -04:00
|
|
|
/>
|
|
|
|
</>
|
|
|
|
)
|
|
|
|
}
|