mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-19 17:01:13 +00:00
Move tabs manager to zustand (#915)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import React from "react";
|
||||
import * as DataModels from "../../../Contracts/DataModels";
|
||||
import type { QueryTabOptions } from "../../../Contracts/ViewModels";
|
||||
import { useTabs } from "../../../hooks/useTabs";
|
||||
import Explorer from "../../Explorer";
|
||||
import { IQueryTabComponentProps, ITabAccessor } from "../../Tabs/QueryTab/QueryTabComponent";
|
||||
import TabsBase from "../TabsBase";
|
||||
@@ -40,12 +41,12 @@ export class NewQueryTab extends TabsBase {
|
||||
}
|
||||
|
||||
public onTabClick(): void {
|
||||
this.manager?.activateTab(this);
|
||||
useTabs.getState().activateTab(this);
|
||||
this.iTabAccessor.onTabClickEvent();
|
||||
}
|
||||
|
||||
public onCloseTabButtonClick(): void {
|
||||
this.manager?.closeTab(this);
|
||||
useTabs.getState().closeTab(this);
|
||||
if (this.iTabAccessor) {
|
||||
this.iTabAccessor.onCloseClickEvent(true);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ import { EditorReact } from "../../Controls/Editor/EditorReact";
|
||||
import Explorer from "../../Explorer";
|
||||
import { useCommandBar } from "../../Menus/CommandBar/CommandBarComponentAdapter";
|
||||
import TabsBase from "../TabsBase";
|
||||
import { TabsManager } from "../TabsManager";
|
||||
import "./QueryTabComponent.less";
|
||||
|
||||
enum ToggleState {
|
||||
@@ -65,7 +64,6 @@ export interface IQueryTabComponentProps {
|
||||
partitionKey: DataModels.PartitionKey;
|
||||
container: Explorer;
|
||||
activeTab?: TabsBase;
|
||||
tabManager?: TabsManager;
|
||||
onTabAccessor: (instance: ITabAccessor) => void;
|
||||
isPreferredApiMongoDB?: boolean;
|
||||
monacoEditorSetting?: string;
|
||||
|
||||
Reference in New Issue
Block a user