A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
mobile: use accentForeground on accent background
ammarahm-ed2aa5a57557e5
diff --git a/apps/mobile/app/components/announcements/cta.js b/apps/mobile/app/components/announcements/cta.jsindex 39cdf2fd3..0613cd30e 100644--- a/apps/mobile/app/components/announcements/cta.js+++ b/apps/mobile/app/components/announcements/cta.js@@ -128,7 +128,9 @@ export const Cta = ({ actions, style = {}, color, inline }) => {fontSize={SIZE.md}buttonType={{color: color ? color : colors.primary.accent,- text: colors.static.white,+ text: color+ ? colors.static.white+ : colors.primary.accentForeground,selected: color ? color : colors.primary.accent,opacity: 1}}diff --git a/apps/mobile/app/components/container/floating-button.tsx b/apps/mobile/app/components/container/floating-button.tsxindex 1b6e6ad7c..a51c9f8b4 100644--- a/apps/mobile/app/components/container/floating-button.tsx+++ b/apps/mobile/app/components/container/floating-button.tsx@@ -140,7 +140,7 @@ const FloatingButton = ({><Iconname={title === "Clear all trash" ? "delete" : "plus"}- color="white"+ color={colors.primary.accentForeground}size={SIZE.xxl}/></View>diff --git a/apps/mobile/app/components/list-items/note/index.js b/apps/mobile/app/components/list-items/note/index.jsindex 1af0fbccf..39ea9a6e1 100644--- a/apps/mobile/app/components/list-items/note/index.js+++ b/apps/mobile/app/components/list-items/note/index.js@@ -40,6 +40,7 @@ import { TimeSince } from "../../ui/time-since";import Heading from "../../ui/typography/heading";import Paragraph from "../../ui/typography/paragraph";import { useIsCompactModeEnabled } from "../../../hooks/use-is-compact-mode-enabled";+import { useEditorStore } from "../../../stores/use-editor-store";function navigateToTag(item) {const tag = db.tags.tag(item.id);@@ -98,6 +99,9 @@ const NoteItem = ({dateBy = "dateCreated",noOpen = false}) => {+ const currentEditingNote = useEditorStore(+ (state) => state.currentEditingNote+ );const { colors } = useThemeColors();const compactMode = useIsCompactModeEnabled(item);const attachmentCount = db.attachments?.ofNote(item.id, "all")?.length || 0;@@ -108,6 +112,9 @@ const NoteItem = ({const reminder = getUpcomingReminder(reminders);const noteColor = ColorValues[item.color?.toLowerCase()];const tags = getTags(item);+ const primaryColors =+ currentEditingNote === item.id ? colors.selected : colors.primary;+return (<><View@@ -148,7 +155,7 @@ const NoteItem = ({borderRadius: 5,marginRight: 5,borderWidth: 0.5,- borderColor: colors.primary.border,+ borderColor: primaryColors.border,paddingHorizontal: 6,marginBottom: 5}}@@ -179,7 +186,7 @@ const NoteItem = ({<ParagraphnumberOfLines={1}color={- ColorValues[item.color?.toLowerCase()] || colors.primary.heading+ ColorValues[item.color?.toLowerCase()] || primaryColors.heading}style={{flexWrap: "wrap"@@ -192,7 +199,7 @@ const NoteItem = ({<HeadingnumberOfLines={1}color={- ColorValues[item.color?.toLowerCase()] || colors.primary.heading+ ColorValues[item.color?.toLowerCase()] || primaryColors.heading}style={{flexWrap: "wrap"@@ -208,6 +215,7 @@ const NoteItem = ({style={{flexWrap: "wrap"}}+ color={primaryColors.paragraph}numberOfLines={2}>{decode(item.headline, {@@ -262,7 +270,7 @@ const NoteItem = ({<Iconname="attachment"size={SIZE.md}- color={colors.primary.icon}+ color={primaryColors.icon}/><Paragraphcolor={colors.secondary.paragraph}@@ -283,7 +291,7 @@ const NoteItem = ({}}color={ColorValues[item.color?.toLowerCase()] ||- colors.primary.accent+ primaryColors.accent}/>) : null}@@ -296,7 +304,7 @@ const NoteItem = ({style={{marginRight: 6}}- color={colors.primary.icon}+ color={primaryColors.icon}/>) : null}@@ -354,7 +362,7 @@ const NoteItem = ({</Paragraph><Paragraph- color={colors.primary.accent}+ color={primaryColors.accent}size={SIZE.xs}style={{marginRight: 6@@ -424,7 +432,7 @@ const NoteItem = ({<IconButtontestID={notesnook.listitem.menu}- color={colors.primary.paragraph}+ color={primaryColors.paragraph}name="dots-horizontal"size={SIZE.xl}onPress={() => !noOpen && showActionSheet(item, isTrash)}diff --git a/apps/mobile/app/components/side-menu/menu-item.js b/apps/mobile/app/components/side-menu/menu-item.jsindex 81f060754..bcefbc101 100644--- a/apps/mobile/app/components/side-menu/menu-item.js+++ b/apps/mobile/app/components/side-menu/menu-item.js@@ -17,20 +17,18 @@ You should have received a copy of the GNU General Public Licensealong with this program. If not, see <http://www.gnu.org/licenses/>.*/-import React, { useEffect, useState } from "react";+import { useThemeColors } from "@notesnook/theme";+import React, { useCallback, useEffect, useState } from "react";import { View } from "react-native";import Icon from "react-native-vector-icons/MaterialCommunityIcons";import ToggleSwitch from "toggle-switch-react-native";import Navigation from "../../services/navigation";import useNavigationStore from "../../stores/use-navigation-store";-import { useThemeColors } from "@notesnook/theme";-import { normalize, SIZE } from "../../utils/size";+import { SIZE, normalize } from "../../utils/size";import { Button } from "../ui/button";import { PressableButton } from "../ui/pressable";import Heading from "../ui/typography/heading";import Paragraph from "../ui/typography/paragraph";-import { useCallback } from "react";-import Tag from "../ui/tag";export const MenuItem = React.memo(function MenuItem({ item, index, testID, rightBtn }) {@@ -40,6 +38,7 @@ export const MenuItem = React.memo();const screenId = item.name.toLowerCase() + "_navigation";let isFocused = headerTextState?.id === screenId;+ const primaryColors = isFocused ? colors.selected : colors.primary;const _onPress = () => {if (item.func) {@@ -132,13 +131,13 @@ export const MenuItem = React.memo(<Viewstyle={{borderRadius: 100,- backgroundColor: colors.primary.accent,+ backgroundColor: primaryColors.accent,paddingHorizontal: 4,marginLeft: 5,paddingVertical: 2}}>- <Paragraph color={colors.static.white} size={SIZE.xxs}>+ <Paragraph color={primaryColors.accentForeground} size={SIZE.xxs}>BETA</Paragraph></View>@@ -148,8 +147,8 @@ export const MenuItem = React.memo({item.switch ? (<ToggleSwitchisOn={item.on}- onColor={colors.primary.accent}- offColor={colors.primary.icon}+ onColor={primaryColors.accent}+ offColor={primaryColors.icon}size="small"animationSpeed={150}onToggle={_onPress}diff --git a/apps/mobile/app/components/side-menu/pinned-section.js b/apps/mobile/app/components/side-menu/pinned-section.jsindex ef14a58d0..31a12055a 100644--- a/apps/mobile/app/components/side-menu/pinned-section.js+++ b/apps/mobile/app/components/side-menu/pinned-section.js@@ -108,9 +108,12 @@ export const PinItem = React.memo(alias = item?.alias || item?.title;const [visible, setVisible] = useState(false);const [headerTextState, setHeaderTextState] = useState(null);+ const primaryColors =+ headerTextState?.id === item.id ? colors.selected : colors.primary;+const color =headerTextState?.id === item.id- ? colors.primary.accent+ ? colors.selected.accent: colors.primary.icon;const fwdRef = useRef();@@ -230,7 +233,7 @@ export const PinItem = React.memo(style={{flexWrap: "wrap"}}- color={colors.primary.heading}+ color={primaryColors.heading}size={SIZE.md}>{alias}@@ -238,7 +241,7 @@ export const PinItem = React.memo() : (<ParagraphnumberOfLines={1}- color={colors.primary.paragraph}+ color={primaryColors.paragraph}size={SIZE.md}>{alias}diff --git a/apps/mobile/app/components/tip/index.tsx b/apps/mobile/app/components/tip/index.tsxindex 592b412fd..931ab7ce9 100644--- a/apps/mobile/app/components/tip/index.tsx+++ b/apps/mobile/app/components/tip/index.tsx@@ -77,7 +77,9 @@ export const Tip = ({alignSelf: "flex-start",borderRadius: 100,borderWidth: 1,- borderColor: colors.static[color as never] || colors.primary[color as never] as string+ borderColor:+ colors.static[color as never] ||+ (colors.primary[color as never] as string)}}/>@@ -139,7 +141,7 @@ export const Tip = ({icon={tip.button.icon}buttonType={{color: colors.static[color as never],- text: colors.static.white+ text: colors.primary.accentForeground}}style={{marginTop: 10diff --git a/apps/mobile/app/components/ui/pressable/index.tsx b/apps/mobile/app/components/ui/pressable/index.tsxindex 6efe6f37b..82392bde4 100644--- a/apps/mobile/app/components/ui/pressable/index.tsx+++ b/apps/mobile/app/components/ui/pressable/index.tsx@@ -108,7 +108,7 @@ export const useButton = ({},accent: {primary: accent || colors.primary.accent,- text: text || colors.primary.paragraph,+ text: text || colors.primary.accentForeground,selected: accent || colors.primary.accent},inverted: {diff --git a/apps/mobile/app/components/ui/tag/index.tsx b/apps/mobile/app/components/ui/tag/index.tsxindex dd658adbb..7a189f80b 100644--- a/apps/mobile/app/components/ui/tag/index.tsx+++ b/apps/mobile/app/components/ui/tag/index.tsx@@ -16,9 +16,9 @@ GNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with this program. If not, see <http://www.gnu.org/licenses/>.*/-import React from "react";-import { View, ViewStyle } from "react-native";import { useThemeColors } from "@notesnook/theme";+import React from "react";+import { ViewStyle } from "react-native";import { SIZE } from "../../../utils/size";import Paragraph from "../typography/paragraph";@@ -50,7 +50,7 @@ export default function Tag({textAlign: "center",...style}}- color={textColor || colors.static.white}+ color={textColor || colors.primary.accentForeground}size={SIZE.xxs}>{text}diff --git a/apps/mobile/app/screens/settings/theme-selector.tsx b/apps/mobile/app/screens/settings/theme-selector.tsxindex 844cb41d2..76e7259f8 100644--- a/apps/mobile/app/screens/settings/theme-selector.tsx+++ b/apps/mobile/app/screens/settings/theme-selector.tsx@@ -748,7 +748,7 @@ const ThemeSetter = ({paddingVertical: 12}}>- <Heading color={colors.accent} size={SIZE.md}>+ <Heading color={colors.accentForeground} size={SIZE.md}>{darkTheme.id === theme.id? "Applied as dark theme": "Applied as light theme"}diff --git a/apps/mobile/share/share.js b/apps/mobile/share/share.jsindex 5d6c03b01..7dc1f0957 100644--- a/apps/mobile/share/share.js+++ b/apps/mobile/share/share.js@@ -602,8 +602,9 @@ const ShareView = ({ quicknote = false }) => {marginBottom: 0}}loading={loading}- iconColor={colors.static.white}+ iconColor={colors.primary.accentForeground}onPress={onPress}+ textColor={colors.primary.accentForeground}textStyle={{fontSize: 16,marginLeft: 0diff --git a/packages/theme/src/theme-engine/types.ts b/packages/theme/src/theme-engine/types.tsindex 6a4f16ff3..ad2db18cf 100644--- a/packages/theme/src/theme-engine/types.ts+++ b/packages/theme/src/theme-engine/types.ts@@ -247,6 +247,7 @@ export type VariantsWithStaticColors<TRequired extends boolean = false> =export type PreviewColors = {editor: string;+ accentForeground: string;navigationMenu: {shade: string;accent: string;diff --git a/packages/theme/src/theme-engine/utils.ts b/packages/theme/src/theme-engine/utils.tsindex d08c0e9dd..805143de1 100644--- a/packages/theme/src/theme-engine/utils.ts+++ b/packages/theme/src/theme-engine/utils.ts@@ -63,7 +63,8 @@ export function getPreviewColors(theme: ThemeDefinition): PreviewColors {border: primary.border,paragraph: primary.paragraph,background: primary.background,- accent: primary.accent+ accent: primary.accent,+ accentForeground: primary.accentForeground};}