Settings aprroch 1 login overhaul

This commit is contained in:
sageTheDM 2024-09-26 14:57:31 +02:00
parent 1876a3afd8
commit 727c5e540b
2 changed files with 25 additions and 12 deletions

View file

@ -19,6 +19,12 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = (
return false; // Default to false if item is null or empty
};
interface SettingsProps {
closeSettings: () => void;
accountName: string;
handleLogout: () => void; // Add this line to accept handleLogout as a prop
}
// Active section
const [activeSection, setActiveSection] = useState(() => localStorage.getItem('activeSection') || 'general');
@ -842,8 +848,16 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = (
onChange={(e) => setNewPassword(e.target.value)}
/>
</div>
{/* Logout Button */}
<div className="settings-option">
<button
onClick={() => {
closeSettings(); // Optionally close settings after logout
}}
className="logout-button"
>
Logout
</button>
</div>
</div>
);