mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-05-10 23:50:42 +00:00
refactor: code quality improvments
This commit is contained in:
parent
12f3138341
commit
4b6b0058fa
2 changed files with 6 additions and 4 deletions
|
|
@ -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'])}>
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue