chore: remove useAppContext in dialog props

This commit is contained in:
XQ 2022-08-08 23:33:53 +08:00 committed by GitHub
parent 7e994c8f11
commit cea16fac88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 13 deletions

View File

@ -66,7 +66,6 @@ export default function showArchivedMemoDialog(): void {
generateDialog( generateDialog(
{ {
className: "archived-memo-dialog", className: "archived-memo-dialog",
useAppContext: true,
}, },
ArchivedMemoDialog, ArchivedMemoDialog,
{} {}

View File

@ -113,7 +113,6 @@ export default function showDailyReviewDialog(datestamp: DateStamp = Date.now())
generateDialog( generateDialog(
{ {
className: "daily-review-dialog", className: "daily-review-dialog",
useAppContext: true,
}, },
DailyReviewDialog, DailyReviewDialog,
{ currentDateStamp: datestamp } { currentDateStamp: datestamp }

View File

@ -6,7 +6,6 @@ import "../../less/base-dialog.less";
interface DialogConfig { interface DialogConfig {
className: string; className: string;
useAppContext?: boolean;
clickSpaceDestroy?: boolean; clickSpaceDestroy?: boolean;
} }
@ -61,16 +60,14 @@ export function generateDialog<T extends DialogProps>(
destroy: cbs.destroy, destroy: cbs.destroy,
} as T; } as T;
let Fragment = ( const Fragment = (
<BaseDialog destroy={cbs.destroy} clickSpaceDestroy={true} {...config}> <Provider store={store}>
<DialogComponent {...dialogProps} /> <BaseDialog destroy={cbs.destroy} clickSpaceDestroy={true} {...config}>
</BaseDialog> <DialogComponent {...dialogProps} />
</BaseDialog>
</Provider>
); );
if (config.useAppContext) {
Fragment = <Provider store={store}>{Fragment}</Provider>;
}
dialog.render(Fragment); dialog.render(Fragment);
return cbs; return cbs;

View File

@ -155,7 +155,6 @@ export default function showResourcesDialog() {
generateDialog( generateDialog(
{ {
className: "resources-dialog", className: "resources-dialog",
useAppContext: true,
}, },
ResourcesDialog, ResourcesDialog,
{} {}

View File

@ -80,7 +80,6 @@ export default function showSettingDialog(): void {
generateDialog( generateDialog(
{ {
className: "setting-dialog", className: "setting-dialog",
useAppContext: true,
}, },
SettingDialog, SettingDialog,
{} {}