Admin Panel: Logout-Button in Sidebar hinzugefügt
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
354a9cd977
commit
8951f46536
6 changed files with 67 additions and 47 deletions
|
|
@ -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 ── */}
|
||||
|
|
|
|||
|
|
@ -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">
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue