From aa8a257c35f87ff1ccbe5d3bd90c2b2c4785356d Mon Sep 17 00:00:00 2001 From: thecodrr Date: Mon, 12 Jul 2021 08:33:30 +0500 Subject: [PATCH] refactor: fix all warnings --- apps/web/src/common/dialogcontroller.js | 1 - apps/web/src/common/index.js | 1 - apps/web/src/components/dialogs/buydialog.js | 1 - .../src/components/dialogs/password-dialog.js | 1 - apps/web/src/components/diff-viewer/index.js | 5 +- apps/web/src/stores/app-store.js | 1 - apps/web/src/views/email-confirmed.js | 144 +++++++++--------- apps/web/src/views/search.js | 2 +- 8 files changed, 74 insertions(+), 82 deletions(-) diff --git a/apps/web/src/common/dialogcontroller.js b/apps/web/src/common/dialogcontroller.js index 8db5144c8..989a6db6a 100644 --- a/apps/web/src/common/dialogcontroller.js +++ b/apps/web/src/common/dialogcontroller.js @@ -7,7 +7,6 @@ import { store as notebookStore } from "../stores/notebook-store"; import { store as appStore } from "../stores/app-store"; import { db } from "./db"; import { showToast } from "../utils/toast"; -import { CHECK_IDS } from "notes-core/common"; import { Flex, Text } from "rebass"; import * as Icon from "../components/icons"; import download from "../utils/download"; diff --git a/apps/web/src/common/index.js b/apps/web/src/common/index.js index 7bb59c227..49b229130 100644 --- a/apps/web/src/common/index.js +++ b/apps/web/src/common/index.js @@ -9,7 +9,6 @@ import { showPasswordDialog, } from "../common/dialog-controller"; import Config from "../utils/config"; -import { store as userstore } from "../stores/user-store"; import { hashNavigate, getCurrentHash } from "../navigation"; import { db } from "./db"; import { sanitizeFilename } from "../utils/filename"; diff --git a/apps/web/src/components/dialogs/buydialog.js b/apps/web/src/components/dialogs/buydialog.js index 617146f8e..b95ddcf2d 100644 --- a/apps/web/src/components/dialogs/buydialog.js +++ b/apps/web/src/components/dialogs/buydialog.js @@ -3,7 +3,6 @@ import { Text, Flex, Button } from "rebass"; import Dialog from "./dialog"; import * as Icon from "../icons"; import { useStore as useUserStore } from "../../stores/user-store"; -import { useStore as useThemeStore } from "../../stores/theme-store"; import { getCouponData, upgrade } from "../../common/checkout"; import { showLogInDialog } from "../../common/dialog-controller"; import { ReactComponent as Personalization } from "../../assets/accent.svg"; diff --git a/apps/web/src/components/dialogs/password-dialog.js b/apps/web/src/components/dialogs/password-dialog.js index edc29be1e..bbda3548f 100644 --- a/apps/web/src/components/dialogs/password-dialog.js +++ b/apps/web/src/components/dialogs/password-dialog.js @@ -4,7 +4,6 @@ import Dialog from "./dialog"; import Field from "../field"; import { Checkbox, Label } from "@rebass/forms"; -const requiredValues = ["password", "newPassword", "oldPassword"]; function PasswordDialog(props) { const { type, checks } = props; const [error, setError] = useState(); diff --git a/apps/web/src/components/diff-viewer/index.js b/apps/web/src/components/diff-viewer/index.js index e529fea93..66b8c9720 100644 --- a/apps/web/src/components/diff-viewer/index.js +++ b/apps/web/src/components/diff-viewer/index.js @@ -1,4 +1,4 @@ -import React, { useState, useEffect, useCallback } from "react"; +import { useState, useEffect, useCallback } from "react"; import { Flex, Box, Text, Button } from "rebass"; import * as Icon from "../icons"; import ContentToggle from "./content-toggle"; @@ -6,7 +6,6 @@ import { store as notesStore } from "../../stores/note-store"; import { db } from "../../common/db"; import { useStore as useAppStore } from "../../stores/app-store"; import { useStore as useThemeStore } from "../../stores/theme-store"; -import { useStore as useUserStore } from "../../stores/user-store"; import { useStore as useEditorStore } from "../../stores/editor-store"; import { hashNavigate } from "../../navigation"; import HTMLDiffer from "./differ"; @@ -127,7 +126,7 @@ function DiffViewer(props) { conflicts = undefined; currentConflict = undefined; })(); - }, []); + }, [noteId, resolveConflict]); useEffect(() => { let cssPath = ""; diff --git a/apps/web/src/stores/app-store.js b/apps/web/src/stores/app-store.js index fa8268986..e1bed0090 100644 --- a/apps/web/src/stores/app-store.js +++ b/apps/web/src/stores/app-store.js @@ -3,7 +3,6 @@ import { db } from "../common/db"; import { store as noteStore } from "./note-store"; import { store as notebookStore } from "./notebook-store"; import { store as trashStore } from "./trash-store"; -import { store as editorStore } from "./editor-store"; import { store as tagStore } from "./tag-store"; import BaseStore from "./index"; import { isMobile } from "../utils/dimensions"; diff --git a/apps/web/src/views/email-confirmed.js b/apps/web/src/views/email-confirmed.js index 1353e0c0b..5b8d46ecc 100644 --- a/apps/web/src/views/email-confirmed.js +++ b/apps/web/src/views/email-confirmed.js @@ -1,8 +1,6 @@ -import React, { useEffect } from "react"; +import { useEffect } from "react"; import { Button, Flex, Text } from "rebass"; import ThemeProvider from "../components/theme-provider"; -import { db } from "../common/db"; -import { showBuyDialog } from "../common/dialog-controller"; import { trackEvent } from "../utils/analytics"; import { useQueryParams } from "../navigation"; @@ -107,74 +105,74 @@ function BlogPromoBanner(props) { ); } -function SaleBanner(props) { - const { discount, coupon, userId } = props; +// function SaleBanner(props) { +// const { discount, coupon, userId } = props; - return ( - - - We started out building Notesnook in November 2019. Our mission was to - make privacy simple. It is one thing to say,{" "} - - "Privacy is our basic right" - {" "} - and quite another to actually prove it. -
- Almost 1 and a half year later, we are here with over 2000 users, 5000+ - downloads on Google Play Store, 10,000+ encrypted notes, and 100+ - members in our Discord community; all proof that{" "} - - privacy matters. - -
-
- - In celebration of this happy day, we are giving a special discount to - all our new members. - - - {discount}% OFF if you subscribe today! - - - - Big companies say, "X feature won't be possible if we went - zero-knowledge." We are here to call them out. Your contribution will - help us prove that giving up on privacy is just an excuse to rip users - off, sell their data and make money. - - *Use code {coupon} at checkout to get your discount. - - - ** Only the first 10 people get to claim the discount. Be the first. - - -
- ); -} +// return ( +// +// +// We started out building Notesnook in November 2019. Our mission was to +// make privacy simple. It is one thing to say,{" "} +// +// "Privacy is our basic right" +// {" "} +// and quite another to actually prove it. +//
+// Almost 1 and a half year later, we are here with over 2000 users, 5000+ +// downloads on Google Play Store, 10,000+ encrypted notes, and 100+ +// members in our Discord community; all proof that{" "} +// +// privacy matters. +// +//
+//
+// +// In celebration of this happy day, we are giving a special discount to +// all our new members. +// +// +// {discount}% OFF if you subscribe today! +// +// +// +// Big companies say, "X feature won't be possible if we went +// zero-knowledge." We are here to call them out. Your contribution will +// help us prove that giving up on privacy is just an excuse to rip users +// off, sell their data and make money. +// +// *Use code {coupon} at checkout to get your discount. +// +// +// ** Only the first 10 people get to claim the discount. Be the first. +// +// +//
+// ); +// } diff --git a/apps/web/src/views/search.js b/apps/web/src/views/search.js index 3116b379e..b916179ef 100644 --- a/apps/web/src/views/search.js +++ b/apps/web/src/views/search.js @@ -1,4 +1,4 @@ -import React, { useEffect, useMemo, useState } from "react"; +import { useMemo, useState } from "react"; import ListContainer from "../components/list-container"; import SearchPlaceholder from "../components/placeholders/search-placeholder"; import { db } from "../common/db";