Refactor AppProvider, AppConfig and presetRelays

This commit is contained in:
Alex Gleason committed 2025-06-04 10:20:31 -05:00
1 parent 3ad83cd114
commit 048bf4cc69
8 files changed
+46 -26

No files matched your search

@@ -5,10 +5,10 @@ import { AppContext, type AppContextType } from "@/contexts/AppContext";
* Hook to access and update application configuration
* @returns Application context with config and update methods
*/
export function useAppConfig(): AppContextType {
export function useAppContext(): AppContextType {
const context = useContext(AppContext);
if (context === undefined) {
throw new Error('useAppConfig must be used within an AppProvider');
throw new Error('useAppContext must be used within an AppProvider');
}
return context;
}
+2 -2
View File
@@ -1,12 +1,12 @@
import { type Theme } from "@/contexts/AppContext";
import { useAppConfig } from "@/hooks/useAppConfig";
import { useAppContext } from "@/hooks/useAppContext";
/**
* Hook to get and set the active theme
* @returns Theme context with theme and setTheme
*/
export function useTheme(): { theme: Theme; setTheme: (theme: Theme) => void } {
const { config, updateConfig } = useAppConfig();
const { config, updateConfig } = useAppContext();
return {
theme: config.theme,