feat: hide logout button when admin is not logged in
- Add conditional rendering for "Abmelden" button based on isAdminLoggedIn state - Button only appears when localStorage contains "isAdminLoggedIn": "true" - Improves UI cleanliness by hiding unnecessary logout option for regular users - Maintains existing admin warning banner and logout functionality when needed
This commit is contained in:
@@ -110,16 +110,17 @@ function Header() {
|
||||
*/}
|
||||
</div>
|
||||
|
||||
{/* Logout-Button */}
|
||||
|
||||
<div className="flex items-center justify-end w-1/4 space-x-1">
|
||||
<button
|
||||
onClick={handleLogout}
|
||||
className="bg-littwin-blue text-white px-4 py-2 rounded"
|
||||
>
|
||||
Abmelden
|
||||
</button>
|
||||
</div>
|
||||
{/* Logout-Button - nur anzeigen wenn Admin eingeloggt ist */}
|
||||
{isAdminLoggedIn && (
|
||||
<div className="flex items-center justify-end w-1/4 space-x-1">
|
||||
<button
|
||||
onClick={handleLogout}
|
||||
className="bg-littwin-blue text-white px-4 py-2 rounded"
|
||||
>
|
||||
Abmelden
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Warnhinweis, wenn der Admin angemeldet ist */}
|
||||
|
||||
Reference in New Issue
Block a user