Skip to content

Commit 233fcfd

Browse files
authored
Merge pull request #125 from objectstack-ai/fix/dark-mode-icon-colors
fix(ux): theme-aware icon + markdown colors for dark mode
2 parents 05f54b4 + 0721e1a commit 233fcfd

26 files changed

Lines changed: 195 additions & 91 deletions

‎app/(app)/[appName]/[objectName]/index.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { ScreenHeader } from "~/components/common/ScreenHeader";
1212
import { useToast } from "~/components/ui/Toast";
1313
import { useConfirm } from "~/components/ui/ConfirmDialog";
1414
import { useObjectMeta } from "~/hooks/useObjectMeta";
15+
import { useThemeColors } from "~/lib/theme-colors";
1516

1617
export default function ObjectListScreen() {
1718
const { appName, objectName } = useLocalSearchParams<{
@@ -21,6 +22,7 @@ export default function ObjectListScreen() {
2122
const client = useClient();
2223
const router = useRouter();
2324
const { t } = useTranslation();
25+
const { accent } = useThemeColors();
2426
const { toastError } = useToast();
2527
const confirm = useConfirm();
2628

@@ -100,7 +102,7 @@ export default function ObjectListScreen() {
100102
accessibilityLabel={t("records.createNamed", { name: displayName })}
101103
className="h-10 w-10 items-center justify-center rounded-full active:bg-muted"
102104
>
103-
<Plus size={24} color="#1e40af" />
105+
<Plus size={24} color={accent} />
104106
</Pressable>
105107
}
106108
/>

‎app/(app)/[appName]/index.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { ListSkeleton } from "~/components/ui/ListSkeleton";
88
import { ScreenHeader } from "~/components/common/ScreenHeader";
99
import { useApp, type NavigationItem } from "~/hooks/useApps";
1010
import { getIcon } from "~/lib/getIcon";
11+
import { useThemeColors } from "~/lib/theme-colors";
1112

1213
/**
1314
* App home — renders the app's curated navigation tree (the same
@@ -19,6 +20,7 @@ import { getIcon } from "~/lib/getIcon";
1920
export default function AppHomeScreen() {
2021
const { appName } = useLocalSearchParams<{ appName: string }>();
2122
const router = useRouter();
23+
const { accent } = useThemeColors();
2224
const { app, isLoading, error } = useApp(appName);
2325

2426
const displayName =
@@ -71,7 +73,7 @@ export default function AppHomeScreen() {
7173
accessibilityLabel={item.label}
7274
>
7375
<View className="rounded-xl bg-primary/10 p-2.5">
74-
<Icon size={20} color="#1e40af" />
76+
<Icon size={20} color={accent} />
7577
</View>
7678
<Text className="ml-3 flex-1 text-base font-medium text-card-foreground">
7779
{item.label}

‎app/(app)/packages.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { ScreenHeader } from "~/components/common/ScreenHeader";
1414
import { EmptyState } from "~/components/ui/EmptyState";
1515
import { ListSkeleton } from "~/components/ui/ListSkeleton";
1616
import { useConfirm } from "~/components/ui/ConfirmDialog";
17+
import { useThemeColors } from "~/lib/theme-colors";
1718

1819
/**
1920
* Package management screen – list, enable, disable, uninstall packages.
@@ -22,6 +23,7 @@ import { useConfirm } from "~/components/ui/ConfirmDialog";
2223
*/
2324
export default function PackagesScreen() {
2425
const { t } = useTranslation();
26+
const { accent } = useThemeColors();
2527
const { packages, isLoading, error, refetch, enable, disable, uninstall } =
2628
usePackageManagement();
2729
const confirm = useConfirm();
@@ -87,7 +89,7 @@ export default function PackagesScreen() {
8789
<CardHeader>
8890
<View className="flex-row items-center justify-between">
8991
<View className="flex-row items-center gap-2 flex-1">
90-
<Package size={18} color="#1e40af" />
92+
<Package size={18} color={accent} />
9193
<CardTitle>{pkg.label}</CardTitle>
9294
</View>
9395
<View className="flex-row items-center gap-3">

‎app/(tabs)/apps.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ import { useApps } from "~/hooks/useApps";
1212
import { getIcon } from "~/lib/getIcon";
1313
import { getUserErrorMessage } from "~/lib/error-handling";
1414
import { tCount } from "~/lib/i18n";
15+
import { useThemeColors } from "~/lib/theme-colors";
1516

1617
export default function AppsScreen() {
1718
const { apps, isLoading, error, refetch } = useApps();
1819
const router = useRouter();
1920
const { t } = useTranslation();
21+
const { accent } = useThemeColors();
2022
const [isRefreshing, setIsRefreshing] = useState(false);
2123

2224
const handleAppPress = (appName: string) => {
@@ -85,7 +87,7 @@ export default function AppsScreen() {
8587
accessibilityLabel={t("apps.openA11y", { name: app.label })}
8688
>
8789
<View className="rounded-xl bg-primary/10 p-3">
88-
<Icon size={24} color="#1e40af" />
90+
<Icon size={24} color={accent} />
8991
</View>
9092
<View className="ml-4 flex-1">
9193
<Text className="text-base font-semibold text-card-foreground">

‎app/(tabs)/index.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export default function HomeScreen() {
129129
contentContainerStyle={webContentMaxWidth}
130130
showsVerticalScrollIndicator={false}
131131
refreshControl={
132-
<RefreshControl refreshing={isRefreshing} onRefresh={onRefresh} tintColor="#1e40af" />
132+
<RefreshControl refreshing={isRefreshing} onRefresh={onRefresh} tintColor={accent} />
133133
}
134134
>
135135
<View className="mb-5 flex-row items-start justify-between">
@@ -159,7 +159,7 @@ export default function HomeScreen() {
159159
accessibilityLabel={t("home.assistantTitle")}
160160
>
161161
<View className="rounded-xl bg-primary/10 p-3">
162-
<Sparkles size={24} color="#1e40af" />
162+
<Sparkles size={24} color={accent} />
163163
</View>
164164
<View className="ml-4 flex-1">
165165
<Text className="text-base font-semibold text-card-foreground">
@@ -263,7 +263,7 @@ export default function HomeScreen() {
263263
accessibilityLabel={`Open ${d.label} dashboard`}
264264
>
265265
<View className="rounded-xl bg-primary/10 p-3">
266-
<LayoutDashboard size={24} color="#1e40af" />
266+
<LayoutDashboard size={24} color={accent} />
267267
</View>
268268
<View className="ml-4 flex-1">
269269
<Text className="text-base font-semibold text-card-foreground">

‎app/(tabs)/search.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ import { Input } from "~/components/ui/Input";
1010
import { EmptyState } from "~/components/ui/EmptyState";
1111
import { useGlobalSearch } from "~/hooks/useGlobalSearch";
1212
import { useSearchHistoryStore } from "~/stores/search-history-store";
13+
import { useThemeColors } from "~/lib/theme-colors";
1314

1415
export default function SearchScreen() {
1516
const router = useRouter();
1617
const { t } = useTranslation();
18+
const { accent } = useThemeColors();
1719
const { query, setQuery, groups, isSearching, hasSearched, totalCount, objectCount } =
1820
useGlobalSearch();
1921
const recentQueries = useSearchHistoryStore((s) => s.queries);
@@ -162,7 +164,7 @@ export default function SearchScreen() {
162164
accessibilityLabel={t("search.openLabel", { title: rec.title })}
163165
>
164166
<View className="mr-3 rounded-lg bg-primary/10 p-2">
165-
<FileText size={16} color="#1e40af" />
167+
<FileText size={16} color={accent} />
166168
</View>
167169
<View className="flex-1">
168170
<Text className="text-base text-foreground" numberOfLines={1}>

‎components/batch/BatchActionBar.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from "react";
22
import { View, Text, Pressable } from "react-native";
33
import { Trash2, Edit3, X } from "lucide-react-native";
44
import { cn } from "~/lib/utils";
5+
import { useThemeColors } from "~/lib/theme-colors";
56

67
export interface BatchActionBarProps {
78
/** Number of selected records */
@@ -25,6 +26,7 @@ export function BatchActionBar({
2526
onClearSelection,
2627
className,
2728
}: BatchActionBarProps) {
29+
const { accent } = useThemeColors();
2830
if (selectedCount === 0) return null;
2931

3032
return (
@@ -49,7 +51,7 @@ export function BatchActionBar({
4951
onPress={onBatchEdit}
5052
className="flex-row items-center rounded-lg bg-primary/10 px-3 py-2"
5153
>
52-
<Edit3 size={14} color="#1e40af" />
54+
<Edit3 size={14} color={accent} />
5355
<Text className="ml-1.5 text-xs font-semibold text-primary">Edit</Text>
5456
</Pressable>
5557
)}

‎components/common/LanguageSelector.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { Check } from "lucide-react-native";
55
import * as Haptics from "expo-haptics";
66
import { SUPPORTED_LANGUAGES } from "~/lib/i18n";
77
import { useUIStore } from "~/stores/ui-store";
8+
import { useThemeColors } from "~/lib/theme-colors";
89
import { cn } from "~/lib/utils";
910

1011
/**
@@ -13,6 +14,7 @@ import { cn } from "~/lib/utils";
1314
*/
1415
export function LanguageSelector({ className }: { className?: string }) {
1516
const { t } = useTranslation();
17+
const { accent } = useThemeColors();
1618
const language = useUIStore((s) => s.language);
1719
const setLanguage = useUIStore((s) => s.setLanguage);
1820

@@ -48,7 +50,7 @@ export function LanguageSelector({ className }: { className?: string }) {
4850
>
4951
{lang.label}
5052
</Text>
51-
{isActive && <Check size={18} color="#1e40af" />}
53+
{isActive && <Check size={18} color={accent} />}
5254
</Pressable>
5355
);
5456
})}

‎components/common/OfflineIndicator.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from "react";
22
import { View, Text, Pressable } from "react-native";
33
import { WifiOff, RefreshCw } from "lucide-react-native";
44
import { cn } from "~/lib/utils";
5+
import { useThemeColors } from "~/lib/theme-colors";
56

67
export interface OfflineIndicatorProps {
78
isOffline: boolean;
@@ -22,6 +23,7 @@ export function OfflineIndicator({
2223
onSyncPress,
2324
className,
2425
}: OfflineIndicatorProps) {
26+
const { accent } = useThemeColors();
2527
if (!isOffline && pendingCount === 0) return null;
2628

2729
return (
@@ -52,7 +54,7 @@ export function OfflineIndicator({
5254
disabled={isSyncing}
5355
className="flex-row items-center rounded-lg bg-primary/10 px-2.5 py-1"
5456
>
55-
<RefreshCw size={12} color="#1e40af" />
57+
<RefreshCw size={12} color={accent} />
5658
<Text className="ml-1 text-xs font-medium text-primary">
5759
{isSyncing ? "Syncing…" : "Sync"}
5860
</Text>

‎components/common/ScreenHeader.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { View, Text, Pressable } from "react-native";
33
import { useSafeAreaInsets } from "react-native-safe-area-context";
44
import { ChevronLeft } from "lucide-react-native";
55
import { useRouter } from "expo-router";
6+
import { useThemeColors } from "~/lib/theme-colors";
67

78
export interface ScreenHeaderProps {
89
/** Primary title shown in the bar. */
@@ -44,6 +45,7 @@ export function ScreenHeader({
4445
}: ScreenHeaderProps) {
4546
const router = useRouter();
4647
const insets = useSafeAreaInsets();
48+
const { accent } = useThemeColors();
4749

4850
const handleBack = () => {
4951
if (onBack) {
@@ -74,7 +76,7 @@ export function ScreenHeader({
7476
accessibilityLabel="Go back"
7577
className="h-11 w-11 items-center justify-center rounded-full active:bg-muted"
7678
>
77-
<ChevronLeft size={26} color="#1e40af" />
79+
<ChevronLeft size={26} color={accent} />
7880
</Pressable>
7981
)}
8082

0 commit comments

Comments
 (0)