diff --git a/app/src/App.tsx b/app/src/App.tsx index 53c82f6..d2bc283 100644 --- a/app/src/App.tsx +++ b/app/src/App.tsx @@ -13,11 +13,12 @@ import TowerModule from './pages/TowerModule'; import { Home, Settings, Menu, Cylinder, Church, CircleDot, Square, Layers, BarChart3, Activity, Warehouse, + Settings2, Sun, Moon, } from 'lucide-react'; import { useState } from 'react'; import { cn } from '@/lib/utils'; import { Button } from '@/components/ui/button'; -import { ThemeProvider } from '@/lib/theme'; +import { ThemeProvider, useTheme } from '@/lib/theme'; import { useI18n } from './store/i18nStore'; import { GlobalWindSettingsModal } from './components/GlobalWindSettingsModal'; @@ -30,14 +31,12 @@ const BridgeIcon = (props: React.SVGProps) => ( strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" - className={props.className} + {...props} > - - - - - - + + + + ); @@ -49,15 +48,15 @@ const TowerIcon = (props: React.SVGProps) => ( strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" - className={props.className} + {...props} > - - - - - - - + + + + + + + @@ -67,6 +66,11 @@ function AppLayout({ children }: { children: React.ReactNode }) { const location = useLocation(); const [isCollapsed, setIsCollapsed] = useState(false); const { t } = useI18n(); + const { setTheme, effectiveTheme } = useTheme(); + + const toggleTheme = () => { + setTheme(effectiveTheme === 'dark' ? 'light' : 'dark'); + }; const navItems = [ { path: '/', icon: , labelKey: 'nav_home' as const }, @@ -80,7 +84,6 @@ function AppLayout({ children }: { children: React.ReactNode }) { { path: '/pontes', icon: , labelKey: 'nav_bridge' as const }, { path: '/torre', icon: , labelKey: 'nav_tower' as const }, { path: '/dinamica', icon: , labelKey: 'nav_dynamics' as const }, - { path: '/settings', icon: , labelKey: 'nav_settings' as const }, ]; return ( @@ -92,16 +95,27 @@ function AppLayout({ children }: { children: React.ReactNode }) { )} >
- {!isCollapsed && {t('app_title')}} - + {!isCollapsed && BrainWind} +
+ + +
- + + + {!isCollapsed && {t('nav_settings')}} +
- {t('app_title')} -
- + BrainWind +
+ + + +
{children}
@@ -166,7 +223,7 @@ function AppLayout({ children }: { children: React.ReactNode }) { {/* Demais itens (Rolagem horizontal) */}
- {navItems.slice(1, -1).map((item) => { + {navItems.slice(1).map((item) => { const isActive = location.pathname === item.path; const label = t(item.labelKey); return ( @@ -187,27 +244,21 @@ function AppLayout({ children }: { children: React.ReactNode }) { })}
- {/* Preferências (Fixo na direita) */} - {(() => { - const settingsItem = navItems[navItems.length - 1]; - const isActive = location.pathname === settingsItem.path; - const label = t(settingsItem.labelKey); - return ( - -
- {settingsItem.icon} +
+
- {label} - - ); - })()} + Vento +
+ } + /> ); diff --git a/app/src/components/GlobalWindSettingsModal.tsx b/app/src/components/GlobalWindSettingsModal.tsx index a7d2c11..9b5663e 100644 --- a/app/src/components/GlobalWindSettingsModal.tsx +++ b/app/src/components/GlobalWindSettingsModal.tsx @@ -20,7 +20,11 @@ import { IsopletasModal } from '@/components/IsopletasModal'; import { InfoV0Modal } from '@/components/InfoV0Modal'; import { InfoParamModal } from '@/components/InfoParamModal'; -export function GlobalWindSettingsModal() { +interface GlobalWindSettingsModalProps { + trigger?: React.ReactNode; +} + +export function GlobalWindSettingsModal({ trigger }: GlobalWindSettingsModalProps) { const { v0, s1, @@ -52,10 +56,12 @@ export function GlobalWindSettingsModal() { return ( - + {trigger || ( + + )}