Started on environment edit dialog

This commit is contained in:
Gregory Schier
2023-10-23 21:00:36 -07:00
parent 83e2cab1b6
commit fa16e1f957
9 changed files with 125 additions and 50 deletions

View File

@@ -1,6 +1,8 @@
import React, { createContext, useContext, useMemo, useState } from 'react';
import type { DialogProps } from './core/Dialog';
import { Dialog } from './core/Dialog';
import { useActiveWorkspace } from '../hooks/useActiveWorkspace';
import { useActiveWorkspaceId } from '../hooks/useActiveWorkspaceId';
type DialogEntry = {
id: string;
@@ -54,9 +56,11 @@ export const DialogProvider = ({ children }: { children: React.ReactNode }) => {
function DialogInstance({ id, render, ...props }: DialogEntry) {
const { actions } = useContext(DialogContext);
const children = render({ hide: () => actions.hide(id) });
console.log("ACITEV WORKSPAXCE ID 2", useActiveWorkspaceId());
return (
<Dialog open onClose={() => actions.hide(id)} {...props}>
{render({ hide: () => actions.hide(id) })}
{children}
</Dialog>
);
}