diff --git a/apps/web/src/common/selectionoptions.js b/apps/web/src/common/selectionoptions.js
index b7ae05e1f..f23d89cf4 100644
--- a/apps/web/src/common/selectionoptions.js
+++ b/apps/web/src/common/selectionoptions.js
@@ -6,7 +6,7 @@ import { store as editorStore } from "../stores/editor-store";
import { store as trashStore } from "../stores/trash-store";
import { db } from "./index";
import { showMoveNoteDialog } from "../components/dialogs/movenotedialog";
-import { confirm } from "../components/dialogs/confirm";
+import { confirm, showDeleteConfirmation } from "../components/dialogs/confirm";
function createOption(key, icon, onClick) {
return {
@@ -26,12 +26,10 @@ function createOptions(options = []) {
const DeleteOption = createOption("deleteOption", Icon.Trash, async function (
state
) {
- if (
- !(await confirm(Icon.Trash, "Delete", "Are you sure you want to proceed?"))
- )
- return;
const item = state.selectedItems[0];
+ if (!(await showDeleteConfirmation(item.type, true))) return;
+
var isAnyNoteOpened = false;
const items = state.selectedItems.map((item) => {
if (item.id === editorStore.get().session.id) isAnyNoteOpened = true;
diff --git a/apps/web/src/components/dialogs/add-notebook-dialog.js b/apps/web/src/components/dialogs/add-notebook-dialog.js
index b5370ad00..2651f5b54 100644
--- a/apps/web/src/components/dialogs/add-notebook-dialog.js
+++ b/apps/web/src/components/dialogs/add-notebook-dialog.js
@@ -1,5 +1,5 @@
import React from "react";
-import { Flex, Box, Text, Button as RebassButton } from "rebass";
+import { Flex, Box, Button as RebassButton } from "rebass";
import { Input } from "@rebass/forms";
import * as Icon from "../icons";
import Dialog, { showDialog } from "./dialog";
@@ -86,10 +86,13 @@ class AddNotebookDialog extends React.Component {
return (
);
}
@@ -51,7 +46,7 @@ function ExportDialog(props) {
export function showExportDialog(noteId) {
return showDialog((perform) => (
perform(false)}
exportNote={async (format) => {
diff --git a/apps/web/src/components/dialogs/logindialog.js b/apps/web/src/components/dialogs/logindialog.js
index a69966950..750cda712 100644
--- a/apps/web/src/components/dialogs/logindialog.js
+++ b/apps/web/src/components/dialogs/logindialog.js
@@ -1,5 +1,5 @@
import React, { useState } from "react";
-import { Box, Button, Text } from "rebass";
+import { Flex, Button, Text } from "rebass";
import Input from "../inputs";
import * as Icon from "../icons";
import Dialog, { showDialog } from "./dialog";
@@ -18,19 +18,38 @@ function LoginDialog(props) {
return (
);
}
diff --git a/apps/web/src/components/dialogs/move-note-dialog.js b/apps/web/src/components/dialogs/move-note-dialog.js
index d45ac5a72..49e779fc4 100644
--- a/apps/web/src/components/dialogs/move-note-dialog.js
+++ b/apps/web/src/components/dialogs/move-note-dialog.js
@@ -1,5 +1,5 @@
import React from "react";
-import { Flex, Box, Text } from "rebass";
+import { Flex, Box, Text, Button } from "rebass";
import { Input } from "@rebass/forms";
import * as Icon from "../icons";
import { db } from "../../common";
@@ -14,73 +14,32 @@ class MoveDialog extends React.Component {
selectedNotebook;
selectedTopic;
state = {
- items: db.notebooks.all,
- type: "notebooks",
- title: "Notebooks",
- mode: "read",
+ currentOpenedIndex: -1,
+ notebooks: db.notebooks.all,
};
render() {
- const { items, type, title, mode } = this.state;
+ const { notebooks, currentOpenedIndex } = this.state;
const props = this.props;
return (
@@ -210,3 +184,35 @@ export function showMoveNoteDialog(noteIds) {
/>
));
}
+
+function Item(props) {
+ const { icon: Icon, indent = 0, title, totalNotes, onClick, action } = props;
+ return (
+
+
+
+
+ {title}
+
+
+ {action || (
+
+ {totalNotes + " Notes"}
+
+ )}
+
+ );
+}
diff --git a/apps/web/src/components/dialogs/password-dialog.js b/apps/web/src/components/dialogs/password-dialog.js
index 94c704e3e..e36fe908c 100644
--- a/apps/web/src/components/dialogs/password-dialog.js
+++ b/apps/web/src/components/dialogs/password-dialog.js
@@ -20,6 +20,7 @@ function PasswordDialog(props) {