Skip to content

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

fix: auto capitalize first character of a color

thecodrr4617bae2c9c4
diff --git a/apps/web/src/components/navigation-menu/index.js b/apps/web/src/components/navigation-menu/index.js
index 2db68c6e1..9df2c0f4e 100644
--- a/apps/web/src/components/navigation-menu/index.js
+++ b/apps/web/src/components/navigation-menu/index.js
@@ -28,6 +28,7 @@ import { useStore as useUserStore } from "../../stores/user-store";
import { useStore as useThemeStore } from "../../stores/theme-store";
import useLocation from "../../hooks/use-location";
import { FlexScrollContainer } from "../scroll-container";
+import { toTitleCase } from "../../utils/string";
const navigationHistory = new Map();
function shouldSelectNavItem(route, pin) {
@@ -158,7 +159,7 @@ function NavigationMenu(props) {
{colors.map((color) => (
<NavigationItem
key={color.id}
- title={db.colors.alias(color.id)}
+ title={toTitleCase(db.colors.alias(color.id))}
icon={Circle}
selected={location === `/colors/${color.id}`}
color={color.title.toLowerCase()}
diff --git a/apps/web/src/components/note/index.js b/apps/web/src/components/note/index.js
index 682ba4cc6..a2f38e321 100644
--- a/apps/web/src/components/note/index.js
+++ b/apps/web/src/components/note/index.js
@@ -340,18 +340,18 @@ const topicNoteMenuItems = [
function colorsToMenuItems() {
return COLORS.map((label) => {
- label = label.toLowerCase();
+ const lowercase = label.toLowerCase();
return {
- key: label,
- title: () => db.colors.alias(label) || label,
+ key: lowercase,
+ title: () => db.colors.alias(lowercase) || label,
icon: Icon.Circle,
- iconColor: label,
+ iconColor: lowercase,
checked: ({ note }) => {
- return note.color === label;
+ return note.color === lowercase;
},
onClick: ({ note }) => {
const { id } = note;
- store.setColor(id, label);
+ store.setColor(id, lowercase);
},
};
});