mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
a30e934692
GitOrigin-RevId: 7ebbfa693205de1f57b1d54e25c46cfb1851acc8
32 lines
922 B
TypeScript
32 lines
922 B
TypeScript
import { useState } from 'react'
|
|
import { useTranslation } from 'react-i18next'
|
|
import { useProjectContext } from '../../../shared/context/project-context'
|
|
import HotkeysModal from '../../hotkeys-modal/components/hotkeys-modal'
|
|
import LeftMenuButton from './left-menu-button'
|
|
|
|
export default function HelpShowHotkeys() {
|
|
const [showModal, setShowModal] = useState(false)
|
|
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}
|
|
/>
|
|
</>
|
|
)
|
|
}
|