refactor: code quality improvments

This commit is contained in:
Timothy Z. 2026-04-29 13:20:14 +03:00
parent 12f3138341
commit 4b6b0058fa
2 changed files with 6 additions and 4 deletions

View file

@ -26,8 +26,8 @@ const MainNavBars = memo(({ className, route, query, children }: Props) => {
const navRef = React.useRef(null);
const contentRef = React.useRef(null);
useContentGamepadNavigation(contentRef, route || '');
useVerticalNavGamepadNavigation(navRef, route || '');
useContentGamepadNavigation(contentRef, route ?? 'board');
useVerticalNavGamepadNavigation(navRef, route ?? 'board');
return (
<div className={classnames(className, styles['main-nav-bars-container'])}>

View file

@ -7,11 +7,13 @@ import GamepadContext from './GamepadContext';
type GamepadEventHandlers = Map<string, Map<string, (data?: any) => void>>;
const GamepadProvider: React.FC<{
type GamepadProviderProps = {
enabled: boolean;
onGuide?: () => void;
children: React.ReactNode;
}> = ({ enabled, onGuide, children }) => {
};
const GamepadProvider = ({ enabled, onGuide, children }: GamepadProviderProps) => {
const { t } = useTranslation();
const toast = useToast();
const connectedGamepads = useRef<number>(0);