Admin Panel: Logout-Button in Sidebar hinzugefügt

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Daniel 2026-03-09 22:42:36 +01:00
parent 354a9cd977
commit 8951f46536
6 changed files with 67 additions and 47 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4
web/dist/index.html vendored
View file

@ -5,8 +5,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Gaming Hub</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🎮</text></svg>" />
<script type="module" crossorigin src="/assets/index-BWeAEcYi.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-Bg-1_rjZ.css">
<script type="module" crossorigin src="/assets/index-CUixApZu.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-BrwtipcK.css">
</head>
<body>
<div id="root"></div>

View file

@ -19,6 +19,7 @@ type SoundsResponse = {
interface AdminPanelProps {
onClose: () => void;
onLogout: () => void;
}
/*
@ -88,7 +89,7 @@ function apiUploadFile(
type AdminTab = 'soundboard' | 'streaming' | 'game-library';
export default function AdminPanel({ onClose }: AdminPanelProps) {
export default function AdminPanel({ onClose, onLogout }: AdminPanelProps) {
const [activeTab, setActiveTab] = useState<AdminTab>('soundboard');
// ── Toast ──
@ -372,6 +373,9 @@ export default function AdminPanel({ onClose }: AdminPanelProps) {
</button>
))}
</nav>
<button className="ap-logout-btn" onClick={onLogout}>
{'\uD83D\uDD12'} Abmelden
</button>
</div>
{/* ── Content ── */}

View file

@ -394,7 +394,7 @@ export default function App() {
)}
{showAdminPanel && isAdmin && (
<AdminPanel onClose={() => setShowAdminPanel(false)} />
<AdminPanel onClose={() => setShowAdminPanel(false)} onLogout={() => { handleAdminLogout(); setShowAdminPanel(false); }} />
)}
<main className="hub-content">

View file

@ -1772,6 +1772,22 @@ html, body {
line-height: 1;
}
.ap-logout-btn {
margin-top: auto;
padding: 10px 16px;
background: transparent;
border: none;
border-top: 1px solid var(--border);
color: #e74c3c;
font-size: 0.85rem;
cursor: pointer;
text-align: left;
transition: background 0.15s;
}
.ap-logout-btn:hover {
background: rgba(231, 76, 60, 0.1);
}
/* ── Content Area ── */
.ap-content {
flex: 1;