diff --git a/apps/mobile/app/components/announcements/cta.js b/apps/mobile/app/components/announcements/cta.js index 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.tsx index 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 = ({ > diff --git a/apps/mobile/app/components/list-items/note/index.js b/apps/mobile/app/components/list-items/note/index.js index 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 ( <> {decode(item.headline, { @@ -262,7 +270,7 @@ const NoteItem = ({ ) : null} @@ -296,7 +304,7 @@ const NoteItem = ({ style={{ marginRight: 6 }} - color={colors.primary.icon} + color={primaryColors.icon} /> ) : null} @@ -354,7 +362,7 @@ const NoteItem = ({ !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.js index 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 License along with this program. If not, see . */ -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( - + BETA @@ -148,8 +147,8 @@ export const MenuItem = React.memo( {item.switch ? ( {alias} @@ -238,7 +241,7 @@ export const PinItem = React.memo( ) : ( {alias} diff --git a/apps/mobile/app/components/tip/index.tsx b/apps/mobile/app/components/tip/index.tsx index 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: 10 diff --git a/apps/mobile/app/components/ui/pressable/index.tsx b/apps/mobile/app/components/ui/pressable/index.tsx index 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.tsx index 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 License along with this program. If not, see . */ -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.tsx index 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 }} > - + {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.js index 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: 0 diff --git a/packages/theme/src/theme-engine/types.ts b/packages/theme/src/theme-engine/types.ts index 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 = 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.ts index 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 }; }