2022-08-26 16:19:39 +05:00
|
|
|
import React from "react";
|
|
|
|
|
import { useNoteStore } from "../../stores/use-notes-store";
|
|
|
|
|
import { useThemeStore } from "../../stores/use-theme-store";
|
|
|
|
|
import { AnnouncementDialog } from "../announcements";
|
|
|
|
|
import { AttachmentDialog } from "../attachments";
|
|
|
|
|
import Auth from "../auth";
|
|
|
|
|
import AuthModal from "../auth/auth-modal";
|
|
|
|
|
import { SessionExpired } from "../auth/session-expired";
|
|
|
|
|
import { Dialog } from "../dialog";
|
|
|
|
|
import { AddTopicDialog } from "../dialogs/add-topic";
|
|
|
|
|
import ResultDialog from "../dialogs/result";
|
|
|
|
|
import { VaultDialog } from "../dialogs/vault";
|
|
|
|
|
import ImagePreview from "../image-preview";
|
|
|
|
|
import MergeConflicts from "../merge-conflicts";
|
|
|
|
|
import PremiumDialog from "../premium";
|
|
|
|
|
import { Expiring } from "../premium/expiring";
|
|
|
|
|
import SheetProvider from "../sheet-provider";
|
|
|
|
|
import { AddNotebookSheet } from "../sheets/add-notebook";
|
|
|
|
|
import AddToNotebookSheet from "../sheets/add-to";
|
|
|
|
|
import ExportNotesSheet from "../sheets/export-notes";
|
|
|
|
|
import ManageTagsSheet from "../sheets/manage-tags";
|
|
|
|
|
import PublishNoteSheet from "../sheets/publish-note";
|
|
|
|
|
import RateAppSheet from "../sheets/rate-app";
|
|
|
|
|
import RecoveryKeySheet from "../sheets/recovery-key";
|
|
|
|
|
import RestoreDataSheet from "../sheets/restore-data";
|
2022-02-28 13:48:59 +05:00
|
|
|
|
2022-03-07 15:19:07 +05:00
|
|
|
const DialogProvider = React.memo(
|
|
|
|
|
() => {
|
2022-08-26 16:19:39 +05:00
|
|
|
const colors = useThemeStore((state) => state.colors);
|
|
|
|
|
const loading = useNoteStore((state) => state.loading);
|
2022-02-28 13:48:59 +05:00
|
|
|
|
2022-03-07 15:19:07 +05:00
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<Dialog context="global" />
|
|
|
|
|
<AddTopicDialog colors={colors} />
|
|
|
|
|
<AddNotebookSheet colors={colors} />
|
|
|
|
|
<PremiumDialog colors={colors} />
|
2022-07-05 14:33:48 +05:00
|
|
|
<AuthModal colors={colors} />
|
2022-03-07 15:19:07 +05:00
|
|
|
<MergeConflicts />
|
|
|
|
|
<ExportNotesSheet />
|
|
|
|
|
<RecoveryKeySheet colors={colors} />
|
|
|
|
|
<SheetProvider />
|
2022-04-01 00:56:10 +05:00
|
|
|
<SheetProvider context="sync_progress" />
|
2022-03-07 15:19:07 +05:00
|
|
|
<RestoreDataSheet />
|
|
|
|
|
<ResultDialog />
|
|
|
|
|
<VaultDialog colors={colors} />
|
|
|
|
|
<AddToNotebookSheet colors={colors} />
|
|
|
|
|
<RateAppSheet />
|
|
|
|
|
<ImagePreview />
|
|
|
|
|
<PublishNoteSheet />
|
|
|
|
|
<ManageTagsSheet />
|
|
|
|
|
<AttachmentDialog />
|
2022-07-06 16:26:33 +05:00
|
|
|
{loading ? null : <Expiring />}
|
2022-03-07 15:19:07 +05:00
|
|
|
<AnnouncementDialog />
|
|
|
|
|
<SessionExpired />
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
() => true
|
|
|
|
|
);
|
2022-02-28 13:48:59 +05:00
|
|
|
|
2022-03-07 15:19:07 +05:00
|
|
|
export default DialogProvider;
|