feat: Add deafen to pc, fix mobiel view, fix freeze on startup
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<ng-template #pageContent>
|
||||
<div class="h-full min-h-0 overflow-y-auto bg-background text-foreground">
|
||||
<div class="mx-auto w-full max-w-5xl space-y-8 p-4 sm:p-6 lg:py-8">
|
||||
<header class="space-y-1">
|
||||
<div class="h-full min-h-0 min-w-0 w-full overflow-x-hidden overflow-y-auto bg-background text-foreground">
|
||||
<div class="mx-auto w-full min-w-0 max-w-5xl space-y-8 p-4 sm:p-6 lg:py-8">
|
||||
<header class="min-w-0 space-y-1">
|
||||
<h1 class="text-2xl font-semibold text-foreground">
|
||||
@if (currentUser()) {
|
||||
Welcome back, {{ currentUser()!.displayName || 'there' }}
|
||||
@@ -12,8 +12,8 @@
|
||||
<p class="text-sm text-muted-foreground">Find people, discover servers, or start your own community.</p>
|
||||
</header>
|
||||
|
||||
<div>
|
||||
<div class="relative">
|
||||
<div class="min-w-0">
|
||||
<div class="relative min-w-0">
|
||||
<ng-icon
|
||||
name="lucideSearch"
|
||||
class="absolute left-3 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground"
|
||||
@@ -22,8 +22,8 @@
|
||||
#searchInput
|
||||
type="text"
|
||||
aria-label="Search people, servers, and invites"
|
||||
class="h-12 w-full rounded-xl border border-border bg-secondary py-2 pl-11 pr-20 text-base text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary"
|
||||
placeholder="Search for people, servers, or paste an invite..."
|
||||
class="h-12 w-full min-w-0 rounded-xl border border-border bg-secondary py-2 pl-11 pr-4 text-base text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary sm:pr-20"
|
||||
[placeholder]="isMobile() ? 'Search people, servers, invites...' : 'Search for people, servers, or paste an invite...'"
|
||||
[ngModel]="searchQuery()"
|
||||
(ngModelChange)="onSearchChange($event)"
|
||||
(keydown.enter)="submitSearch()"
|
||||
@@ -189,10 +189,10 @@
|
||||
</section>
|
||||
} @else {
|
||||
<!-- Primary actions -->
|
||||
<section class="grid gap-3 sm:grid-cols-3">
|
||||
<section class="grid min-w-0 gap-3 sm:grid-cols-3">
|
||||
<a
|
||||
routerLink="/people"
|
||||
class="group flex items-center gap-3 rounded-xl border border-border bg-card p-4 transition-colors hover:border-primary/40 hover:bg-card/80"
|
||||
class="group flex min-w-0 w-full items-center gap-3 rounded-xl border border-border bg-card p-4 transition-colors hover:border-primary/40 hover:bg-card/80"
|
||||
>
|
||||
<div class="grid h-11 w-11 shrink-0 place-items-center rounded-lg bg-purple-500/15 text-purple-400">
|
||||
<ng-icon
|
||||
@@ -212,7 +212,7 @@
|
||||
|
||||
<a
|
||||
routerLink="/servers"
|
||||
class="group flex items-center gap-3 rounded-xl border border-border bg-card p-4 transition-colors hover:border-primary/40 hover:bg-card/80"
|
||||
class="group flex min-w-0 w-full items-center gap-3 rounded-xl border border-border bg-card p-4 transition-colors hover:border-primary/40 hover:bg-card/80"
|
||||
>
|
||||
<div class="grid h-11 w-11 shrink-0 place-items-center rounded-lg bg-blue-500/15 text-blue-400">
|
||||
<ng-icon
|
||||
@@ -232,7 +232,7 @@
|
||||
|
||||
<a
|
||||
routerLink="/create-server"
|
||||
class="group flex items-center gap-3 rounded-xl border border-emerald-500/40 bg-emerald-500/10 p-4 transition-colors hover:bg-emerald-500/15"
|
||||
class="group flex min-w-0 w-full items-center gap-3 rounded-xl border border-emerald-500/40 bg-emerald-500/10 p-4 transition-colors hover:bg-emerald-500/15"
|
||||
>
|
||||
<div class="grid h-11 w-11 shrink-0 place-items-center rounded-lg bg-emerald-500/20 text-emerald-400">
|
||||
<ng-icon
|
||||
@@ -267,8 +267,8 @@
|
||||
}
|
||||
|
||||
<!-- People + Popular servers -->
|
||||
<section class="grid gap-4 lg:grid-cols-2">
|
||||
<div class="rounded-xl border border-border bg-card/40 p-4">
|
||||
<section class="grid min-w-0 gap-4 lg:grid-cols-2">
|
||||
<div class="min-w-0 rounded-xl border border-border bg-card/40 p-4">
|
||||
<div class="mb-3 flex items-center justify-between">
|
||||
<h2 class="text-sm font-semibold text-foreground">People you might know</h2>
|
||||
<a
|
||||
@@ -280,7 +280,7 @@
|
||||
@if (peopleYouMightKnow().length > 0) {
|
||||
<div class="space-y-1">
|
||||
@for (person of peopleYouMightKnow(); track person.id) {
|
||||
<div class="flex items-center gap-3 rounded-lg px-2 py-2 transition-colors hover:bg-secondary/60">
|
||||
<div class="flex min-w-0 items-center gap-3 rounded-lg px-2 py-2 transition-colors hover:bg-secondary/60">
|
||||
<app-user-avatar
|
||||
[name]="personLabel(person)"
|
||||
[avatarUrl]="person.avatarUrl"
|
||||
@@ -292,7 +292,10 @@
|
||||
<p class="truncate text-sm font-medium text-foreground">{{ personLabel(person) }}</p>
|
||||
<p class="text-xs text-muted-foreground">{{ isOnline(person) ? 'Online' : 'Offline' }}</p>
|
||||
</div>
|
||||
<app-friend-button [user]="person" />
|
||||
<app-friend-button
|
||||
class="shrink-0"
|
||||
[user]="person"
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@@ -301,7 +304,7 @@
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="rounded-xl border border-border bg-card/40 p-4">
|
||||
<div class="min-w-0 rounded-xl border border-border bg-card/40 p-4">
|
||||
<div class="mb-3 flex items-center justify-between">
|
||||
<h2 class="text-sm font-semibold text-foreground">Popular Servers</h2>
|
||||
<a
|
||||
@@ -313,7 +316,7 @@
|
||||
@if (popularServers().length > 0) {
|
||||
<div class="space-y-1">
|
||||
@for (server of popularServers(); track server.id) {
|
||||
<div class="flex items-center gap-3 rounded-lg px-2 py-2 transition-colors hover:bg-secondary/60">
|
||||
<div class="flex min-w-0 items-center gap-3 rounded-lg px-2 py-2 transition-colors hover:bg-secondary/60">
|
||||
<div
|
||||
class="grid h-10 w-10 shrink-0 place-items-center overflow-hidden rounded-lg bg-secondary text-sm font-semibold text-foreground"
|
||||
>
|
||||
@@ -358,9 +361,9 @@
|
||||
>Manage</a
|
||||
>
|
||||
</div>
|
||||
<div class="grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<div class="grid min-w-0 grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3">
|
||||
@for (friend of friends(); track friend.id) {
|
||||
<div class="flex items-center gap-3 rounded-xl border border-border bg-card p-3">
|
||||
<div class="flex min-w-0 items-center gap-3 rounded-xl border border-border bg-card p-3">
|
||||
<app-user-avatar
|
||||
[name]="personLabel(friend)"
|
||||
[avatarUrl]="friend.avatarUrl"
|
||||
@@ -383,11 +386,11 @@
|
||||
@if (recentlyActiveServers().length > 0) {
|
||||
<section>
|
||||
<h2 class="mb-3 text-sm font-semibold text-foreground">Recently Active Servers</h2>
|
||||
<div class="grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-5">
|
||||
<div class="grid min-w-0 grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-5">
|
||||
@for (room of recentlyActiveServers(); track room.id) {
|
||||
<button
|
||||
type="button"
|
||||
class="flex flex-col items-center gap-2 rounded-xl border border-border bg-card p-4 text-center transition-colors hover:border-primary/50 hover:bg-card/80"
|
||||
class="flex min-w-0 flex-col items-center gap-2 rounded-xl border border-border bg-card p-4 text-center transition-colors hover:border-primary/50 hover:bg-card/80"
|
||||
(click)="openSavedRoom(room)"
|
||||
>
|
||||
<div
|
||||
@@ -415,24 +418,4 @@
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
@if (isMobile()) {
|
||||
<swiper-container
|
||||
class="block h-full min-h-0 w-full bg-background"
|
||||
slides-per-view="1"
|
||||
space-between="0"
|
||||
initial-slide="0"
|
||||
threshold="10"
|
||||
resistance-ratio="0"
|
||||
>
|
||||
<swiper-slide class="block h-full w-full">
|
||||
<div class="flex h-full w-full min-h-0 overflow-hidden">
|
||||
<app-servers-rail class="block h-full shrink-0" />
|
||||
<div class="flex min-h-0 flex-1 overflow-hidden border-l border-border">
|
||||
<ng-container [ngTemplateOutlet]="pageContent" />
|
||||
</div>
|
||||
</div>
|
||||
</swiper-slide>
|
||||
</swiper-container>
|
||||
} @else {
|
||||
<ng-container [ngTemplateOutlet]="pageContent" />
|
||||
}
|
||||
<ng-container [ngTemplateOutlet]="pageContent" />
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/* eslint-disable @typescript-eslint/member-ordering */
|
||||
import {
|
||||
CUSTOM_ELEMENTS_SCHEMA,
|
||||
Component,
|
||||
ElementRef,
|
||||
HostListener,
|
||||
@@ -41,7 +40,6 @@ import { selectAllUsers, selectCurrentUser } from '../../store/users/users.selec
|
||||
import type { Room, User } from '../../shared-kernel';
|
||||
import type { ServerInfo } from '../../domains/server-directory/domain/models/server-directory.model';
|
||||
import { ServerDirectoryFacade } from '../../domains/server-directory/application/facades/server-directory.facade';
|
||||
import { ServersRailComponent } from '../servers/servers-rail/servers-rail.component';
|
||||
import { ViewportService } from '../../core/platform';
|
||||
import { FriendService } from '../../domains/direct-message/application/services/friend.service';
|
||||
import { FriendButtonComponent } from '../../domains/direct-message/feature/friend-button/friend-button.component';
|
||||
@@ -72,8 +70,7 @@ const RECENT_SEARCHES_STORAGE_KEY = 'metoyou_dashboard_recent_searches';
|
||||
RouterLink,
|
||||
NgIcon,
|
||||
FriendButtonComponent,
|
||||
UserAvatarComponent,
|
||||
ServersRailComponent
|
||||
UserAvatarComponent
|
||||
],
|
||||
viewProviders: [
|
||||
provideIcons({
|
||||
@@ -87,8 +84,10 @@ const RECENT_SEARCHES_STORAGE_KEY = 'metoyou_dashboard_recent_searches';
|
||||
lucideX
|
||||
})
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
templateUrl: './dashboard.component.html'
|
||||
templateUrl: './dashboard.component.html',
|
||||
host: {
|
||||
class: 'block h-full min-h-0 min-w-0 w-full overflow-hidden'
|
||||
}
|
||||
})
|
||||
export class DashboardComponent implements OnInit {
|
||||
private store = inject(Store);
|
||||
|
||||
Reference in New Issue
Block a user