V2: Disable rainbow mode for demo (#4303)

# Description of Changes
The rainbow mode easter egg doesn't work very well at the moment and
isn't needed for the demo (and is too easy to accidentally enable). This
PR disables it completely by adding a global const to short-circuit the
activation code.
This commit is contained in:
James Brunton 2025-08-26 15:56:37 +01:00 committed by GitHub
parent d64c56a897
commit 9360a36c31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,6 +11,8 @@ interface RainbowThemeHook {
deactivateRainbow: () => void;
}
const allowRainbowMode = false; // Override to allow/disallow fun
export function useRainbowTheme(initialTheme: 'light' | 'dark' = 'light'): RainbowThemeHook {
// Get theme from localStorage or use initial
const [themeMode, setThemeMode] = useState<ThemeMode>(() => {
@ -162,7 +164,7 @@ export function useRainbowTheme(initialTheme: 'light' | 'dark' = 'light'): Rainb
lastToggleTime.current = currentTime;
// Easter egg: Activate rainbow mode after 10 rapid toggles
if (toggleCount.current >= 10) {
if (allowRainbowMode && toggleCount.current >= 10) {
setThemeMode('rainbow');
console.log('🌈 RAINBOW MODE ACTIVATED! 🌈 You found the secret easter egg!');
console.log('🌈 Button will be disabled for 3 seconds, then click once to exit!');