1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-21 09:38:01 +02:00
joplin/packages/app-desktop/gui/WindowCommandsAndDialogs/utils/appDialogs.tsx
Henry Heino 4a88d6ff7a
Desktop: Multiple window support (#11181)
Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
2024-11-08 15:32:05 +00:00

50 lines
1.9 KiB
TypeScript

import * as React from 'react';
import SyncWizardDialog from '../../SyncWizard/Dialog';
import MasterPasswordDialog from '../../MasterPasswordDialog/Dialog';
import EditFolderDialog from '../../EditFolderDialog/Dialog';
import PdfViewer from '../../PdfViewer';
interface RegisteredDialogProps {
themeId: number;
key: string;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
dispatch: Function;
}
interface RegisteredDialog {
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
render: (props: RegisteredDialogProps, customProps: any)=> any;
}
const appDialogs: Record<string, RegisteredDialog> = {
syncWizard: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
render: (props: RegisteredDialogProps, customProps: any) => {
return <SyncWizardDialog key={props.key} dispatch={props.dispatch} themeId={props.themeId} {...customProps}/>;
},
},
masterPassword: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
render: (props: RegisteredDialogProps, customProps: any) => {
return <MasterPasswordDialog key={props.key} dispatch={props.dispatch} themeId={props.themeId} {...customProps}/>;
},
},
editFolder: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
render: (props: RegisteredDialogProps, customProps: any) => {
return <EditFolderDialog key={props.key} dispatch={props.dispatch} themeId={props.themeId} {...customProps}/>;
},
},
pdfViewer: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
render: (props: RegisteredDialogProps, customProps: any) => {
return <PdfViewer key={props.key} dispatch={props.dispatch} themeId={props.themeId} {...customProps}/>;
},
},
};
export default appDialogs;