feat: dashboard
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
<nav class="relative flex h-full min-w-14 flex-col items-center gap-2 border-r border-border bg-secondary/35 px-0 py-3 md:min-w-0 md:w-full">
|
||||
<!-- Create button -->
|
||||
<!-- Home / dashboard button -->
|
||||
<button
|
||||
appThemeNode="serversRailCreateButton"
|
||||
type="button"
|
||||
class="flex h-11 w-11 items-center justify-center rounded-md bg-primary text-primary-foreground transition-colors hover:bg-primary/90 md:h-10 md:w-10"
|
||||
title="Create Server"
|
||||
(click)="createServer()"
|
||||
class="flex h-11 w-11 items-center justify-center overflow-hidden rounded-md bg-primary transition-colors hover:bg-primary/90 md:h-10 md:w-10"
|
||||
title="Dashboard"
|
||||
(click)="goToDashboard()"
|
||||
>
|
||||
<ng-icon
|
||||
name="lucidePlus"
|
||||
class="h-[22px] w-[22px] md:h-5 md:w-5"
|
||||
<img
|
||||
src="toju-icon.png"
|
||||
alt="Toju"
|
||||
class="h-full w-full object-contain p-1"
|
||||
/>
|
||||
</button>
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import { FormsModule } from '@angular/forms';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { NavigationEnd, Router } from '@angular/router';
|
||||
import { NgIcon, provideIcons } from '@ng-icons/core';
|
||||
import { lucidePhone, lucidePlus } from '@ng-icons/lucide';
|
||||
import { lucidePhone } from '@ng-icons/lucide';
|
||||
import {
|
||||
EMPTY,
|
||||
Subject,
|
||||
@@ -61,7 +61,7 @@ const ACTIVATION_DEBOUNCE_MS = 150;
|
||||
ThemeNodeDirective,
|
||||
UserBarComponent
|
||||
],
|
||||
viewProviders: [provideIcons({ lucidePhone, lucidePlus })],
|
||||
viewProviders: [provideIcons({ lucidePhone })],
|
||||
templateUrl: './servers-rail.component.html'
|
||||
})
|
||||
export class ServersRailComponent {
|
||||
@@ -107,6 +107,13 @@ export class ServersRailComponent {
|
||||
),
|
||||
{ initialValue: this.isDirectMessageUrl(this.router.url) }
|
||||
);
|
||||
isOnDashboard = toSignal(
|
||||
this.router.events.pipe(
|
||||
filter((navigationEvent): navigationEvent is NavigationEnd => navigationEvent instanceof NavigationEnd),
|
||||
map((navigationEvent) => navigationEvent.urlAfterRedirects.startsWith('/dashboard'))
|
||||
),
|
||||
{ initialValue: this.router.url.startsWith('/dashboard') }
|
||||
);
|
||||
isOnCall = toSignal(
|
||||
this.router.events.pipe(
|
||||
filter((navigationEvent): navigationEvent is NavigationEnd => navigationEvent instanceof NavigationEnd),
|
||||
@@ -238,7 +245,7 @@ export class ServersRailComponent {
|
||||
|
||||
trackRoomId = (index: number, room: Room) => room.id;
|
||||
|
||||
createServer(): void {
|
||||
goToDashboard(): void {
|
||||
const voiceServerId = this.voiceSession.getVoiceServerId();
|
||||
|
||||
this.optimisticSelectedRoomId.set(null);
|
||||
@@ -247,7 +254,7 @@ export class ServersRailComponent {
|
||||
this.voiceSession.setViewingVoiceServer(false);
|
||||
}
|
||||
|
||||
this.router.navigate(['/search']);
|
||||
this.router.navigate(['/dashboard']);
|
||||
}
|
||||
|
||||
joinSavedRoom(room: Room): void {
|
||||
@@ -407,7 +414,7 @@ export class ServersRailComponent {
|
||||
}
|
||||
|
||||
isSelectedRoom(room: Room): boolean {
|
||||
if (this.isOnDirectMessage() || this.isOnCall()) {
|
||||
if (this.isOnDirectMessage() || this.isOnCall() || this.isOnDashboard()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user