Skip to content

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

ui: add priority colors

thecodrrbd1f4c668993
diff --git a/apps/web/src/common/index.js b/apps/web/src/common/index.js
index c185132fc..c1ea661af 100644
--- a/apps/web/src/common/index.js
+++ b/apps/web/src/common/index.js
@@ -4,13 +4,13 @@ import Database from "notes-core/api/";
export const db = new Database(StorageInterface);
export const COLORS = {
- red: "#ed2d37",
- orange: "#ec6e05",
- yellow: "yellow",
- green: "green",
- blue: "blue",
- purple: "purple",
- gray: "gray"
+ red: "#f44336",
+ orange: "#FF9800",
+ yellow: "#FFD600",
+ green: "#4CAF50",
+ blue: "#2196F3",
+ purple: "#673AB7",
+ gray: "#9E9E9E",
};
export const DEFAULT_CONTEXT = { colors: [], tags: [], notebook: {} };
diff --git a/apps/web/src/components/note/index.js b/apps/web/src/components/note/index.js
index 2710a341e..bb707129d 100644
--- a/apps/web/src/components/note/index.js
+++ b/apps/web/src/components/note/index.js
@@ -8,7 +8,7 @@ import { showMoveNoteDialog } from "../dialogs/movenotedialog";
import { store, useStore } from "../../stores/note-store";
import { store as editorStore } from "../../stores/editor-store";
import { showPasswordDialog } from "../dialogs/passworddialog";
-import { db } from "../../common";
+import { db, COLORS } from "../../common";
import { useTheme } from "emotion-theming";
const dropdownRefs = [];
@@ -20,15 +20,15 @@ function menuItems(note, context) {
if (await showMoveNoteDialog([note.id])) {
console.log("Note moved successfully!");
}
- }
+ },
},
{
title: note.pinned ? "Unpin" : "Pin",
- onClick: () => store.pin(note)
+ onClick: () => store.pin(note),
},
{
title: note.favorite ? "Unfavorite" : "Favorite",
- onClick: () => store.favorite(note)
+ onClick: () => store.favorite(note),
},
{ title: "Edit", onClick: () => editorStore.openSession(note) },
{
@@ -40,7 +40,7 @@ function menuItems(note, context) {
} else {
unlock(note.id);
}
- }
+ },
},
{
invisible: context ? (context.type === "topic" ? false : true) : true,
@@ -50,7 +50,7 @@ function menuItems(note, context) {
Icon.Topic,
"Remove from Topic",
"Are you sure you want to remove this note?"
- ).then(async res => {
+ ).then(async (res) => {
if (res) {
await db.notebooks
.notebook(context.notebook.id)
@@ -59,14 +59,14 @@ function menuItems(note, context) {
await store.setContext(context);
}
});
- }
+ },
},
{
title: "Move to Trash",
color: "red",
onClick: async () => {
if (note.locked) {
- const res = await showPasswordDialog("unlock_note", password => {
+ const res = await showPasswordDialog("unlock_note", (password) => {
return db.vault
.unlock(password)
.then(() => true)
@@ -78,20 +78,20 @@ function menuItems(note, context) {
Icon.Trash,
"Delete",
"Are you sure you want to delete this note?"
- ).then(async res => {
+ ).then(async (res) => {
if (res) {
await store.delete(note.id);
}
});
- }
- }
+ },
+ },
];
}
function Note(props) {
const { item, index } = props;
const note = item;
- const selectedNote = useStore(store => store.selectedNote);
+ const selectedNote = useStore((store) => store.selectedNote);
const isOpened = selectedNote === note.id;
const theme = useTheme();
return (
@@ -117,8 +117,8 @@ function Note(props) {
marginLeft: index ? -8 : 0,
marginRight: index === note.colors.length - 1 ? 5 : 0,
height: 13,
- backgroundColor: item,
- borderRadius: 100
+ backgroundColor: COLORS[item],
+ borderRadius: 100,
}}
/>
))}
@@ -159,7 +159,7 @@ function Note(props) {
);
}
-export default React.memo(Note, function(prevProps, nextProps) {
+export default React.memo(Note, function (prevProps, nextProps) {
const prevItem = prevProps.item;
const nextItem = nextProps.item;
return (
diff --git a/apps/web/src/components/properties/index.js b/apps/web/src/components/properties/index.js
index 8b6bcba92..a9bebc740 100644
--- a/apps/web/src/components/properties/index.js
+++ b/apps/web/src/components/properties/index.js
@@ -8,6 +8,7 @@ import { objectMap } from "../../utils/object";
import { useStore as useAppStore } from "../../stores/app-store";
import Animated from "../animated";
import Toggle from "./toggle";
+import { toTitleCase } from "../../utils/string";
const tools = [
{ key: "pinned", icons: { on: Icon.PinFilled, off: Icon.Pin }, label: "Pin" },
@@ -114,8 +115,8 @@ function Properties() {
>
<Flex key={label} my={1}>
<Icon.Circle size={24} color={code} />
- <Text ml={2} color="text">
- {label}
+ <Text ml={1} color="text">
+ {toTitleCase(label)}
</Text>
</Flex>
{colors.includes(label) && (