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:
13
src/Main.tsx
13
src/Main.tsx
@@ -34,7 +34,6 @@ import "./Explorer/Controls/ErrorDisplayComponent/ErrorDisplayComponent.less";
|
||||
import "./Explorer/Controls/JsonEditor/JsonEditorComponent.less";
|
||||
import "./Explorer/Controls/Notebook/NotebookTerminalComponent.less";
|
||||
import "./Explorer/Controls/TreeComponent/treeComponent.less";
|
||||
import { ExplorerParams } from "./Explorer/Explorer";
|
||||
import "./Explorer/Graph/GraphExplorerComponent/graphExplorer.less";
|
||||
import "./Explorer/Menus/CommandBar/CommandBarComponent.less";
|
||||
import { CommandBar } from "./Explorer/Menus/CommandBar/CommandBarComponentAdapter";
|
||||
@@ -56,14 +55,10 @@ initializeIcons();
|
||||
|
||||
const App: React.FunctionComponent = () => {
|
||||
const [isLeftPaneExpanded, setIsLeftPaneExpanded] = useState<boolean>(true);
|
||||
const { tabs, activeTab, tabsManager } = useTabs();
|
||||
|
||||
const explorerParams: ExplorerParams = {
|
||||
tabsManager,
|
||||
};
|
||||
const openedTabs = useTabs((state) => state.openedTabs);
|
||||
|
||||
const config = useConfig();
|
||||
const explorer = useKnockoutExplorer(config?.platform, explorerParams);
|
||||
const explorer = useKnockoutExplorer(config?.platform);
|
||||
|
||||
const toggleLeftPaneExpanded = () => {
|
||||
setIsLeftPaneExpanded(!isLeftPaneExpanded);
|
||||
@@ -100,8 +95,8 @@ const App: React.FunctionComponent = () => {
|
||||
</div>
|
||||
</div>
|
||||
{/* Collections Tree - End */}
|
||||
{tabs.length === 0 && <SplashScreen explorer={explorer} />}
|
||||
<Tabs tabs={tabs} activeTab={activeTab} />
|
||||
{openedTabs.length === 0 && <SplashScreen explorer={explorer} />}
|
||||
<Tabs />
|
||||
</div>
|
||||
{/* Collections Tree and Tabs - End */}
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user