mirror of
https://github.com/usememos/memos.git
synced 2024-12-19 09:02:49 +03:00
chore: remove useAppContext
in dialog props
This commit is contained in:
parent
7e994c8f11
commit
cea16fac88
@ -66,7 +66,6 @@ export default function showArchivedMemoDialog(): void {
|
|||||||
generateDialog(
|
generateDialog(
|
||||||
{
|
{
|
||||||
className: "archived-memo-dialog",
|
className: "archived-memo-dialog",
|
||||||
useAppContext: true,
|
|
||||||
},
|
},
|
||||||
ArchivedMemoDialog,
|
ArchivedMemoDialog,
|
||||||
{}
|
{}
|
||||||
|
@ -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 }
|
||||||
|
@ -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;
|
||||||
|
@ -155,7 +155,6 @@ export default function showResourcesDialog() {
|
|||||||
generateDialog(
|
generateDialog(
|
||||||
{
|
{
|
||||||
className: "resources-dialog",
|
className: "resources-dialog",
|
||||||
useAppContext: true,
|
|
||||||
},
|
},
|
||||||
ResourcesDialog,
|
ResourcesDialog,
|
||||||
{}
|
{}
|
||||||
|
@ -80,7 +80,6 @@ export default function showSettingDialog(): void {
|
|||||||
generateDialog(
|
generateDialog(
|
||||||
{
|
{
|
||||||
className: "setting-dialog",
|
className: "setting-dialog",
|
||||||
useAppContext: true,
|
|
||||||
},
|
},
|
||||||
SettingDialog,
|
SettingDialog,
|
||||||
{}
|
{}
|
||||||
|
Loading…
Reference in New Issue
Block a user