Files
beenvoice-app/lib/use-themed-styles.ts
soconnor 14c880123c Add beenvoice mobile companion app with full dark mode support.
Expo app with dashboard, time clock, invoices, and settings — native tabs, glass UI, theme-aware components, and iOS Live Activities.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-17 22:36:37 -04:00

14 lines
526 B
TypeScript

import { useMemo } from "react";
import { StyleSheet } from "react-native";
import { useAppTheme } from "@/contexts/ThemeContext";
import type { ThemeColors } from "@/lib/theme-palette";
/** StyleSheet factory that re-runs when light/dark palette changes. */
export function useThemedStyles<T extends StyleSheet.NamedStyles<T>>(
factory: (colors: ThemeColors, isDark: boolean) => T,
): T {
const { colors, isDark } = useAppTheme();
return useMemo(() => StyleSheet.create(factory(colors, isDark)), [colors, isDark]);
}