A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
web: migrate views to typescript
Abdullah Atta20835e1fb385
diff --git a/apps/web/src/stores/note-store.js b/apps/web/src/stores/note-store.jsindex 21dfd86e9..077b39006 100644--- a/apps/web/src/stores/note-store.js+++ b/apps/web/src/stores/note-store.js@@ -34,6 +34,9 @@ import { groupArray } from "@notesnook/core/utils/grouping";*/class NoteStore extends BaseStore {notes = [];+ /**+ * @type {{ type: "tag" | "color" | "notebook" | "topic" | "favorite" | "monographs", notes: any[] } | undefined}+ */context = undefined;selectedNote = 0;nonce = 0;diff --git a/apps/web/src/views/email-confirmed.jsx b/apps/web/src/views/email-confirmed.tsxsimilarity index 98%rename from apps/web/src/views/email-confirmed.jsxrename to apps/web/src/views/email-confirmed.tsxindex 8f3876ca0..ccdec5b74 100644--- a/apps/web/src/views/email-confirmed.jsx+++ b/apps/web/src/views/email-confirmed.tsx@@ -96,7 +96,7 @@ function EmailConfirmed() {p={5}sx={{ flexDirection: "column", justifyContent: "center" }}>- <BlogPromoBanner link="https://blog.notesnook.com/why-another-note-taking-app/" />+ <BlogPromoBanner /></Flex></Flex></ThemeProvider>@@ -152,7 +152,6 @@ function BlogPromoBanner() {{social.map((account) => (<account.iconkey={account.title}- hoverColor={account.hoverColor}title={account.title}onClick={() => {window.open(account.link, "_blank");diff --git a/apps/web/src/views/notebooks.jsx b/apps/web/src/views/notebooks.tsxsimilarity index 97%rename from apps/web/src/views/notebooks.jsxrename to apps/web/src/views/notebooks.tsxindex 201c26fa7..01afa5007 100644--- a/apps/web/src/views/notebooks.jsx+++ b/apps/web/src/views/notebooks.tsx@@ -37,7 +37,6 @@ function Notebooks() {items={notebooks}placeholder={<Placeholder context="notebooks" />}button={{- content: "Create a notebook",onClick: () => hashNavigate("/notebooks/create")}}/>diff --git a/apps/web/src/views/notes.jsx b/apps/web/src/views/notes.tsxsimilarity index 95%rename from apps/web/src/views/notes.jsxrename to apps/web/src/views/notes.tsxindex c91b899aa..8b457b440 100644--- a/apps/web/src/views/notes.jsx+++ b/apps/web/src/views/notes.tsx@@ -45,7 +45,7 @@ function Notes() {refresh={refreshContext}compact={isCompact}context={{ ...context, notes: undefined }}- items={groupArray(context.notes, db.settings.getGroupOptions(type))}+ items={groupArray(context.notes, db.settings?.getGroupOptions(type))}placeholder={<Placeholdercontext={@@ -58,7 +58,6 @@ function Notes() {/>}button={{- content: "Make a new note",onClick: () =>hashNavigate("/notes/create", { addNonce: true, replace: true })}}diff --git a/apps/web/src/views/tags.jsx b/apps/web/src/views/tags.tsxsimilarity index 100%rename from apps/web/src/views/tags.jsxrename to apps/web/src/views/tags.tsxdiff --git a/apps/web/src/views/trash.jsx b/apps/web/src/views/trash.tsxsimilarity index 90%rename from apps/web/src/views/trash.jsxrename to apps/web/src/views/trash.tsxindex faef92349..0ebaf67f8 100644--- a/apps/web/src/views/trash.jsx+++ b/apps/web/src/views/trash.tsx@@ -39,9 +39,6 @@ function Trash() {placeholder={<Placeholder context="trash" />}items={items}button={{- show: !!items.length,- content: "Clear Trash",- icon: TrashIcon,onClick: function () {confirm({title: "Clear Trash",@@ -55,10 +52,11 @@ function Trash() {await clearTrash();showToast("success", "Trash cleared successfully!");} catch (e) {- showToast(- "error",- `Could not clear trash. Error: ${e.message}`- );+ if (e instanceof Error)+ showToast(+ "error",+ `Could not clear trash. Error: ${e.message}`+ );}}});