feat: nak req
This commit is contained in:
parent
ac196cd662
commit
a6d6a19199
9 changed files with 388 additions and 25 deletions
|
|
@ -81,6 +81,21 @@ export function PageManager({ maxStackSize = 5 }: { maxStackSize?: number }) {
|
|||
const { enableSingleColumnLayout } = useUserPreferences()
|
||||
const ignorePopStateRef = useRef(false)
|
||||
|
||||
useEffect(() => {
|
||||
if (isSmallScreen) return
|
||||
|
||||
const handleKeyDown = (e: KeyboardEvent) => {
|
||||
if ((e.metaKey || e.ctrlKey) && e.key === 'k') {
|
||||
e.preventDefault()
|
||||
navigatePrimaryPage('search')
|
||||
}
|
||||
}
|
||||
window.addEventListener('keydown', handleKeyDown)
|
||||
return () => {
|
||||
window.removeEventListener('keydown', handleKeyDown)
|
||||
}
|
||||
}, [isSmallScreen])
|
||||
|
||||
useEffect(() => {
|
||||
if (['/npub1', '/nprofile1'].some((prefix) => window.location.pathname.startsWith(prefix))) {
|
||||
window.history.replaceState(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue