add search route

This commit is contained in:
Timothy Z. 2026-04-28 23:32:05 +03:00
parent 0b601010e2
commit a9ff0f6365

View file

@ -3,7 +3,7 @@
import { useEffect } from 'react';
import { useGamepad } from '../GamepadContext';
const ROUTES = ['board', 'discover', 'library', 'calendar', 'addons', 'settings'];
const ROUTES = ['search', 'board', 'discover', 'library', 'calendar', 'addons', 'settings'];
const useVerticalGamepadNavigation = (_sectionRef: React.RefObject<HTMLDivElement>, currentRoute: string) => {
const gamepad = useGamepad();
@ -18,7 +18,7 @@ const useVerticalGamepadNavigation = (_sectionRef: React.RefObject<HTMLDivElemen
if (direction === 'prev') nextIndex = Math.max(currentIndex - 1, 0);
if (nextIndex !== currentIndex) {
document.dispatchEvent(new KeyboardEvent('keydown', { key: String(nextIndex + 1), code: `Digit${nextIndex + 1}`, bubbles: true }));
document.dispatchEvent(new KeyboardEvent('keydown', { key: String(nextIndex), code: `Digit${nextIndex}`, bubbles: true }));
}
};