mirror of
https://github.com/spacedriveapp/spacedrive
synced 2024-07-19 11:19:11 +00:00
0ef65fce2d
* tabs w/ multiple router instances * fix router switching * keybinds * manual history tracking * eslint * remove scroll restoration * fix tab removal * route title + tab create delay * typescript * put tab list up top * Remove import + show close button only if tabs length more than 1 * lint * unify blur across whole top bar * add to keybindings page, tauri drag region, and tooltip * fix blur * more drag regions * merge moment --------- Co-authored-by: ameer2468 <33054370+ameer2468@users.noreply.github.com>
18 lines
383 B
TypeScript
18 lines
383 B
TypeScript
import { createContext, useContext } from 'react';
|
|
|
|
import { Router } from './';
|
|
|
|
export const TabsContext = createContext<{
|
|
tabIndex: number;
|
|
setTabIndex: (i: number) => void;
|
|
tabs: { router: Router; title: string }[];
|
|
createTab(): void;
|
|
removeTab(index: number): void;
|
|
} | null>(null);
|
|
|
|
export function useTabsContext() {
|
|
const ctx = useContext(TabsContext);
|
|
|
|
return ctx;
|
|
}
|