mirror of
https://github.com/linsa-io/linsa.git
synced 2026-04-27 02:38:45 +02:00
fix(link): Navigate between item and fix Enter keybind (#165)
* feat: add item scroll to active * fix: reset enterkey and scroll to view * fix: link item displayName
This commit is contained in:
@@ -8,11 +8,12 @@ import { parseAsBoolean, useQueryState } from "nuqs"
|
||||
import { atom, useAtom } from "jotai"
|
||||
import { LinkBottomBar } from "./bottom-bar"
|
||||
import { commandPaletteOpenAtom } from "@/components/custom/command-palette/command-palette"
|
||||
import { useKey } from "react-use"
|
||||
|
||||
export const isDeleteConfirmShownAtom = atom(false)
|
||||
|
||||
export function LinkRoute(): React.ReactElement {
|
||||
const [nuqsEditId] = useQueryState("editId")
|
||||
const [nuqsEditId, setNuqsEditId] = useQueryState("editId")
|
||||
const [activeItemIndex, setActiveItemIndex] = useState<number | null>(null)
|
||||
const [isInCreateMode] = useQueryState("create", parseAsBoolean)
|
||||
const [isCommandPaletteOpen] = useAtom(commandPaletteOpenAtom)
|
||||
@@ -50,6 +51,11 @@ export function LinkRoute(): React.ReactElement {
|
||||
}
|
||||
}, [isDeleteConfirmShown, isCommandPaletteOpen, isInCreateMode, handleCommandPaletteClose])
|
||||
|
||||
useKey("Escape", () => {
|
||||
setDisableEnterKey(false)
|
||||
setNuqsEditId(null)
|
||||
})
|
||||
|
||||
return (
|
||||
<>
|
||||
<LinkHeader />
|
||||
|
||||
Reference in New Issue
Block a user