feat: stream list view and tasks (#279)
* first attempt at stream sidebar, tasks, and events * fix folder from root * cleanup folders and events, and condense changes * cleanup and add toggle for sidebar * cleanup * fix nits
This commit was merged in pull request #279.
This commit is contained in:
@@ -11,6 +11,7 @@ interface UseStreamNavigationKeysOptions {
|
||||
childrenLength: number;
|
||||
mediaRef: RefObject<MediaParticleHandle | null>;
|
||||
onExit: () => void;
|
||||
onToggleViewMode: () => void;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -24,6 +25,7 @@ export function useStreamNavigationKeys({
|
||||
childrenLength,
|
||||
mediaRef,
|
||||
onExit,
|
||||
onToggleViewMode,
|
||||
}: UseStreamNavigationKeysOptions) {
|
||||
useEffect(() => {
|
||||
const onKeyDown = (e: KeyboardEvent) => {
|
||||
@@ -54,10 +56,25 @@ export function useStreamNavigationKeys({
|
||||
e.preventDefault();
|
||||
onExit();
|
||||
break;
|
||||
case 'l':
|
||||
case 'L':
|
||||
// Registered here (not in action keys) because the toggle must work
|
||||
// in list mode, where playback is suspended and action keys bail.
|
||||
e.preventDefault();
|
||||
onToggleViewMode();
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
window.addEventListener('keydown', onKeyDown);
|
||||
return () => window.removeEventListener('keydown', onKeyDown);
|
||||
}, [next, prev, currentIndex, childrenLength, mediaRef, onExit]);
|
||||
}, [
|
||||
next,
|
||||
prev,
|
||||
currentIndex,
|
||||
childrenLength,
|
||||
mediaRef,
|
||||
onExit,
|
||||
onToggleViewMode,
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user