Make dev menu (Ctrl+D) always available without localStorage gate
CI / build-and-push (push) Successful in 36s
CI / build-and-push (push) Successful in 36s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -18,16 +18,13 @@ export function DevMenu() {
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
const [activeTab, setActiveTab] = useState<Tab>('resources');
|
||||
|
||||
const isEnabled = import.meta.env.DEV || localStorage.getItem('token-empire-dev-menu') === 'true';
|
||||
|
||||
useEffect(() => {
|
||||
if (!isEnabled) return;
|
||||
const handler = () => setIsOpen((o) => !o);
|
||||
window.addEventListener('toggle-dev-menu', handler);
|
||||
return () => window.removeEventListener('toggle-dev-menu', handler);
|
||||
}, [isEnabled]);
|
||||
}, []);
|
||||
|
||||
if (!isEnabled || !isOpen) return null;
|
||||
if (!isOpen) return null;
|
||||
|
||||
return (
|
||||
<div className="fixed bottom-4 right-4 z-50 w-[440px] max-h-[520px] flex flex-col bg-surface-900 border border-surface-700 rounded-lg shadow-2xl">
|
||||
|
||||
Reference in New Issue
Block a user