Better hotkey organization

This commit is contained in:
Deluan
2021-02-03 18:29:33 -05:00
parent 22145e070f
commit a168f46b95
5 changed files with 29 additions and 23 deletions
+1 -1
View File
@@ -3,6 +3,7 @@ import { useLocation } from 'react-router-dom'
import { useGetOne } from 'react-admin'
import { GlobalHotKeys } from 'react-hotkeys'
import { StarButton, useToggleStar } from '../common'
import { keyMap } from '../hotkeys'
const Placeholder = () => <StarButton disabled={true} resource={'song'} />
@@ -12,7 +13,6 @@ const Toolbar = ({ id }) => {
const { data, loading } = useGetOne(resource, id)
const [toggleStar, toggling] = useToggleStar(resource, data)
const keyMap = { TOGGLE_STAR: 's' }
const handlers = {
TOGGLE_STAR: useCallback(() => toggleStar(), [toggleStar]),
}