diff --git a/src/App.tsx b/src/App.tsx index cff5e81..8d5b1b2 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -86,7 +86,7 @@ export function App() { const isInverting = keybind.isInverting(keyEvent); // only handling top navigation here, cycle through tabs, just to high priority(player) all else to be handled in each tab - if (nav.activeDepth == 0) { + if (nav.activeDepth() == 0) { if ( (isCycle && !isInverting) || (isDown && !isInverting) || @@ -103,11 +103,24 @@ export function App() { nav.prevTab(); return; } - if ((isRight && !isInverting) || (isLeft && isInverting)) { + if ( + (isDive && !isInverting) || + (isOut && isInverting) || + (isRight && !isInverting) || + (isLeft && isInverting) + ) { nav.setActiveDepth(1); } } - if (nav.activeDepth == 1) { + if (nav.activeDepth() == 1) { + if ( + (isDive && isInverting) || + (isOut && !isInverting) || + (isRight && isInverting) || + (isLeft && !isInverting) + ) { + nav.setActiveDepth(0); + } } }, { release: false }, @@ -166,7 +179,7 @@ export function App() { )} - {LayerGraph[nav.activeTab]()} + {LayerGraph[nav.activeTab()]()} diff --git a/src/components/TabNavigation.tsx b/src/components/TabNavigation.tsx index 7244b3b..d531c20 100644 --- a/src/components/TabNavigation.tsx +++ b/src/components/TabNavigation.tsx @@ -19,7 +19,7 @@ export function TabNavigation() { return ( tab.id == activeTab} + selected={() => tab.id == activeTab()} onMouseDown={() => setActiveTab(tab.id)} > tab.id == activeTab} + selected={() => tab.id == activeTab()} primary alignSelf="center" > diff --git a/src/context/NavigationContext.tsx b/src/context/NavigationContext.tsx index 296d204..bfc9e7e 100644 --- a/src/context/NavigationContext.tsx +++ b/src/context/NavigationContext.tsx @@ -29,15 +29,9 @@ export const { use: useNavigation, provider: NavigationProvider } = }; return { - get activeTab() { - return activeTab(); - }, - get activeDepth() { - return activeDepth(); - }, - get inputFocused() { - return inputFocused(); - }, + activeTab, + activeDepth, + inputFocused, setActiveTab, setActiveDepth, setInputFocused, diff --git a/src/pages/Feed/FeedPage.tsx b/src/pages/Feed/FeedPage.tsx index 98c2b76..9fb9ce4 100644 --- a/src/pages/Feed/FeedPage.tsx +++ b/src/pages/Feed/FeedPage.tsx @@ -19,7 +19,6 @@ enum FeedPaneType { } export const FeedPaneCount = 1; -/** Episodes to load per batch */ const ITEMS_PER_BATCH = 50; export function FeedPage() { @@ -64,6 +63,10 @@ export function FeedPage() { return ( } > - + {([date, items]) => ( @@ -90,8 +96,8 @@ export function FeedPage() { {(item) => { const isSelected = () => { if ( - nav.activeTab == TABS.FEED && - nav.activeDepth == FeedPaneType.FEED && + nav.activeTab() == TABS.FEED && + nav.activeDepth() == FeedPaneType.FEED && selectedEpisodeID() && selectedEpisodeID() === item.episode.id ) {