From d4fbdd14630e2f2fcdbc0de23ccc4ccd9eb74b48 Mon Sep 17 00:00:00 2001 From: Thomas Hallock Date: Sun, 28 Sep 2025 12:00:09 -0500 Subject: [PATCH] fix: add missing GameThemeContext file for themed navigation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The GameThemeContext.tsx file was referenced in layout.tsx but wasn't properly committed. This context enables games to declare their theming that flows through the navigation chrome. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- apps/web/src/contexts/GameThemeContext.tsx | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 apps/web/src/contexts/GameThemeContext.tsx diff --git a/apps/web/src/contexts/GameThemeContext.tsx b/apps/web/src/contexts/GameThemeContext.tsx new file mode 100644 index 00000000..bfaf1ca3 --- /dev/null +++ b/apps/web/src/contexts/GameThemeContext.tsx @@ -0,0 +1,33 @@ +'use client' + +import { createContext, useContext, useState, ReactNode } from 'react' + +export interface GameTheme { + gameName: string + backgroundColor: string +} + +interface GameThemeContextType { + theme: GameTheme | null + setTheme: (theme: GameTheme | null) => void +} + +const GameThemeContext = createContext(undefined) + +export function GameThemeProvider({ children }: { children: ReactNode }) { + const [theme, setTheme] = useState(null) + + return ( + + {children} + + ) +} + +export function useGameTheme() { + const context = useContext(GameThemeContext) + if (context === undefined) { + throw new Error('useGameTheme must be used within a GameThemeProvider') + } + return context +} \ No newline at end of file