web: move dialogs out to top-most level

This commit is contained in:
Abdullah Atta
2023-06-17 11:15:20 +05:00
committed by Abdullah Atta
parent 08480188fa
commit 8c17233e67
63 changed files with 271 additions and 271 deletions

View File

@@ -43,7 +43,7 @@ import useSystemTheme from "./hooks/use-system-theme";
import { isTesting } from "./utils/platform"; import { isTesting } from "./utils/platform";
import { updateStatus, removeStatus, getStatus } from "./hooks/use-status"; import { updateStatus, removeStatus, getStatus } from "./hooks/use-status";
import { showToast } from "./utils/toast"; import { showToast } from "./utils/toast";
import { interruptedOnboarding } from "./components/dialogs/onboarding-dialog"; import { interruptedOnboarding } from "./components/dialog/onboarding-dialog";
import { hashNavigate } from "./navigation"; import { hashNavigate } from "./navigation";
import { desktop } from "./common/desktop-bridge"; import { desktop } from "./common/desktop-bridge";

View File

@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import ReactDOM from "react-dom"; import ReactDOM from "react-dom";
import { Dialogs } from "../components/dialogs"; import { Dialogs } from "../dialogs";
import ThemeProvider from "../components/theme-provider"; import ThemeProvider from "../components/theme-provider";
import qclone from "qclone"; import qclone from "qclone";
import { store as notebookStore } from "../stores/notebook-store"; import { store as notebookStore } from "../stores/notebook-store";
@@ -32,12 +32,12 @@ import { Text } from "@theme-ui/components";
import * as Icon from "../components/icons"; import * as Icon from "../components/icons";
import Config from "../utils/config"; import Config from "../utils/config";
import { AppVersion, getChangelog } from "../utils/version"; import { AppVersion, getChangelog } from "../utils/version";
import { Period } from "../components/dialogs/buy-dialog/types"; import { Period } from "../dialogs/buy-dialog/types";
import { FeatureKeys } from "../components/dialogs/feature-dialog"; import { FeatureKeys } from "../dialogs/feature-dialog";
import { AuthenticatorType } from "../components/dialogs/mfa/types"; import { AuthenticatorType } from "../dialogs/mfa/types";
import { Suspense } from "react"; import { Suspense } from "react";
import { Reminder } from "@notesnook/core/collections/reminders"; import { Reminder } from "@notesnook/core/collections/reminders";
import { ConfirmDialogProps } from "../components/dialogs/confirm"; import { ConfirmDialogProps } from "../dialogs/confirm";
import { getFormattedDate } from "@notesnook/common"; import { getFormattedDate } from "@notesnook/common";
import { downloadUpdate, installUpdate } from "../utils/updater"; import { downloadUpdate, installUpdate } from "../utils/updater";

View File

@@ -19,11 +19,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import React from "react"; import React from "react";
import { Flex, Text } from "@theme-ui/components"; import { Flex, Text } from "@theme-ui/components";
import * as Icon from "../icons"; import * as Icon from "../components/icons";
import Dialog from "./dialog"; import Dialog from "../components/dialog";
import qclone from "qclone"; import qclone from "qclone";
import Field from "../field"; import Field from "../components/field";
import { showToast } from "../../utils/toast"; import { showToast } from "../utils/toast";
class AddNotebookDialog extends React.Component { class AddNotebookDialog extends React.Component {
title = ""; title = "";

View File

@@ -17,18 +17,18 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { Perform } from "../../common/dialog-controller"; import { Perform } from "../common/dialog-controller";
import Dialog from "./dialog"; import Dialog from "../components/dialog";
import Field from "../field"; import Field from "../components/field";
import { Box, Button, Flex, Label, Radio, Text } from "@theme-ui/components"; import { Box, Button, Flex, Label, Radio, Text } from "@theme-ui/components";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { db } from "../../common/db"; import { db } from "../common/db";
import { useStore } from "../../stores/reminder-store"; import { useStore } from "../stores/reminder-store";
import { showToast } from "../../utils/toast"; import { showToast } from "../utils/toast";
import { useIsUserPremium } from "../../hooks/use-is-user-premium"; import { useIsUserPremium } from "../hooks/use-is-user-premium";
import { Pro } from "../icons"; import { Pro } from "../components/icons";
import { usePersistentState } from "../../hooks/use-persistent-state"; import { usePersistentState } from "../hooks/use-persistent-state";
export type AddReminderDialogProps = { export type AddReminderDialogProps = {
onClose: Perform; onClose: Perform;
@@ -305,6 +305,7 @@ export default function AddReminderDialog(props: AddReminderDialogProps) {
{recurringModes.map((mode) => {recurringModes.map((mode) =>
mode.id === recurringMode ? ( mode.id === recurringMode ? (
<Box <Box
key={mode.id}
sx={{ sx={{
display: "grid", display: "grid",
gridTemplateColumns: gridTemplateColumns:

View File

@@ -19,13 +19,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { useCallback, useEffect, useState } from "react"; import { useCallback, useEffect, useState } from "react";
import { Flex, Text } from "@theme-ui/components"; import { Flex, Text } from "@theme-ui/components";
import * as Icon from "../icons"; import {
import { db } from "../../common/db"; CheckCircleOutline,
import Dialog from "./dialog"; CheckRemove,
import { useStore, store } from "../../stores/tag-store"; CircleEmpty
import { store as notestore } from "../../stores/note-store"; } from "../components/icons";
import { Perform } from "../../common/dialog-controller"; import { db } from "../common/db";
import { FilteredList } from "../filtered-list"; import Dialog from "../components/dialog";
import { useStore, store } from "../stores/tag-store";
import { store as notestore } from "../stores/note-store";
import { Perform } from "../common/dialog-controller";
import { FilteredList } from "../components/filtered-list";
type SelectedReference = { type SelectedReference = {
id: string; id: string;
@@ -207,11 +211,11 @@ function SelectedCheck({
size?: number; size?: number;
}) { }) {
return selected === "add" ? ( return selected === "add" ? (
<Icon.CheckCircleOutline size={size} sx={{ mr: 1 }} color="primary" /> <CheckCircleOutline size={size} sx={{ mr: 1 }} color="primary" />
) : selected === "remove" ? ( ) : selected === "remove" ? (
<Icon.CheckRemove size={size} sx={{ mr: 1 }} color="error" /> <CheckRemove size={size} sx={{ mr: 1 }} color="error" />
) : ( ) : (
<Icon.CircleEmpty size={size} sx={{ mr: 1, opacity: 0.4 }} /> <CircleEmpty size={size} sx={{ mr: 1, opacity: 0.4 }} />
); );
} }

View File

@@ -21,7 +21,7 @@ import Modal from "react-modal";
import { useTheme } from "@emotion/react"; import { useTheme } from "@emotion/react";
import { Flex } from "@theme-ui/components"; import { Flex } from "@theme-ui/components";
import AnnouncementBody from "../announcements/body"; import AnnouncementBody from "../announcements/body";
import { store as announcementStore } from "../../stores/announcement-store"; import { store as announcementStore } from "../stores/announcement-store";
import { useCallback } from "react"; import { useCallback } from "react";
function AnnouncementDialog(props) { function AnnouncementDialog(props) {

View File

@@ -28,10 +28,10 @@ import {
Label, Label,
Text Text
} from "@theme-ui/components"; } from "@theme-ui/components";
import { getTotalSize } from "../../common/attachments"; import { getTotalSize } from "../common/attachments";
import { useStore, store } from "../../stores/attachment-store"; import { useStore, store } from "../stores/attachment-store";
import { formatBytes } from "@notesnook/common"; import { formatBytes } from "@notesnook/common";
import Dialog from "./dialog"; import Dialog from "../components/dialog";
import { TableVirtuoso } from "react-virtuoso"; import { TableVirtuoso } from "react-virtuoso";
import { import {
ChevronDown, ChevronDown,
@@ -47,14 +47,14 @@ import {
Trash, Trash,
Unlink, Unlink,
Uploading Uploading
} from "../icons"; } from "../components/icons";
import NavigationItem from "../navigation-menu/navigation-item"; import NavigationItem from "../components/navigation-menu/navigation-item";
import { pluralize } from "@notesnook/common"; import { pluralize } from "@notesnook/common";
import { db } from "../../common/db"; import { db } from "../common/db";
import { Perform } from "../../common/dialog-controller"; import { Perform } from "../common/dialog-controller";
import { Multiselect } from "../../common/multi-select"; import { Multiselect } from "../common/multi-select";
import { CustomScrollbarsVirtualList } from "../list-container"; import { CustomScrollbarsVirtualList } from "../components/list-container";
import { Attachment } from "../attachment"; import { Attachment } from "../components/attachment";
import { isDocument, isImage, isVideo } from "@notesnook/core/utils/filename"; import { isDocument, isImage, isVideo } from "@notesnook/core/utils/filename";
type ToolbarAction = { type ToolbarAction = {

View File

@@ -19,30 +19,30 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { useCallback, useEffect, useRef, useState } from "react"; import { useCallback, useEffect, useRef, useState } from "react";
import { Text, Flex, Button } from "@theme-ui/components"; import { Text, Flex, Button } from "@theme-ui/components";
import * as Icon from "../../icons"; import * as Icon from "../../components/icons";
import { useStore as useUserStore } from "../../../stores/user-store"; import { useStore as useUserStore } from "../../stores/user-store";
import { useStore as useThemeStore } from "../../../stores/theme-store"; import { useStore as useThemeStore } from "../../stores/theme-store";
import Modal from "react-modal"; import Modal from "react-modal";
import { useTheme } from "@emotion/react"; import { useTheme } from "@emotion/react";
import { ReactComponent as Rocket } from "../../../assets/rocket.svg"; import { ReactComponent as Rocket } from "../../assets/rocket.svg";
import { ReactComponent as WorkAnywhere } from "../../../assets/workanywhere.svg"; import { ReactComponent as WorkAnywhere } from "../../assets/workanywhere.svg";
import { ReactComponent as WorkLate } from "../../../assets/worklate.svg"; import { ReactComponent as WorkLate } from "../../assets/worklate.svg";
import Field from "../../field"; import Field from "../../components/field";
import { hardNavigate } from "../../../navigation"; import { hardNavigate } from "../../navigation";
import { Features } from "./features"; import { Features } from "./features";
import { PaddleCheckout } from "./paddle"; import { PaddleCheckout } from "./paddle";
import { Period, Plan, PricingInfo } from "./types"; import { Period, Plan, PricingInfo } from "./types";
import { PLAN_METADATA, usePlans } from "./plans"; import { PLAN_METADATA, usePlans } from "./plans";
import { formatPeriod, getFullPeriod, PlansList } from "./plan-list"; import { formatPeriod, getFullPeriod, PlansList } from "./plan-list";
import { showToast } from "../../../utils/toast"; import { showToast } from "../../utils/toast";
import { TaskManager } from "../../../common/task-manager"; import { TaskManager } from "../../common/task-manager";
import { db } from "../../../common/db"; import { db } from "../../common/db";
import { useCheckoutStore } from "./store"; import { useCheckoutStore } from "./store";
import { getCurrencySymbol } from "./helpers"; import { getCurrencySymbol } from "./helpers";
import { Theme } from "@notesnook/theme"; import { Theme } from "@notesnook/theme";
import { isMacStoreApp } from "../../../utils/platform"; import { isMacStoreApp } from "../../utils/platform";
import { isUserSubscribed } from "../../../hooks/use-is-user-premium"; import { isUserSubscribed } from "../../hooks/use-is-user-premium";
import { SUBSCRIPTION_STATUS } from "../../../common/constants"; import { SUBSCRIPTION_STATUS } from "../../common/constants";
type BuyDialogProps = { type BuyDialogProps = {
couponCode?: string; couponCode?: string;

View File

@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { Text, Flex, Box } from "@theme-ui/components"; import { Text, Flex, Box } from "@theme-ui/components";
import { isMacStoreApp } from "../../../utils/platform"; import { isMacStoreApp } from "../../utils/platform";
import { import {
Accent, Accent,
Android, Android,
@@ -67,7 +67,7 @@ import {
MfaEmail, MfaEmail,
CustomToolbar, CustomToolbar,
SyncOff SyncOff
} from "../../icons"; } from "../../components/icons";
type Feature = { type Feature = {
id: string; id: string;

View File

@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { useEffect, useState, useRef, useCallback } from "react"; import { useEffect, useState, useRef, useCallback } from "react";
import { Embed, Flex } from "@theme-ui/components"; import { Embed, Flex } from "@theme-ui/components";
import Loader from "../../loader"; import Loader from "../../components/loader";
import { import {
CheckoutData, CheckoutData,
CheckoutDataResponse, CheckoutDataResponse,

View File

@@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { Text, Flex, Button } from "@theme-ui/components"; import { Text, Flex, Button } from "@theme-ui/components";
import * as Icon from "../../icons"; import * as Icon from "../../components/icons";
import { ReactComponent as Nomad } from "../../../assets/nomad.svg"; import { ReactComponent as Nomad } from "../../assets/nomad.svg";
import { Period, Plan } from "./types"; import { Period, Plan } from "./types";
import { PLAN_METADATA, usePlans } from "./plans"; import { PLAN_METADATA, usePlans } from "./plans";
import { useEffect } from "react"; import { useEffect } from "react";

View File

@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { isTesting } from "../../../utils/platform"; import { isTesting } from "../../utils/platform";
import { Period, Plan } from "./types"; import { Period, Plan } from "./types";
type PlanMetadata = { type PlanMetadata = {

View File

@@ -19,9 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { Box, Checkbox, Label, Text } from "@theme-ui/components"; import { Box, Checkbox, Label, Text } from "@theme-ui/components";
import { useRef } from "react"; import { useRef } from "react";
import { Perform } from "../../common/dialog-controller"; import { Perform } from "../common/dialog-controller";
import { mdToHtml } from "../../utils/md"; import { mdToHtml } from "../utils/md";
import Dialog from "./dialog"; import Dialog from "../components/dialog";
type Check = { text: string; default?: boolean }; type Check = { text: string; default?: boolean };
export type ConfirmDialogProps<TCheckId extends string> = { export type ConfirmDialogProps<TCheckId extends string> = {

View File

@@ -19,12 +19,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { Flex, Text } from "@theme-ui/components"; import { Flex, Text } from "@theme-ui/components";
import { useCallback, useRef, useState } from "react"; import { useCallback, useRef, useState } from "react";
import { db } from "../../common/db"; import { db } from "../common/db";
import { Perform } from "../../common/dialog-controller"; import { Perform } from "../common/dialog-controller";
import { useTimer } from "../../hooks/use-timer"; import { useTimer } from "../hooks/use-timer";
import Field from "../field"; import Field from "../components/field";
import { Loading } from "../icons"; import { Loading } from "../components/icons";
import Dialog from "./dialog"; import Dialog from "../components/dialog";
type EmailChangeState = { type EmailChangeState = {
newEmail: string; newEmail: string;

View File

@@ -19,12 +19,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { useEffect } from "react"; import { useEffect } from "react";
import { Flex, Text } from "@theme-ui/components"; import { Flex, Text } from "@theme-ui/components";
import Dialog from "./dialog"; import Dialog from "../components/dialog";
import { useStore as useUserStore } from "../../stores/user-store"; import { useStore as useUserStore } from "../stores/user-store";
import { db } from "../../common/db"; import { db } from "../common/db";
import { useState } from "react"; import { useState } from "react";
import { useSessionState } from "../../hooks/use-session-state"; import { useSessionState } from "../hooks/use-session-state";
import Accordion from "../accordion"; import Accordion from "../components/accordion";
var interval = 0; var interval = 0;
function EmailVerificationDialog(props) { function EmailVerificationDialog(props) {

View File

@@ -18,13 +18,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { Text, Flex } from "@theme-ui/components"; import { Text, Flex } from "@theme-ui/components";
import Dialog from "./dialog"; import Dialog from "../components/dialog";
import { getHomeRoute, hardNavigate } from "../../navigation"; import { getHomeRoute, hardNavigate } from "../navigation";
import { appVersion } from "../../utils/version"; import { appVersion } from "../utils/version";
import Config from "../../utils/config"; import Config from "../utils/config";
import { isTesting } from "../../utils/platform"; import { isTesting } from "../utils/platform";
import { useEffect } from "react"; import { useEffect } from "react";
import { ArrowRight, Checkmark, Icon, Warn } from "../icons"; import { ArrowRight, Checkmark, Icon, Warn } from "../components/icons";
type CallToAction = { type CallToAction = {
title: string; title: string;

View File

@@ -18,16 +18,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { Flex, Text } from "@theme-ui/components"; import { Flex, Text } from "@theme-ui/components";
import { appVersion } from "../../utils/version"; import { appVersion } from "../utils/version";
import Field from "../field"; import Field from "../components/field";
import Dialog from "./dialog"; import Dialog from "../components/dialog";
import platform from "platform"; import platform from "platform";
import { useState } from "react"; import { useState } from "react";
import { confirm, Perform } from "../../common/dialog-controller"; import { confirm, Perform } from "../common/dialog-controller";
import { isUserPremium } from "../../hooks/use-is-user-premium"; import { isUserPremium } from "../hooks/use-is-user-premium";
import * as clipboard from "clipboard-polyfill/text"; import * as clipboard from "clipboard-polyfill/text";
import { store as userstore } from "../../stores/user-store"; import { store as userstore } from "../stores/user-store";
import { db } from "../../common/db"; import { db } from "../common/db";
const PLACEHOLDERS = { const PLACEHOLDERS = {
title: "Briefly describe what happened", title: "Briefly describe what happened",

View File

@@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { Box } from "@theme-ui/components"; import { Box } from "@theme-ui/components";
import Dialog from "./dialog"; import Dialog from "../components/dialog";
import Field from "../field"; import Field from "../components/field";
function ItemDialog(props) { function ItemDialog(props) {
return ( return (

View File

@@ -19,8 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { useEffect } from "react"; import { useEffect } from "react";
import { Box, Text } from "@theme-ui/components"; import { Box, Text } from "@theme-ui/components";
import Dialog from "./dialog"; import Dialog from "../components/dialog";
import * as Icon from "../icons"; import * as Icon from "../components/icons";
type LoadingDialogProps<T> = { type LoadingDialogProps<T> = {
onClose: (result: T | boolean) => void; onClose: (result: T | boolean) => void;

View File

@@ -19,8 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { useState } from "react"; import { useState } from "react";
import { Text } from "@theme-ui/components"; import { Text } from "@theme-ui/components";
import { Perform } from "../../../common/dialog-controller"; import { Perform } from "../../common/dialog-controller";
import Dialog from "../dialog"; import Dialog from "../../components/dialog";
import { import {
AuthenticatorOnNext, AuthenticatorOnNext,
AuthenticatorTypeOnNext, AuthenticatorTypeOnNext,

View File

@@ -19,8 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { useState } from "react"; import { useState } from "react";
import { Text } from "@theme-ui/components"; import { Text } from "@theme-ui/components";
import { Perform } from "../../../common/dialog-controller"; import { Perform } from "../../common/dialog-controller";
import Dialog from "../dialog"; import Dialog from "../../components/dialog";
import { steps } from "./steps"; import { steps } from "./steps";
import { AuthenticatorType } from "./types"; import { AuthenticatorType } from "./types";

View File

@@ -27,7 +27,7 @@ import React, {
useState useState
} from "react"; } from "react";
import { Text, Flex, Button, Box } from "@theme-ui/components"; import { Text, Flex, Button, Box } from "@theme-ui/components";
import { useSessionState } from "../../../hooks/use-session-state"; import { useSessionState } from "../../hooks/use-session-state";
import { import {
Loading, Loading,
MfaAuthenticator, MfaAuthenticator,
@@ -38,16 +38,16 @@ import {
Copy, Copy,
Refresh, Refresh,
Checkmark Checkmark
} from "../../icons"; } from "../../components/icons";
import Field from "../../field"; import Field from "../../components/field";
import { exportToPDF } from "../../../common/export"; import { exportToPDF } from "../../common/export";
import { useTimer } from "../../../hooks/use-timer"; import { useTimer } from "../../hooks/use-timer";
import { phone } from "phone"; import { phone } from "phone";
import { db } from "../../../common/db"; import { db } from "../../common/db";
import FileSaver from "file-saver"; import FileSaver from "file-saver";
import * as clipboard from "clipboard-polyfill/text"; import * as clipboard from "clipboard-polyfill/text";
import { ReactComponent as MFA } from "../../../assets/mfa.svg"; import { ReactComponent as MFA } from "../../assets/mfa.svg";
import { ReactComponent as Fallback2FA } from "../../../assets/fallback2fa.svg"; import { ReactComponent as Fallback2FA } from "../../assets/fallback2fa.svg";
import { import {
Authenticator, Authenticator,
AuthenticatorType, AuthenticatorType,
@@ -56,10 +56,8 @@ import {
StepComponentProps, StepComponentProps,
OnNextFunction OnNextFunction
} from "./types"; } from "./types";
import { showMultifactorDialog } from "../../../common/dialog-controller"; import { showMultifactorDialog } from "../../common/dialog-controller";
const QRCode = React.lazy( const QRCode = React.lazy(() => import("../../re-exports/react-qrcode-logo"));
() => import("../../../re-exports/react-qrcode-logo")
);
export type Steps = typeof steps; export type Steps = typeof steps;
export type FallbackSteps = typeof fallbackSteps; export type FallbackSteps = typeof fallbackSteps;

View File

@@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { Perform } from "../../../common/dialog-controller"; import { Perform } from "../../common/dialog-controller";
import { Icon } from "../../icons"; import { Icon } from "../../components/icons";
export type AuthenticatorType = "app" | "sms" | "email"; export type AuthenticatorType = "app" | "sms" | "email";

View File

@@ -20,12 +20,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { EVENTS } from "@notesnook/core/common"; import { EVENTS } from "@notesnook/core/common";
import { Text } from "@theme-ui/components"; import { Text } from "@theme-ui/components";
import { useCallback, useEffect, useState } from "react"; import { useCallback, useEffect, useState } from "react";
import { createBackup } from "../../common"; import { createBackup } from "../common";
import { db } from "../../common/db"; import { db } from "../common/db";
import { Perform } from "../../common/dialog-controller"; import { Perform } from "../common/dialog-controller";
import { TaskManager } from "../../common/task-manager"; import { TaskManager } from "../common/task-manager";
import { isDesktop } from "../../utils/platform"; import { isDesktop } from "../utils/platform";
import Dialog from "./dialog"; import Dialog from "../components/dialog";
type MigrationProgressEvent = { type MigrationProgressEvent = {
collection: string; collection: string;

View File

@@ -19,17 +19,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { useCallback, useEffect, useState } from "react"; import { useCallback, useEffect, useState } from "react";
import { Box, Button, Flex, Input, Text } from "@theme-ui/components"; import { Box, Button, Flex, Input, Text } from "@theme-ui/components";
import * as Icon from "../icons"; import * as Icon from "../components/icons";
import { db } from "../../common/db"; import { db } from "../common/db";
import Dialog from "./dialog"; import Dialog from "../components/dialog";
import { useStore, store } from "../../stores/notebook-store"; import { useStore, store } from "../stores/notebook-store";
import { store as notestore } from "../../stores/note-store"; import { store as notestore } from "../stores/note-store";
import { Perform } from "../../common/dialog-controller"; import { Perform } from "../common/dialog-controller";
import { showToast } from "../../utils/toast"; import { showToast } from "../utils/toast";
import { pluralize } from "@notesnook/common"; import { pluralize } from "@notesnook/common";
import { isMac } from "../../utils/platform"; import { isMac } from "../utils/platform";
import { create } from "zustand"; import { create } from "zustand";
import { FilteredList } from "../filtered-list"; import { FilteredList } from "../components/filtered-list";
type MoveDialogProps = { onClose: Perform; noteIds: string[] }; type MoveDialogProps = { onClose: Perform; noteIds: string[] };
type NotebookReference = { type NotebookReference = {

View File

@@ -18,29 +18,29 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { Text, Flex, Button, Image, Box } from "@theme-ui/components"; import { Text, Flex, Button, Image, Box } from "@theme-ui/components";
import Dialog from "./dialog"; import Dialog from "../components/dialog";
import * as Icon from "../icons"; import * as Icon from "../components/icons";
import { ReactComponent as E2E } from "../../assets/e2e.svg"; import { ReactComponent as E2E } from "../assets/e2e.svg";
import { ReactComponent as Note } from "../../assets/note2.svg"; import { ReactComponent as Note } from "../assets/note2.svg";
import { ReactComponent as Nomad } from "../../assets/nomad.svg"; import { ReactComponent as Nomad } from "../assets/nomad.svg";
import { ReactComponent as WorkAnywhere } from "../../assets/workanywhere.svg"; import { ReactComponent as WorkAnywhere } from "../assets/workanywhere.svg";
import { ReactComponent as Friends } from "../../assets/cause.svg"; import { ReactComponent as Friends } from "../assets/cause.svg";
import LightUI from "../../assets/light1.png"; import LightUI from "../assets/light1.png";
import DarkUI from "../../assets/dark1.png"; import DarkUI from "../assets/dark1.png";
import GooglePlay from "../../assets/play.png"; import GooglePlay from "../assets/play.png";
import AppleStore from "../../assets/apple.png"; import AppleStore from "../assets/apple.png";
import { useStore as useThemeStore } from "../../stores/theme-store"; import { useStore as useThemeStore } from "../stores/theme-store";
import { Checkbox, Label } from "@theme-ui/components"; import { Checkbox, Label } from "@theme-ui/components";
import { Features } from "../announcements/body"; import { Features } from "../announcements/body";
import { showBuyDialog } from "../../common/dialog-controller"; import { showBuyDialog } from "../common/dialog-controller";
import { TaskManager } from "../../common/task-manager"; import { TaskManager } from "../common/task-manager";
import { db } from "../../common/db"; import { db } from "../common/db";
import { usePersistentState } from "../../hooks/use-persistent-state"; import { usePersistentState } from "../hooks/use-persistent-state";
import AccentItem from "../accent-item"; import AccentItem from "../accent-item";
import { useCallback, useState } from "react"; import { useCallback, useState } from "react";
import Config from "../../utils/config"; import Config from "../utils/config";
import { getAllAccents } from "@notesnook/theme"; import { getAllAccents } from "@notesnook/theme";
import { isMacStoreApp } from "../../utils/platform"; import { isMacStoreApp } from "../utils/platform";
const newUserSteps = [ const newUserSteps = [
{ {

View File

@@ -19,8 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { useState, useCallback, useMemo } from "react"; import { useState, useCallback, useMemo } from "react";
import { Box, Text } from "@theme-ui/components"; import { Box, Text } from "@theme-ui/components";
import Dialog from "./dialog"; import Dialog from "../components/dialog";
import Field from "../field"; import Field from "../components/field";
import { Checkbox, Label } from "@theme-ui/components"; import { Checkbox, Label } from "@theme-ui/components";
function PasswordDialog(props) { function PasswordDialog(props) {

View File

@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { Box, Flex, Text } from "@theme-ui/components"; import { Box, Flex, Text } from "@theme-ui/components";
import Dialog from "./dialog"; import Dialog from "../components/dialog";
function ProgressDialog(props) { function ProgressDialog(props) {
const [{ current, total, text }, setProgress] = useState({ const [{ current, total, text }, setProgress] = useState({

View File

@@ -18,9 +18,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { useRef } from "react"; import { useRef } from "react";
import { Perform } from "../../common/dialog-controller"; import { Perform } from "../common/dialog-controller";
import Field from "../field"; import Field from "../components/field";
import Dialog from "./dialog"; import Dialog from "../components/dialog";
export type PromptDialogProps = { export type PromptDialogProps = {
onClose: Perform; onClose: Perform;

View File

@@ -19,15 +19,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { Text, Flex, Button } from "@theme-ui/components"; import { Text, Flex, Button } from "@theme-ui/components";
import Dialog from "./dialog"; import Dialog from "../components/dialog";
import { db } from "../../common/db"; import { db } from "../common/db";
import Logo from "../../assets/notesnook-logo.png"; import Logo from "../assets/notesnook-logo.png";
import * as clipboard from "clipboard-polyfill/text"; import * as clipboard from "clipboard-polyfill/text";
import { Suspense } from "react"; import { Suspense } from "react";
import Config from "../../utils/config"; import Config from "../utils/config";
import FileSaver from "file-saver"; import FileSaver from "file-saver";
const QRCode = React.lazy(() => import("../../re-exports/react-qrcode-logo")); const QRCode = React.lazy(() => import("../re-exports/react-qrcode-logo"));
function RecoveryKeyDialog(props) { function RecoveryKeyDialog(props) {
const [key, setKey] = useState(); const [key, setKey] = useState();

View File

@@ -18,9 +18,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { Text, Flex, Box } from "@theme-ui/components"; import { Text, Flex, Box } from "@theme-ui/components";
import Dialog from "./dialog"; import Dialog from "../components/dialog";
import * as Icon from "../icons"; import * as Icon from "../components/icons";
import { showBuyDialog } from "../../common/dialog-controller"; import { showBuyDialog } from "../common/dialog-controller";
const features = [ const features = [
{ icon: Icon.Sync, title: "Instant private sync" }, { icon: Icon.Sync, title: "Instant private sync" },

View File

@@ -17,17 +17,17 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { Perform } from "../../common/dialog-controller"; import { Perform } from "../common/dialog-controller";
import Dialog from "./dialog"; import Dialog from "../components/dialog";
import { Button, Flex, Text } from "@theme-ui/components"; import { Button, Flex, Text } from "@theme-ui/components";
import { db } from "../../common/db"; import { db } from "../common/db";
import { import {
formatReminderTime, formatReminderTime,
Reminder Reminder
} from "@notesnook/core/collections/reminders"; } from "@notesnook/core/collections/reminders";
import IconTag from "../icon-tag"; import IconTag from "../components/icon-tag";
import { Clock, Refresh } from "../icons"; import { Clock, Refresh } from "../components/icons";
import Note from "../note"; import Note from "../components/note";
export type ReminderPreviewDialogProps = { export type ReminderPreviewDialogProps = {
onClose: Perform; onClose: Perform;

View File

@@ -18,9 +18,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { SettingsGroup } from "./types"; import { SettingsGroup } from "./types";
import { useStore as useSettingStore } from "../../../stores/setting-store"; import { useStore as useSettingStore } from "../../stores/setting-store";
import { useStore as useThemeStore } from "../../../stores/theme-store"; import { useStore as useThemeStore } from "../../stores/theme-store";
import { isDesktop } from "../../../utils/platform"; import { isDesktop } from "../../utils/platform";
import { AccentColors } from "./components/accent-colors"; import { AccentColors } from "./components/accent-colors";
export const AppearanceSettings: SettingsGroup[] = [ export const AppearanceSettings: SettingsGroup[] = [

View File

@@ -18,12 +18,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { SettingsGroup } from "./types"; import { SettingsGroup } from "./types";
import { useStore as useUserStore } from "../../../stores/user-store"; import { useStore as useUserStore } from "../../stores/user-store";
import { verifyAccount } from "../../../common"; import { verifyAccount } from "../../common";
import { import {
show2FARecoveryCodesDialog, show2FARecoveryCodesDialog,
showMultifactorDialog showMultifactorDialog
} from "../../../common/dialog-controller"; } from "../../common/dialog-controller";
export const AuthenticationSettings: SettingsGroup[] = [ export const AuthenticationSettings: SettingsGroup[] = [
{ {

View File

@@ -18,15 +18,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { SettingsGroup } from "./types"; import { SettingsGroup } from "./types";
import { useStore as useSettingStore } from "../../../stores/setting-store"; import { useStore as useSettingStore } from "../../stores/setting-store";
import { useStore as useAppStore } from "../../../stores/app-store"; import { useStore as useAppStore } from "../../stores/app-store";
import { useStore as useUserStore } from "../../../stores/user-store"; import { useStore as useUserStore } from "../../stores/user-store";
import { isUserPremium } from "../../../hooks/use-is-user-premium"; import { isUserPremium } from "../../hooks/use-is-user-premium";
import { createBackup, importBackup, verifyAccount } from "../../../common"; import { createBackup, importBackup, verifyAccount } from "../../common";
import { db } from "../../../common/db"; import { db } from "../../common/db";
import { exportNotes } from "../../../common/export"; import { exportNotes } from "../../common/export";
import { isDesktop, isTesting } from "../../../utils/platform"; import { isDesktop, isTesting } from "../../utils/platform";
import { desktop } from "../../../common/desktop-bridge"; import { desktop } from "../../common/desktop-bridge";
import { PATHS } from "@notesnook/desktop"; import { PATHS } from "@notesnook/desktop";
export const BackupExportSettings: SettingsGroup[] = [ export const BackupExportSettings: SettingsGroup[] = [

View File

@@ -19,9 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { DATE_FORMATS } from "@notesnook/core/common"; import { DATE_FORMATS } from "@notesnook/core/common";
import { SettingsGroup } from "./types"; import { SettingsGroup } from "./types";
import { useStore as useSettingStore } from "../../../stores/setting-store"; import { useStore as useSettingStore } from "../../stores/setting-store";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { isUserPremium } from "../../../hooks/use-is-user-premium"; import { isUserPremium } from "../../hooks/use-is-user-premium";
export const BehaviourSettings: SettingsGroup[] = [ export const BehaviourSettings: SettingsGroup[] = [
{ {

View File

@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { getAllAccents } from "@notesnook/theme"; import { getAllAccents } from "@notesnook/theme";
import { Flex } from "@theme-ui/components"; import { Flex } from "@theme-ui/components";
import AccentItem from "../../../accent-item"; import AccentItem from "../../../components/accent-item";
export function AccentColors() { export function AccentColors() {
return ( return (

View File

@@ -18,10 +18,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { Loading } from "../../../icons"; import { Loading } from "../../../components/icons";
import { Box, Flex, Link, Text } from "@theme-ui/components"; import { Box, Flex, Link, Text } from "@theme-ui/components";
import { getFormattedDate } from "@notesnook/common"; import { getFormattedDate } from "@notesnook/common";
import { db } from "../../../../common/db"; import { db } from "../../../common/db";
type Transaction = { type Transaction = {
order_id: string; order_id: string;

View File

@@ -17,14 +17,14 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { useStore as useAppStore } from "../../../../stores/app-store"; import { useStore as useAppStore } from "../../../stores/app-store";
import { useCallback, useRef, useState } from "react"; import { useCallback, useRef, useState } from "react";
import { useDropzone } from "react-dropzone"; import { useDropzone } from "react-dropzone";
import { Button, Flex, Input, Link, Text } from "@theme-ui/components"; import { Button, Flex, Input, Link, Text } from "@theme-ui/components";
import { pluralize } from "@notesnook/common"; import { pluralize } from "@notesnook/common";
import { db } from "../../../../common/db"; import { db } from "../../../common/db";
import { importFiles } from "../../../../utils/importer"; import { importFiles } from "../../../utils/importer";
import { CheckCircleOutline } from "../../../icons"; import { CheckCircleOutline } from "../../../components/icons";
export function Importer() { export function Importer() {
const [isDone, setIsDone] = useState(false); const [isDone, setIsDone] = useState(false);

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { Language, useSpellChecker } from "../../../../hooks/use-spell-checker"; import { Language, useSpellChecker } from "../../../hooks/use-spell-checker";
import { Checkbox, Input, Label } from "@theme-ui/components"; import { Checkbox, Input, Label } from "@theme-ui/components";
import { useCallback, useEffect, useState } from "react"; import { useCallback, useEffect, useState } from "react";
import { deleteItem } from "@notesnook/core/utils/array"; import { deleteItem } from "@notesnook/core/utils/array";

View File

@@ -17,16 +17,16 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { useStore as useUserStore } from "../../../../stores/user-store"; import { useStore as useUserStore } from "../../../stores/user-store";
import { Button, Flex, Text } from "@theme-ui/components"; import { Button, Flex, Text } from "@theme-ui/components";
import { useCallback, useMemo, useState } from "react"; import { useCallback, useMemo, useState } from "react";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { SUBSCRIPTION_STATUS } from "../../../../common/constants"; import { SUBSCRIPTION_STATUS } from "../../../common/constants";
import { db } from "../../../../common/db"; import { db } from "../../../common/db";
import { confirm, showBuyDialog } from "../../../../common/dialog-controller"; import { confirm, showBuyDialog } from "../../../common/dialog-controller";
import { TaskManager } from "../../../../common/task-manager"; import { TaskManager } from "../../../common/task-manager";
import { showToast } from "../../../../utils/toast"; import { showToast } from "../../../utils/toast";
import { Loading } from "../../../icons"; import { Loading } from "../../../components/icons";
import { Features } from "../../buy-dialog/features"; import { Features } from "../../buy-dialog/features";
const PROVIDER_MAP = { const PROVIDER_MAP = {
@@ -147,20 +147,19 @@ export function SubscriptionStatus() {
positiveButtonText: "Yes" positiveButtonText: "Yes"
}); });
if (cancelSubscription) { if (cancelSubscription) {
const result = await TaskManager.startTask({ await TaskManager.startTask({
type: "modal", type: "modal",
title: "Cancelling your subscription", title: "Cancelling your subscription",
subtitle: "Please wait...", subtitle: "Please wait...",
action: () => db.subscriptions?.cancel() action: () => db.subscriptions?.cancel()
}); })
if (result instanceof Error) { .catch((e) => showToast("error", e.message))
showToast("error", result.message); .then(() =>
} else { showToast(
showToast( "success",
"success", "Your subscription has been canceled."
"Your subscription has been canceled." )
); );
}
} }
}} }}
> >
@@ -177,20 +176,19 @@ export function SubscriptionStatus() {
positiveButtonText: "Yes" positiveButtonText: "Yes"
}); });
if (refundSubscription) { if (refundSubscription) {
const error = await TaskManager.startTask({ await TaskManager.startTask({
type: "modal", type: "modal",
title: "Requesting refund for your subscription", title: "Requesting refund for your subscription",
subtitle: "Please wait...", subtitle: "Please wait...",
action: () => db.subscriptions?.refund() action: () => db.subscriptions?.refund()
}); })
if (error instanceof Error) { .catch((e) => showToast("error", e.message))
showToast("error", error.message); .then(() =>
} else { showToast(
showToast( "success",
"success", "Your refund has been issued. Please wait 24 hours before reaching out to us in case you do not receive your funds."
"Your refund has been issued. Please wait 24 hours before reaching out to us in case you do not receive your funds." )
); );
}
} }
}} }}
> >

View File

@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { Box, Text } from "@theme-ui/components"; import { Box, Text } from "@theme-ui/components";
import { ANALYTICS_EVENTS } from "../../../../utils/analytics"; import { ANALYTICS_EVENTS } from "../../../utils/analytics";
const events = Object.values(ANALYTICS_EVENTS); const events = Object.values(ANALYTICS_EVENTS);
export function TrackingDetails() { export function TrackingDetails() {

View File

@@ -18,11 +18,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { Flex, Text } from "@theme-ui/components"; import { Flex, Text } from "@theme-ui/components";
import { User } from "../../../icons"; import { User } from "../../../components/icons";
import { useStore as useUserStore } from "../../../../stores/user-store"; import { useStore as useUserStore } from "../../../stores/user-store";
import ObjectID from "@notesnook/core/utils/object-id"; import ObjectID from "@notesnook/core/utils/object-id";
import { getFormattedDate } from "@notesnook/common"; import { getFormattedDate } from "@notesnook/common";
import { SUBSCRIPTION_STATUS } from "../../../../common/constants"; import { SUBSCRIPTION_STATUS } from "../../../common/constants";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { useMemo } from "react"; import { useMemo } from "react";

View File

@@ -18,8 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { SettingsGroup } from "./types"; import { SettingsGroup } from "./types";
import { useStore as useSettingStore } from "../../../stores/setting-store"; import { useStore as useSettingStore } from "../../stores/setting-store";
import { type DesktopIntegrationSettings as DesktopIntegrationSettingsType } from "../../../hooks/use-desktop-integration";
export const DesktopIntegrationSettings: SettingsGroup[] = [ export const DesktopIntegrationSettings: SettingsGroup[] = [
{ {
@@ -63,7 +62,7 @@ export const DesktopIntegrationSettings: SettingsGroup[] = [
listener listener
), ),
isHidden: (desktopIntegration) => isHidden: (desktopIntegration) =>
!(desktopIntegration as DesktopIntegrationSettingsType)?.autoStart, !(desktopIntegration as any)?.autoStart,
components: [ components: [
{ {
type: "toggle", type: "toggle",

View File

@@ -22,12 +22,12 @@ import {
editorConfig, editorConfig,
onEditorConfigChange, onEditorConfigChange,
setEditorConfig setEditorConfig
} from "../../editor/context"; } from "../../components/editor/context";
import { useStore as useSettingStore } from "../../../stores/setting-store"; import { useStore as useSettingStore } from "../../stores/setting-store";
import { getFonts } from "@notesnook/editor"; import { getFonts } from "@notesnook/editor";
import { useSpellChecker } from "../../../hooks/use-spell-checker"; import { useSpellChecker } from "../../hooks/use-spell-checker";
import { SpellCheckerLanguages } from "./components/spell-checker-languages"; import { SpellCheckerLanguages } from "./components/spell-checker-languages";
import { isDesktop } from "../../../utils/platform"; import { isDesktop } from "../../utils/platform";
export const EditorSettings: SettingsGroup[] = [ export const EditorSettings: SettingsGroup[] = [
{ {

View File

@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { Flex, Text, Button, Input, Switch } from "@theme-ui/components"; import { Flex, Text, Button, Input, Switch } from "@theme-ui/components";
import Dialog from "../dialog"; import Dialog from "../../components/dialog";
import { import {
About, About,
Account, Account,
@@ -37,21 +37,21 @@ import {
Pro, Pro,
ShieldLock, ShieldLock,
Sync Sync
} from "../../icons"; } from "../../components/icons";
import { Perform } from "../../../common/dialog-controller"; import { Perform } from "../../common/dialog-controller";
import NavigationItem from "../../navigation-menu/navigation-item"; import NavigationItem from "../../components/navigation-menu/navigation-item";
import { FlexScrollContainer } from "../../scroll-container"; import { FlexScrollContainer } from "../../components/scroll-container";
import { useCallback, useEffect, useState } from "react"; import { useCallback, useEffect, useState } from "react";
import { SectionGroup, SectionKeys, Setting, SettingsGroup } from "./types"; import { SectionGroup, SectionKeys, Setting, SettingsGroup } from "./types";
import { ProfileSettings } from "./profile-settings"; import { ProfileSettings } from "./profile-settings";
import { AuthenticationSettings } from "./auth-settings"; import { AuthenticationSettings } from "./auth-settings";
import { useIsUserPremium } from "../../../hooks/use-is-user-premium"; import { useIsUserPremium } from "../../hooks/use-is-user-premium";
import { store as userstore } from "../../../stores/user-store"; import { store as userstore } from "../../stores/user-store";
import { SyncSettings } from "./sync-settings"; import { SyncSettings } from "./sync-settings";
import { BehaviourSettings } from "./behaviour-settings"; import { BehaviourSettings } from "./behaviour-settings";
import { DesktopIntegrationSettings } from "./desktop-integration-settings"; import { DesktopIntegrationSettings } from "./desktop-integration-settings";
import { NotificationsSettings } from "./notifications-settings"; import { NotificationsSettings } from "./notifications-settings";
import { isDesktop } from "../../../utils/platform"; import { isDesktop } from "../../utils/platform";
import { BackupExportSettings } from "./backup-export-settings"; import { BackupExportSettings } from "./backup-export-settings";
import { ImporterSettings } from "./importer-settings"; import { ImporterSettings } from "./importer-settings";
import { VaultSettings } from "./vault-settings"; import { VaultSettings } from "./vault-settings";

View File

@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { SettingsGroup } from "./types"; import { SettingsGroup } from "./types";
import { useStore as useSettingStore } from "../../../stores/setting-store"; import { useStore as useSettingStore } from "../../stores/setting-store";
export const NotificationsSettings: SettingsGroup[] = [ export const NotificationsSettings: SettingsGroup[] = [
{ {

View File

@@ -18,13 +18,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { SettingsGroup } from "./types"; import { SettingsGroup } from "./types";
import { appVersion } from "../../../utils/version"; import { appVersion } from "../../utils/version";
import { writeText } from "clipboard-polyfill"; import { writeText } from "clipboard-polyfill";
import { showToast } from "../../../utils/toast"; import { showToast } from "../../utils/toast";
import { checkForUpdate } from "../../../utils/updater"; import { checkForUpdate } from "../../utils/updater";
import { isMacStoreApp } from "../../../utils/platform"; import { isMacStoreApp } from "../../utils/platform";
import { showIssueDialog } from "../../../common/dialog-controller"; import { showIssueDialog } from "../../common/dialog-controller";
import { clearLogs, downloadLogs } from "../../../utils/logger"; import { clearLogs, downloadLogs } from "../../utils/logger";
export const AboutSettings: SettingsGroup[] = [ export const AboutSettings: SettingsGroup[] = [
{ {

View File

@@ -18,13 +18,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { SettingsGroup } from "./types"; import { SettingsGroup } from "./types";
import { useStore as useSettingStore } from "../../../stores/setting-store"; import { useStore as useSettingStore } from "../../stores/setting-store";
import { useStore as useUserStore } from "../../../stores/user-store"; import { useStore as useUserStore } from "../../stores/user-store";
import { getPlatform, isDesktop } from "../../../utils/platform"; import { getPlatform, isDesktop } from "../../utils/platform";
import { db } from "../../../common/db"; import { db } from "../../common/db";
import { showPromptDialog } from "../../../common/dialog-controller"; import { showPromptDialog } from "../../common/dialog-controller";
import Config from "../../../utils/config"; import Config from "../../utils/config";
import { showToast } from "../../../utils/toast"; import { showToast } from "../../utils/toast";
import { TrackingDetails } from "./components/tracking-details"; import { TrackingDetails } from "./components/tracking-details";
export const PrivacySettings: SettingsGroup[] = [ export const PrivacySettings: SettingsGroup[] = [

View File

@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { import {
useStore as useUserStore, useStore as useUserStore,
store as userstore store as userstore
} from "../../../stores/user-store"; } from "../../stores/user-store";
import { SettingsGroup } from "./types"; import { SettingsGroup } from "./types";
import { import {
showClearSessionsConfirmation, showClearSessionsConfirmation,
@@ -29,11 +29,11 @@ import {
showLogoutConfirmation, showLogoutConfirmation,
showPasswordDialog, showPasswordDialog,
showRecoveryKeyDialog showRecoveryKeyDialog
} from "../../../common/dialog-controller"; } from "../../common/dialog-controller";
import { db } from "../../../common/db"; import { db } from "../../common/db";
import { showToast } from "../../../utils/toast"; import { showToast } from "../../utils/toast";
import { UserProfile } from "./components/user-profile"; import { UserProfile } from "./components/user-profile";
import { verifyAccount } from "../../../common"; import { verifyAccount } from "../../common";
export const ProfileSettings: SettingsGroup[] = [ export const ProfileSettings: SettingsGroup[] = [
{ {

View File

@@ -19,11 +19,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { SettingsGroup } from "./types"; import { SettingsGroup } from "./types";
import { SubscriptionStatus } from "./components/subscription-status"; import { SubscriptionStatus } from "./components/subscription-status";
import { showToast } from "../../../utils/toast"; import { showToast } from "../../utils/toast";
import { db } from "../../../common/db"; import { db } from "../../common/db";
import { BillingHistory } from "./components/billing-history"; import { BillingHistory } from "./components/billing-history";
import { useStore as useUserStore } from "../../../stores/user-store"; import { useStore as useUserStore } from "../../stores/user-store";
import { isUserSubscribed } from "../../../hooks/use-is-user-premium"; import { isUserSubscribed } from "../../hooks/use-is-user-premium";
export const SubscriptionSettings: SettingsGroup[] = [ export const SubscriptionSettings: SettingsGroup[] = [
{ {

View File

@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { SettingsGroup } from "./types"; import { SettingsGroup } from "./types";
import { useStore as useAppStore } from "../../../stores/app-store"; import { useStore as useAppStore } from "../../stores/app-store";
export const SyncSettings: SettingsGroup[] = [ export const SyncSettings: SettingsGroup[] = [
{ {

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { Icon } from "../../icons"; import { Icon } from "../../components/icons";
export type SectionKeys = export type SectionKeys =
| "profile" | "profile"

View File

@@ -18,12 +18,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { SettingsGroup } from "./types"; import { SettingsGroup } from "./types";
import { useStore as useAppStore } from "../../../stores/app-store"; import { useStore as useAppStore } from "../../stores/app-store";
import { useStore as useNotesStore } from "../../../stores/note-store"; import { useStore as useNotesStore } from "../../stores/note-store";
import { hashNavigate } from "../../../navigation"; import { hashNavigate } from "../../navigation";
import Vault from "../../../common/vault"; import Vault from "../../common/vault";
import { showToast } from "../../../utils/toast"; import { showToast } from "../../utils/toast";
import { db } from "../../../common/db"; import { db } from "../../common/db";
export const VaultSettings: SettingsGroup[] = [ export const VaultSettings: SettingsGroup[] = [
{ {

View File

@@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { Button, Flex, FlexProps, Text } from "@theme-ui/components"; import { Button, Flex, FlexProps, Text } from "@theme-ui/components";
import { Perform } from "../../common/dialog-controller"; import { Perform } from "../common/dialog-controller";
import Dialog from "./dialog"; import Dialog from "../components/dialog";
import { import {
getAllTools, getAllTools,
getToolDefinition, getToolDefinition,
@@ -51,8 +51,8 @@ import { CSS } from "@dnd-kit/utilities";
import { createPortal } from "react-dom"; import { createPortal } from "react-dom";
import { getId } from "@notesnook/core/utils/id"; import { getId } from "@notesnook/core/utils/id";
import { Label, Radio } from "@theme-ui/components"; import { Label, Radio } from "@theme-ui/components";
import { db } from "../../common/db"; import { db } from "../common/db";
import { useToolbarConfig } from "../editor/context"; import { useToolbarConfig } from "../components/editor/context";
import { import {
getAllPresets, getAllPresets,
getCurrentPreset, getCurrentPreset,
@@ -60,10 +60,10 @@ import {
getPresetTools, getPresetTools,
Preset, Preset,
PresetId PresetId
} from "../../common/toolbar-config"; } from "../common/toolbar-config";
import { showToast } from "../../utils/toast"; import { showToast } from "../utils/toast";
import { isUserPremium } from "../../hooks/use-is-user-premium"; import { isUserPremium } from "../hooks/use-is-user-premium";
import { Pro } from "../icons"; import { Pro } from "../components/icons";
export type ToolbarConfigDialogProps = { export type ToolbarConfigDialogProps = {
onClose: Perform; onClose: Perform;
}; };

View File

@@ -40,7 +40,7 @@ import { showToast } from "../utils/toast";
import AuthContainer from "../components/auth-container"; import AuthContainer from "../components/auth-container";
import { isTesting } from "../utils/platform"; import { isTesting } from "../utils/platform";
import { useTimer } from "../hooks/use-timer"; import { useTimer } from "../hooks/use-timer";
import { AuthenticatorType } from "../components/dialogs/mfa/types"; import { AuthenticatorType } from "../dialogs/mfa/types";
import { import {
showLoadingDialog, showLoadingDialog,
showLogoutConfirmation showLogoutConfirmation