1
1
mirror of https://github.com/usememos/memos.git synced 2024-12-27 05:12:13 +03:00

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(
{
className: "archived-memo-dialog",
useAppContext: true,
},
ArchivedMemoDialog,
{}

View File

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

View File

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

View File

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

View File

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