Update hamburger menu

This commit is contained in:
2026-03-09 22:11:27 +01:00
parent f95d375556
commit a55694af8e
2 changed files with 35 additions and 49 deletions

View File

@@ -6,61 +6,18 @@
class="flex items-center gap-2 min-w-0 relative" class="flex items-center gap-2 min-w-0 relative"
style="-webkit-app-region: no-drag" style="-webkit-app-region: no-drag"
> >
@if (inRoom()) {
<button
type="button"
(click)="onBack()"
class="p-2 hover:bg-secondary rounded"
title="Back"
>
<ng-icon
name="lucideChevronLeft"
class="w-5 h-5 text-muted-foreground"
/>
</button>
}
@if (inRoom()) { @if (inRoom()) {
<ng-icon <ng-icon
name="lucideHash" name="lucideHash"
class="w-5 h-5 text-muted-foreground" class="w-5 h-5 text-muted-foreground"
/> />
<span class="text-sm font-semibold text-foreground truncate">{{ roomName() }}</span> <span class="text-sm font-semibold text-foreground truncate">{{ roomName() }}</span>
@if (roomDescription()) { @if (roomDescription()) {
<span class="hidden md:inline text-sm text-muted-foreground border-l border-border pl-2 truncate"> <span class="hidden md:inline text-sm text-muted-foreground border-l border-border pl-2 truncate">
{{ roomDescription() }} {{ roomDescription() }}
</span> </span>
} }
<button
type="button"
(click)="toggleMenu()"
class="ml-2 p-2 hover:bg-secondary rounded"
title="Menu"
>
<ng-icon
name="lucideMenu"
class="w-5 h-5 text-muted-foreground"
/>
</button>
<!-- Anchored dropdown under the menu button -->
@if (showMenu()) {
<div class="absolute right-0 top-full mt-1 z-50 bg-card border border-border rounded-lg shadow-lg w-48">
<button
type="button"
(click)="leaveServer()"
class="w-full text-left px-3 py-2 text-sm hover:bg-secondary transition-colors text-foreground"
>
Leave Server
</button>
<div class="border-t border-border"></div>
<button
type="button"
(click)="logout()"
class="w-full text-left px-3 py-2 text-sm hover:bg-secondary transition-colors text-foreground"
>
Logout
</button>
</div>
}
} @else { } @else {
<div class="flex items-center gap-2 min-w-0"> <div class="flex items-center gap-2 min-w-0">
<span class="text-sm text-muted-foreground truncate">{{ username() }} | {{ serverName() }}</span> <span class="text-sm text-muted-foreground truncate">{{ username() }} | {{ serverName() }}</span>
@@ -84,6 +41,40 @@
Login Login
</button> </button>
} }
<button
type="button"
(click)="toggleMenu()"
class="ml-2 p-2 hover:bg-secondary rounded"
title="Menu"
>
<ng-icon
name="lucideMenu"
class="w-5 h-5 text-muted-foreground"
/>
</button>
<!-- Anchored dropdown under the menu button -->
@if (showMenu()) {
<div class="absolute right-0 top-full mt-1 z-50 bg-card border border-border rounded-lg shadow-lg w-48">
@if (inRoom()) {
<button
type="button"
(click)="leaveServer()"
class="w-full text-left px-3 py-2 text-sm hover:bg-secondary transition-colors text-foreground"
>
Leave Server
</button>
}
<div class="border-t border-border"></div>
<button
type="button"
(click)="logout()"
class="w-full text-left px-3 py-2 text-sm hover:bg-secondary transition-colors text-foreground"
>
Logout
</button>
</div>
}
@if (isElectron()) { @if (isElectron()) {
<button <button
type="button" type="button"

View File

@@ -109,11 +109,6 @@ export class TitleBarComponent {
} }
} }
/** Leave the current room and navigate back to the server search. */
onBack() {
this.openLeaveConfirm();
}
/** Toggle the server dropdown menu. */ /** Toggle the server dropdown menu. */
toggleMenu() { toggleMenu() {
this._showMenu.set(!this._showMenu()); this._showMenu.set(!this._showMenu());