Files
net/frontend/src/stores/sidebarStore.ts
cawcenter b2d548c5fb feat: Complete frontend master upgrade with PWA, SEO, Bundle Analysis, and State Management
- Install nanostores for lightweight state management
- Add enhanced Directus client with auth and realtime
- Configure PWA with offline support and service worker
- Enable auto-sitemap generation for SEO
- Add Partytown for web worker analytics
- Implement image optimization with astro-imagetools
- Add bundle visualizer for performance analysis
- Enable Brotli compression for all assets
- Add Vite Inspect for debugging
- Create sidebar state management store
- Install TipTap rich text editor
- Add React Hook Form + Zod validation
- Add TanStack Query for data fetching

All plugins tested and build verified successfully.
2025-12-13 17:35:09 -05:00

18 lines
401 B
TypeScript

import { atom } from 'nanostores';
// Sidebar open/close state
export const isSidebarOpen = atom(true);
// Active route for highlighting
export const activeRoute = atom('/admin');
// Helper to toggle sidebar
export function toggleSidebar() {
isSidebarOpen.set(!isSidebarOpen.get());
}
// Helper to set active route
export function setActiveRoute(route: string) {
activeRoute.set(route);
}