Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: convert home view to typescript (rename to all-notes)

Abdullah Attab542680e7a71
diff --git a/apps/web/src/navigation/routes.tsx b/apps/web/src/navigation/routes.tsx
index d8cb0f2ad..d7ebf72b2 100644
--- a/apps/web/src/navigation/routes.tsx
+++ b/apps/web/src/navigation/routes.tsx
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { db } from "../common/db";
-import Home from "../views/home";
+import AllNotes from "../views/all-notes";
import Notebooks from "../views/notebooks";
import Notes from "../views/notes";
import Search from "../views/search";
@@ -52,7 +52,7 @@ const routes = defineRoutes({
key: "home",
type: "notes",
title: "Notes",
- component: Home,
+ component: AllNotes,
buttons: {
create: CREATE_BUTTON_MAP.notes,
search: {
diff --git a/apps/web/src/views/home.jsx b/apps/web/src/views/all-notes.tsx
similarity index 86%
rename from apps/web/src/views/home.jsx
rename to apps/web/src/views/all-notes.tsx
index 01eab7fab..90e8caa97 100644
--- a/apps/web/src/views/home.jsx
+++ b/apps/web/src/views/all-notes.tsx
@@ -17,10 +17,9 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import React, { useEffect, useState } from "react";
-import { useStore, store } from "../stores/note-store";
+import React, { useEffect } from "react";
+import { useStore } from "../stores/note-store";
import ListContainer from "../components/list-container";
-import { db } from "../common/db";
import { hashNavigate } from "../navigation";
import useNavigate from "../hooks/use-navigate";
import Placeholder from "../components/placeholders";
@@ -36,23 +35,16 @@ function Home() {
useEffect(() => {
(async function () {
- const initialized = db.notes.initialized;
- if (!initialized || !notes.length) {
- store.refresh();
- }
// const note = db.notes.note("62bc3f28a1a1a10000707077").data;
// const data = await db.content.raw(note.contentId);
-
// const note2 = db.notes.note("62bc3f1ca1a1a10000707075").data;
// const data2 = await db.content.raw(note2.contentId);
-
// const data3 = { ...data, conflicted: data2 };
-
// await db.content.add(data3);
// await db.notes.add({ id: note.id, conflicted: true, resolved: false });
// console.log(data3);
})();
- }, [notes.length]);
+ }, []);
return (
<ListContainer
@@ -63,7 +55,6 @@ function Home() {
items={notes}
placeholder={<Placeholder context="notes" />}
button={{
- content: "Make a new note",
onClick: () =>
hashNavigate("/notes/create", { replace: true, addNonce: true })
}}