Refactor AppProvider

This commit is contained in:
Alex Gleason committed 2025-06-04 10:06:38 -05:00
1 parent c3310ab485
commit 3ad83cd114
9 files changed
+156 -204

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
import { createContext } from "react";
export type Theme = "dark" | "light" | "system";
export interface AppConfig {
/** Current theme */
theme: Theme;
/** Selected relay URL */
relayUrl: string;
}
export interface AppContextType {
/** Current application configuration */
config: AppConfig;
/** Update configuration using a callback that receives current config and returns new config */
updateConfig: (updater: (currentConfig: AppConfig) => AppConfig) => void;
}
export const AppContext = createContext<AppContextType | undefined>(undefined);