Files
spacedrive/interface/TabsContext.tsx
Madion Konig 928c406887 Add "Duplicate current tab" keybind (#2679)
* 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>
2024-08-28 18:11:46 +00:00

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;
}