Skip to content

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

fix: #142

thecodrr6062ed176896
diff --git a/apps/web/src/components/dialogs/logindialog.js b/apps/web/src/components/dialogs/logindialog.js
index ded8bdf8b..0f3676a78 100644
--- a/apps/web/src/components/dialogs/logindialog.js
+++ b/apps/web/src/components/dialogs/logindialog.js
@@ -11,8 +11,8 @@ import Dropper from "../dropper";
function LoginDialog(props) {
const { onClose } = props;
const [error, setError] = useState();
- const isLoggingIn = useStore(store => store.isLoggingIn);
- const login = useStore(store => store.login);
+ const isLoggingIn = useStore((store) => store.isLoggingIn);
+ const login = useStore((store) => store.login);
const form = { error: true };
return (
@@ -31,8 +31,8 @@ function LoginDialog(props) {
if (form.error) return;
login(form)
.then(onClose)
- .catch(e => setError(e.message));
- }
+ .catch((e) => setError(e.message));
+ },
}}
>
<Box mt={1}>
@@ -50,5 +50,5 @@ function LoginDialog(props) {
}
export const showLogInDialog = () => {
- return showDialog(perform => <LoginDialog onClose={() => perform()} />);
+ return showDialog((perform) => <LoginDialog onClose={() => perform()} />);
};
diff --git a/apps/web/src/components/navigation-menu/index.js b/apps/web/src/components/navigation-menu/index.js
index 84b650c5f..dfca820db 100644
--- a/apps/web/src/components/navigation-menu/index.js
+++ b/apps/web/src/components/navigation-menu/index.js
@@ -2,7 +2,7 @@ import React, { useEffect } from "react";
import { Box } from "rebass";
import RootNavigator, {
bottomRoutes,
- routes
+ routes,
} from "../../navigation/navigators/rootnavigator";
import { usePersistentState } from "../../utils/hooks";
import { useStore } from "../../stores/app-store";
@@ -17,9 +17,9 @@ import { objectMap } from "../../utils/object";
function NavigationMenu(props) {
const { toggleNavigationContainer } = props;
const [selectedRoute, setSelectedRoute] = usePersistentState("route", "home");
- const isFocusMode = useAppStore(store => store.isFocusMode);
- const colors = useStore(store => store.colors);
- const isSideMenuOpen = useStore(store => store.isSideMenuOpen);
+ const isFocusMode = useAppStore((store) => store.isFocusMode);
+ const colors = useStore((store) => store.colors);
+ const isSideMenuOpen = useStore((store) => store.isSideMenuOpen);
useEffect(() => {
RootNavigator.navigate(selectedRoute);
@@ -33,7 +33,7 @@ function NavigationMenu(props) {
initial={{ opacity: 1 }}
animate={{
opacity: isFocusMode ? 0 : 1,
- visibility: isFocusMode ? "hidden" : "visible"
+ visibility: isFocusMode ? "hidden" : "visible",
}}
transition={{ duration: 0.3, ease: "easeOut" }}
sx={{
@@ -42,7 +42,7 @@ function NavigationMenu(props) {
minWidth: ["85%", 50, 50],
maxWidth: ["85%", 50, 50],
display: [isSideMenuOpen ? "flex" : "none", "flex", "flex"],
- position: ["absolute", "relative", "relative"]
+ position: ["absolute", "relative", "relative"],
}}
bg={"background"}
px={0}
@@ -52,7 +52,7 @@ function NavigationMenu(props) {
overflow: "scroll",
scrollbarWidth: "none",
"::-webkit-scrollbar": { width: 0, height: 0 },
- msOverflowStyle: "none"
+ msOverflowStyle: "none",
}}
>
{objectMap(routes, (_, item) => (
@@ -67,14 +67,14 @@ function NavigationMenu(props) {
}}
/>
))}
- {colors.map(color => {
+ {colors.map((color) => {
return (
<NavItem
onSelected={async () => {
setSelectedRoute(undefined);
RootNavigator.navigate("color", {
title: toTitleCase(color.title),
- context: { type: "color", colors: [color.title] }
+ context: { type: "color", colors: [color.title] },
});
}}
key={color.title}
@@ -82,19 +82,19 @@ function NavigationMenu(props) {
color: COLORS[color.title],
title: toTitleCase(color.title),
icon: Icon.Circle,
- count: color.noteIds.length
+ count: color.noteIds.length,
}}
/>
);
})}
</Box>
<Box>
- {Object.values(bottomRoutes).map(item => (
+ {Object.values(bottomRoutes).map((item) => (
<NavItem
onSelected={async () => {
- const shouldSelect =
- (item.onClick && (await item.onClick())) ||
- (item.component && RootNavigator.navigate(item.key));
+ const shouldSelect = item.onClick
+ ? await item.onClick()
+ : item.component && RootNavigator.navigate(item.key);
if (shouldSelect) setSelectedRoute(item.key);
}}
key={item.key}
diff --git a/apps/web/src/navigation/navigators/rootnavigator.js b/apps/web/src/navigation/navigators/rootnavigator.js
index 21dc6425f..6c32fe0ea 100644
--- a/apps/web/src/navigation/navigators/rootnavigator.js
+++ b/apps/web/src/navigation/navigators/rootnavigator.js
@@ -5,7 +5,7 @@ import {
NotebooksContainer,
TagsContainer,
Notes,
- Account
+ Account,
} from "../../views";
import * as Icon from "../../components/icons";
import { createRoute, createNormalRoute, createDeadRoute } from "../routes";
@@ -18,11 +18,11 @@ import { showLogInDialog } from "../../components/dialogs/logindialog";
export const bottomRoutes = {
...createDeadRoute("nightmode", Icon.Theme, {
- onClick: () => themeStore.toggleNightMode()
+ onClick: () => themeStore.toggleNightMode(),
}),
...createDeadRoute("sync", Icon.Sync, {
onClick: async () => userStore.sync(),
- animatable: true
+ animatable: true,
}),
...createNormalRoute("account", Account, Icon.User, {
onClick: async () => {
@@ -30,48 +30,48 @@ export const bottomRoutes = {
await showLogInDialog();
return false;
} else return RootNavigator.navigate("account");
- }
+ },
}),
...createRoute("settings", SettingsContainer, {
- icon: Icon.Settings
- })
+ icon: Icon.Settings,
+ }),
};
export const routes = {
...createNormalRoute("home", Home, Icon.Home, {
title: "Home",
- options: SelectionModeOptions.NotesOptions
+ options: SelectionModeOptions.NotesOptions,
}),
...createRoute("notebooks", NotebooksContainer, {
- icon: Icon.Notebook
+ icon: Icon.Notebook,
}),
...createNormalRoute("favorites", Notes, Icon.StarOutline, {
title: "Favorites",
options: SelectionModeOptions.FavoritesOptions,
- context: { type: "favorites" }
+ context: { type: "favorites" },
}),
...createNormalRoute("trash", Trash, Icon.Trash, {
title: "Trash",
- options: SelectionModeOptions.TrashOptions
+ options: SelectionModeOptions.TrashOptions,
}),
...createRoute("tags", TagsContainer, {
- icon: Icon.Tag
- })
+ icon: Icon.Tag,
+ }),
};
const invisibleRoutes = {
...createRoute("color", Notes, {
icon: Icon.Circle,
- options: SelectionModeOptions.NotesOptions
+ options: SelectionModeOptions.NotesOptions,
}),
- ...createRoute("search", Search, { title: "Search" })
+ ...createRoute("search", Search, { title: "Search" }),
};
const RootNavigator = new Navigator(
"RootNavigator",
{ ...routes, ...bottomRoutes, ...invisibleRoutes },
{
- backButtonEnabled: false
+ backButtonEnabled: false,
}
);