mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-19 17:01:13 +00:00
Remove Dialog Adapter (#446)
This commit is contained in:
18
src/Main.tsx
18
src/Main.tsx
@@ -69,6 +69,7 @@ import { useSidePanel } from "./hooks/useSidePanel";
|
||||
import { NotificationConsoleComponent } from "./Explorer/Menus/NotificationConsole/NotificationConsoleComponent";
|
||||
import { PanelContainerComponent } from "./Explorer/Panes/PanelContainerComponent";
|
||||
import { SplashScreen } from "./Explorer/SplashScreen/SplashScreen";
|
||||
import { Dialog, DialogProps } from "./Explorer/Controls/Dialog";
|
||||
|
||||
initializeIcons();
|
||||
|
||||
@@ -78,6 +79,17 @@ const App: React.FunctionComponent = () => {
|
||||
//TODO: Refactor so we don't need to pass the id to remove a console data
|
||||
const [inProgressConsoleDataIdToBeDeleted, setInProgressConsoleDataIdToBeDeleted] = useState("");
|
||||
|
||||
const [dialogProps, setDialogProps] = useState<DialogProps>();
|
||||
const [showDialog, setShowDialog] = useState<boolean>(false);
|
||||
|
||||
const openDialog = (props: DialogProps) => {
|
||||
setDialogProps(props);
|
||||
setShowDialog(true);
|
||||
};
|
||||
const closeDialog = () => {
|
||||
setShowDialog(false);
|
||||
};
|
||||
|
||||
const { isPanelOpen, panelContent, headerText, openSidePanel, closeSidePanel } = useSidePanel();
|
||||
|
||||
const explorerParams: ExplorerParams = {
|
||||
@@ -86,6 +98,8 @@ const App: React.FunctionComponent = () => {
|
||||
setInProgressConsoleDataIdToBeDeleted,
|
||||
openSidePanel,
|
||||
closeSidePanel,
|
||||
openDialog,
|
||||
closeDialog,
|
||||
};
|
||||
const config = useConfig();
|
||||
const explorer = useKnockoutExplorer(config?.platform, explorerParams);
|
||||
@@ -355,9 +369,7 @@ const App: React.FunctionComponent = () => {
|
||||
<KOCommentIfStart if="isCopyNotebookPaneEnabled" />
|
||||
<div data-bind="react: copyNotebookPaneAdapter" />
|
||||
<KOCommentEnd />
|
||||
{/* Global access token expiration dialog - End */}
|
||||
<div data-bind="react: dialogComponentAdapter" />
|
||||
<div data-bind="react: addSynapseLinkDialog" />
|
||||
{showDialog && <Dialog {...dialogProps} />}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user