Fixed NPM/Yarn mixup and ran linter, updated AllShortcutsModal shortcut
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import { Menu } from '@headlessui/react'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
import { useHotkeys } from 'react-hotkeys-hook'
|
||||
import { makeStyles } from '@material-ui/core/styles'
|
||||
import Dialog from '@material-ui/core/Dialog'
|
||||
import { editorMenuConfig } from './menuConfig';
|
||||
import { editorMenuConfig } from './menuConfig'
|
||||
import { useIdeContext } from 'src/helpers/hooks/useIdeContext'
|
||||
|
||||
const SHORTCUT = 'ctrl+/, command+/'
|
||||
const SHORTCUT = 'ctrl+shift+/'
|
||||
|
||||
const useStyles = makeStyles({
|
||||
root: {
|
||||
@@ -15,30 +15,41 @@ const useStyles = makeStyles({
|
||||
})
|
||||
|
||||
const AllShortcutsModal = () => {
|
||||
const classes = useStyles()
|
||||
const [open, setOpen] = useState(false)
|
||||
useHotkeys(SHORTCUT, () => setOpen(!open), [open])
|
||||
const classes = useStyles()
|
||||
const [open, setOpen] = useState(false)
|
||||
useHotkeys(SHORTCUT, () => setOpen(!open), [open])
|
||||
|
||||
return (<>
|
||||
<Dialog open={open} onClose={() => setOpen(false)} className={classes.root}>
|
||||
return (
|
||||
<>
|
||||
<Dialog
|
||||
open={open}
|
||||
onClose={() => setOpen(false)}
|
||||
className={classes.root}
|
||||
>
|
||||
<div className="bg-ch-gray-700 font-fira-sans max-w-7xl rounded shadow-lg text-ch-gray-300 p-4">
|
||||
<h2 className="text-2xl mb-4">All Shortcuts</h2>
|
||||
{ editorMenuConfig.filter(menu => menu.items.length).map(menu =>
|
||||
<section key={"allshortcuts-"+menu.name}
|
||||
className="my-6">
|
||||
<h3 className="text-xl border-b-2 pb-2 mb-2">{ menu.label }</h3>
|
||||
{ menu.items.map(item => (
|
||||
<div className="flex gap-8 justify-between" key={"allshortcuts-"+menu.name+"-"+item.label}>
|
||||
<p>{ item.label }</p>
|
||||
<span className="text-right font-fira-code text-ch-gray-400">{ item.shortcutLabel }</span>
|
||||
</div>
|
||||
<h2 className="text-2xl mb-4">All Shortcuts</h2>
|
||||
{editorMenuConfig
|
||||
.filter((menu) => menu.items.length)
|
||||
.map((menu) => (
|
||||
<section key={'allshortcuts-' + menu.name} className="my-6">
|
||||
<h3 className="text-xl border-b-2 pb-2 mb-2">{menu.label}</h3>
|
||||
{menu.items.map((item) => (
|
||||
<div
|
||||
className="flex gap-8 justify-between"
|
||||
key={'allshortcuts-' + menu.name + '-' + item.label}
|
||||
>
|
||||
<p>{item.label}</p>
|
||||
<span className="text-right font-fira-code text-ch-gray-400">
|
||||
{item.shortcutLabel}
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
</section>
|
||||
))}
|
||||
</section>
|
||||
)}
|
||||
</div>
|
||||
</Dialog>
|
||||
</>)
|
||||
}
|
||||
</Dialog>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
export default AllShortcutsModal
|
||||
export default AllShortcutsModal
|
||||
|
||||
Reference in New Issue
Block a user