mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-02-20 07:37:26 -05:00
* Implemented duplicating current tab
* prettier fixes
* Disable non-functional "New window" menu shortcut
This was preventing "Duplicate current tab" from firing
* use proper casing in RedirectPath type name
* Revert locale changes from "Implemented duplicating current tab"
This partially reverts commit a822f54569.
There were unrelated changes to locale files that should be scoped to their own PR.
* SImplify new location definition
* Remove accidentally committed change lol
* Use cmd-shift-t for duplicate same tab
* Remove navToSettings shortcut
* remove references to now-missing navToSettings keybind
---------
Co-authored-by: lynx <141365347+iLynxcat@users.noreply.github.com>
19 lines
465 B
TypeScript
19 lines
465 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(redirect?: { pathname: string; search: string | undefined }): void;
|
|
removeTab(index: number): void;
|
|
duplicateTab(): void;
|
|
} | null>(null);
|
|
|
|
export function useTabsContext() {
|
|
const ctx = useContext(TabsContext);
|
|
|
|
return ctx;
|
|
}
|