feat(midsummer): retire the theme out of season (holiday over)
Flip the seasonal master switch (SEASON_ACTIVE=false in useMidsummer) so the
Sma Grodorna theme is fully dormant — no rain/frogs/maypole/banner/palette,
regardless of any stored toggle preference — and remove the 🐸 toggle from the
sidebar. All theme code is kept; to bring it back next Midsummer, flip
SEASON_ACTIVE to true and re-add <FrogToggle /> in SidebarWindowButtons.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
0565a54ae5
commit
cc686da532
15 changed files with 39 additions and 27 deletions
|
|
@ -2,7 +2,6 @@ import React, { useCallback } from 'react';
|
|||
import { useWindowManager } from '../../contexts/WindowManagerContext';
|
||||
import { useCurrentUser } from '../../hooks/useCurrentUser';
|
||||
import { logout } from '../../api/endpoints';
|
||||
import { FrogToggle } from '../midsummer/FrogToggle';
|
||||
|
||||
export const SidebarWindowButtons: React.FC = () => {
|
||||
const { openWindow } = useWindowManager();
|
||||
|
|
@ -16,7 +15,6 @@ export const SidebarWindowButtons: React.FC = () => {
|
|||
|
||||
return (
|
||||
<div className="ml-tool-links">
|
||||
<FrogToggle />
|
||||
<span className="ml-tool-link" style={{ cursor: 'pointer' }}
|
||||
onClick={() => openWindow('agent', 'Overlord Assistant')}>🤖 Assistant</span>
|
||||
<span className="ml-tool-link" style={{ cursor: 'pointer' }}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,13 @@ import React, { createContext, useContext, useState, useEffect, useCallback } fr
|
|||
|
||||
const KEY = 'mo-midsummer';
|
||||
|
||||
// Seasonal master switch. The Små grodorna theme is only active around
|
||||
// Midsummer week. Out of season this is false → the theme is fully dormant
|
||||
// (no rain/frogs/maypole/banner/palette) regardless of any stored preference,
|
||||
// and the 🐸 toggle is removed from the sidebar. To bring it back next year:
|
||||
// flip this to true and re-add <FrogToggle /> in SidebarWindowButtons.tsx.
|
||||
const SEASON_ACTIVE = false;
|
||||
|
||||
interface MidsummerCtx {
|
||||
enabled: boolean;
|
||||
toggle: () => void;
|
||||
|
|
@ -10,17 +17,24 @@ interface MidsummerCtx {
|
|||
const Ctx = createContext<MidsummerCtx | null>(null);
|
||||
|
||||
export const MidsummerProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
|
||||
// Default ON: only the literal "off" disables it.
|
||||
const [enabled, setEnabled] = useState<boolean>(() => localStorage.getItem(KEY) !== 'off');
|
||||
// In season, default ON (only the literal "off" disables). Out of season,
|
||||
// always off — the stored preference is ignored.
|
||||
const [pref, setPref] = useState<boolean>(() => localStorage.getItem(KEY) !== 'off');
|
||||
const enabled = SEASON_ACTIVE && pref;
|
||||
|
||||
useEffect(() => {
|
||||
const el = document.documentElement;
|
||||
if (enabled) el.setAttribute('data-midsummer', '');
|
||||
else el.removeAttribute('data-midsummer');
|
||||
localStorage.setItem(KEY, enabled ? 'on' : 'off');
|
||||
}, [enabled]);
|
||||
|
||||
const toggle = useCallback(() => setEnabled(e => !e), []);
|
||||
const toggle = useCallback(() => {
|
||||
setPref(p => {
|
||||
const next = !p;
|
||||
localStorage.setItem(KEY, next ? 'on' : 'off');
|
||||
return next;
|
||||
});
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Ctx.Provider value={{ enabled, toggle }}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue