Commit 8a3845ff authored by Steven's avatar Steven

chore: remove external resource dialog

parent 155c5baf
......@@ -145,7 +145,7 @@ const CreateMemoRelationDialog: React.FC<Props> = (props: Props) => {
);
};
function showCreateMemoRelationDialog(props: Omit<Props, "destroy" | "hide">) {
function showCreateMemoRelationDialog(props: Omit<Props, "destroy">) {
generateDialog(
{
className: "create-memo-relation-dialog",
......
This diff is collapsed.
......@@ -67,7 +67,7 @@ const BaseDialog: React.FC<Props> = (props: Props) => {
export function generateDialog<T extends DialogProps>(
config: DialogConfig,
DialogComponent: React.FC<T>,
props?: Omit<T, "destroy" | "hide">,
props?: Omit<T, "destroy">,
): DialogCallback {
const tempDiv = document.createElement("div");
const dialog = createRoot(tempDiv);
......@@ -82,20 +82,18 @@ export function generateDialog<T extends DialogProps>(
tempDiv.remove();
});
},
hide: () => {},
};
const dialogProps = {
...props,
destroy: cbs.destroy,
hide: cbs.hide,
} as T;
const Fragment = (
<Provider store={store}>
<CssVarsProvider theme={theme}>
<CommonContextProvider>
<BaseDialog destroy={cbs.destroy} hide={cbs.hide} clickSpaceDestroy={true} {...config}>
<BaseDialog destroy={cbs.destroy} clickSpaceDestroy={true} {...config}>
<DialogComponent {...dialogProps} />
</BaseDialog>
</CommonContextProvider>
......
interface DialogCallback {
destroy: FunctionType;
hide: FunctionType;
}
type DialogProps = DialogCallback;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment