Add settings panel functionality: include toggle button and overlay for settings
This commit is contained in:
@@ -5,6 +5,7 @@ import SmeltingPanel from './components/SmeltingPanel';
|
|||||||
import CraftingPanel from './components/CraftingPanel';
|
import CraftingPanel from './components/CraftingPanel';
|
||||||
import AlertsPanel from './components/AlertsPanel';
|
import AlertsPanel from './components/AlertsPanel';
|
||||||
import AnalyticsPanel from './components/AnalyticsPanel';
|
import AnalyticsPanel from './components/AnalyticsPanel';
|
||||||
|
import SettingsPanel from './components/SettingsPanel';
|
||||||
import ErrorBoundary from './components/ErrorBoundary';
|
import ErrorBoundary from './components/ErrorBoundary';
|
||||||
import { useInventoryStore } from './store/inventoryStore';
|
import { useInventoryStore } from './store/inventoryStore';
|
||||||
import './App.css';
|
import './App.css';
|
||||||
@@ -18,6 +19,7 @@ function App() {
|
|||||||
const alerts = useInventoryStore((state) => state.alerts) || [];
|
const alerts = useInventoryStore((state) => state.alerts) || [];
|
||||||
const [panelTab, setPanelTab] = useState('inventory');
|
const [panelTab, setPanelTab] = useState('inventory');
|
||||||
const [showAlerts, setShowAlerts] = useState(false);
|
const [showAlerts, setShowAlerts] = useState(false);
|
||||||
|
const [showSettings, setShowSettings] = useState(false);
|
||||||
const [, forceRender] = useState(0);
|
const [, forceRender] = useState(0);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -58,6 +60,14 @@ function App() {
|
|||||||
<div className="app-header">
|
<div className="app-header">
|
||||||
<h1>⛏️ Inventory Manager</h1>
|
<h1>⛏️ Inventory Manager</h1>
|
||||||
<div className="header-right">
|
<div className="header-right">
|
||||||
|
{/* Settings gear button */}
|
||||||
|
<button
|
||||||
|
className="settings-gear"
|
||||||
|
onClick={() => setShowSettings(!showSettings)}
|
||||||
|
title="Settings"
|
||||||
|
>
|
||||||
|
⚙️
|
||||||
|
</button>
|
||||||
{/* Alerts bell button */}
|
{/* Alerts bell button */}
|
||||||
<button
|
<button
|
||||||
className={`alerts-bell ${triggeredAlerts.length > 0 ? 'has-alerts' : ''}`}
|
className={`alerts-bell ${triggeredAlerts.length > 0 ? 'has-alerts' : ''}`}
|
||||||
@@ -96,6 +106,9 @@ function App() {
|
|||||||
{/* Alerts popup overlay */}
|
{/* Alerts popup overlay */}
|
||||||
<AlertsPanel isOpen={showAlerts} onClose={() => setShowAlerts(false)} />
|
<AlertsPanel isOpen={showAlerts} onClose={() => setShowAlerts(false)} />
|
||||||
|
|
||||||
|
{/* Settings overlay */}
|
||||||
|
<SettingsPanel isOpen={showSettings} onClose={() => setShowSettings(false)} />
|
||||||
|
|
||||||
<div className="app-content">
|
<div className="app-content">
|
||||||
<div className="sidebar">
|
<div className="sidebar">
|
||||||
<ErrorBoundary>
|
<ErrorBoundary>
|
||||||
|
|||||||
Reference in New Issue
Block a user