Skip to content

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

call toLowerCase() on all items with color

ammarahm-ede0fa9f725718
diff --git a/apps/mobile/src/components/Menu/ColorSection.js b/apps/mobile/src/components/Menu/ColorSection.js
index 7486cc49e..11f142bd8 100644
--- a/apps/mobile/src/components/Menu/ColorSection.js
+++ b/apps/mobile/src/components/Menu/ColorSection.js
@@ -94,7 +94,7 @@ const ColorItem = ({item, index}) => {
headerTextState?.id === item.id ? 'rgba(0,0,0,0.04)' : 'transparent'
}
onLongPress={onLongPress}
- customSelectedColor={COLORS_NOTE[item.title]}
+ customSelectedColor={COLORS_NOTE[item.title.toLowerCase()]}
customAlpha={!colors.night ? -0.02 : 0.02}
customOpacity={0.12}
onPress={() => onPress(item)}
@@ -124,7 +124,7 @@ const ColorItem = ({item, index}) => {
style={{
width: SIZE.lg - 2,
height: SIZE.lg - 2,
- backgroundColor: COLORS_NOTE[item.title],
+ backgroundColor: COLORS_NOTE[item.title.toLowerCase()],
borderRadius: 100,
justifyContent: 'center',
marginRight: 10
diff --git a/apps/mobile/src/components/NoteItem/index.js b/apps/mobile/src/components/NoteItem/index.js
index 1b5cd1deb..5a98ccbd8 100644
--- a/apps/mobile/src/components/NoteItem/index.js
+++ b/apps/mobile/src/components/NoteItem/index.js
@@ -34,6 +34,8 @@ function navigateToNotebook(item) {
Navigation.navigate(routeName, params, headerState);
}
+
+
function navigateToTag(item) {
let tags = db.tags.all;
let _tag = tags.find(t => t.title === item);
@@ -157,7 +159,7 @@ const NoteItem = ({item, isTrash, tags}) => {
<Heading
numberOfLines={1}
- color={COLORS_NOTE[item.color] || colors.heading}
+ color={COLORS_NOTE[item.color?.toLowerCase()] || colors.heading}
style={{
flexWrap: 'wrap'
}}
@@ -205,7 +207,7 @@ const NoteItem = ({item, isTrash, tags}) => {
width: SIZE.xs,
height: SIZE.xs,
borderRadius: 100,
- backgroundColor: COLORS_NOTE[item.color],
+ backgroundColor: COLORS_NOTE[item.color.toLowerCase()],
marginRight: -4.5,
marginRight: 10
}}
@@ -220,7 +222,7 @@ const NoteItem = ({item, isTrash, tags}) => {
style={{
marginRight: 5
}}
- color={COLORS_NOTE[item.color] || colors.accent}
+ color={COLORS_NOTE[item.color?.toLowerCase()] || colors.accent}
/>
) : null}
@@ -238,7 +240,6 @@ const NoteItem = ({item, isTrash, tags}) => {
{item.favorite ? (
<Icon
- style={{marginRight: 10}}
name="star"
size={SIZE.md}
style={{
diff --git a/apps/mobile/src/components/SimpleList/empty.js b/apps/mobile/src/components/SimpleList/empty.js
index 512284350..b0154f82e 100644
--- a/apps/mobile/src/components/SimpleList/empty.js
+++ b/apps/mobile/src/components/SimpleList/empty.js
@@ -42,7 +42,7 @@ export const Empty = ({
}}>
<Placeholder
color={
- COLORS_NOTE[headerProps.color] || colors.accent
+ COLORS_NOTE[headerProps.color?.toLowerCase()] || colors.accent
}
w={normalize(150)}
h={normalize(150)}
@@ -68,7 +68,7 @@ export const Empty = ({
fontSize={SIZE.md}
accentColor="bg"
accentText={
- COLORS_NOTE[headerProps.color]
+ COLORS_NOTE[headerProps.color?.toLowerCase()]
? headerProps.color
: 'accent'
}
@@ -76,7 +76,7 @@ export const Empty = ({
) : loading ? (
<ActivityIndicator
color={
- COLORS_NOTE[headerProps.color] || colors.accent
+ COLORS_NOTE[headerProps.color?.toLowerCase()] || colors.accent
}
/>
) : null}
diff --git a/apps/mobile/src/components/SimpleList/header.js b/apps/mobile/src/components/SimpleList/header.js
index dd8429337..bb1818f12 100644
--- a/apps/mobile/src/components/SimpleList/header.js
+++ b/apps/mobile/src/components/SimpleList/header.js
@@ -41,7 +41,7 @@ export const Header = React.memo(
alignItems: 'center'
}}>
{messageCard && (
- <Card color={COLORS_NOTE[color] || colors.accent} />
+ <Card color={COLORS_NOTE[color?.toLowerCase()] || colors.accent} />
)}
</View>
@@ -57,8 +57,8 @@ export const Header = React.memo(
width: '100%',
zIndex: 10,
justifyContent: 'flex-end',
- backgroundColor: COLORS_NOTE[color]
- ? hexToRGBA(COLORS_NOTE[color], 0.15)
+ backgroundColor: COLORS_NOTE[color?.toLowerCase()]
+ ? hexToRGBA(COLORS_NOTE[color?.toLowerCase()], 0.15)
: color || colors.shade
}}>
<View
@@ -69,7 +69,7 @@ export const Header = React.memo(
position: 'absolute'
}}>
<Placeholder
- color={COLORS_NOTE[color] || colors.accent}
+ color={COLORS_NOTE[color?.toLowerCase()] || colors.accent}
w={normalize(150)}
h={normalize(150)}
type={screen === 'Favorites' ? 'favorites' : type}
diff --git a/apps/mobile/src/components/SimpleList/sectionheader.js b/apps/mobile/src/components/SimpleList/sectionheader.js
index 1aed784ab..f9f82a624 100644
--- a/apps/mobile/src/components/SimpleList/sectionheader.js
+++ b/apps/mobile/src/components/SimpleList/sectionheader.js
@@ -73,7 +73,7 @@ export const SectionHeader = ({item, index, type, title,color}) => {
justifyContent: 'center'
}}>
<Heading
- color={COLORS_NOTE[color] || colors.accent }
+ color={COLORS_NOTE[color?.toLowerCase()] || colors.accent }
size={SIZE.sm}
style={{
minWidth: 60,
diff --git a/apps/mobile/src/provider/stores.ts b/apps/mobile/src/provider/stores.ts
index 82fc51630..bbb871cf4 100644
--- a/apps/mobile/src/provider/stores.ts
+++ b/apps/mobile/src/provider/stores.ts
@@ -21,6 +21,7 @@ import {
Announcement,
} from './interfaces';
import { groupArray } from "notes-core/utils/grouping"
+import { post } from '../views/Editor/Functions';
export const useNoteStore = create<NoteStore>((set, get) => ({
notes: [],
@@ -148,6 +149,31 @@ export const useUserStore = create<UserStore>((set, get) => ({
setVerifyUser: (verified) => set({ verifyUser: verified })
}));
+interface AttachmentStore {
+ progress?: {
+ [name: string]: {
+ sent: number,
+ total: number,
+ hash: string,
+ recieved: number,
+ type: "upload" | "download",
+ success: boolean
+ }
+ },
+ setProgress: (sent: number, total: number, hash: string, recieved: number, type: "upload" | "download", success) => void
+}
+
+export const useAttachmentStore = create<AttachmentStore>((set, get) => ({
+ progress: {},
+ setProgress: (sent, total, hash, recieved, type, success) => {
+ let _p = get().progress;
+ _p[hash] = { sent, total, hash, recieved, type, success };
+ post("fetchprogress", _p[hash]);
+ set({ progress: { ..._p } });
+ },
+
+}));
+
let { width, height } = Dimensions.get('window');
export const useSettingStore = create<SettingStore>((set, get) => ({
@@ -168,7 +194,7 @@ export const useSettingStore = create<SettingStore>((set, get) => ({
telemetry: true,
notebooksListMode: "normal",
notesListMode: "normal",
- devMode:false,
+ devMode: false,
},
fullscreen: false,
deviceMode: "mobile",
@@ -194,7 +220,7 @@ export const useMenuStore = create<MenuStore>((set, get) => ({
setTimeout(() => {
try {
set({ menuPins: db.settings.pins })
- } catch (e) {}
+ } catch (e) { }
}, 1000)
}
},