fix keyboard, finish 05
This commit is contained in:
@@ -1,21 +1,17 @@
|
||||
import type { JSX } from "solid-js"
|
||||
import { useKeyboardShortcuts } from "../hooks/useKeyboardShortcuts"
|
||||
import type { TabId } from "./Tab"
|
||||
|
||||
/**
|
||||
* @deprecated Use useAppKeyboard hook directly instead.
|
||||
* This component is kept for backwards compatibility.
|
||||
*/
|
||||
type KeyboardHandlerProps = {
|
||||
children?: JSX.Element
|
||||
onTabSelect: (tab: TabId) => void
|
||||
onTabSelect?: (tab: TabId) => void
|
||||
}
|
||||
|
||||
export function KeyboardHandler(props: KeyboardHandlerProps) {
|
||||
useKeyboardShortcuts({
|
||||
onTabNext: () => {
|
||||
props.onTabSelect("discover")
|
||||
},
|
||||
onTabPrev: () => {
|
||||
props.onTabSelect("settings")
|
||||
},
|
||||
})
|
||||
|
||||
// Keyboard handling has been moved to useAppKeyboard hook
|
||||
// This component is now just a passthrough
|
||||
return <>{props.children}</>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user