-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
e047045
commit b9d9b67
Showing
3 changed files
with
67 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 64 additions & 32 deletions
96
src/app/features/chat/page/chat-page/chat-page.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,71 @@ | ||
<div class="m-10"> | ||
<!-- eslint-disable @angular-eslint/template/cyclomatic-complexity --> | ||
<div | ||
*ngIf="chatStore.conversationsFetchState$ | async as fetchState" | ||
class="m-10" | ||
> | ||
<h1 class="page-header">Deine Chats</h1> | ||
|
||
<ng-container | ||
*ngIf=" | ||
(chatStore.hasNoConversations$ | async) === false; | ||
else noConversations | ||
" | ||
> | ||
<div class="flex h-[600px] border"> | ||
<app-chat-conversation-list | ||
class="flex-none overflow-y-auto" | ||
></app-chat-conversation-list> | ||
<div class="flex w-full flex-col bg-gray-100"> | ||
<app-chat-messages class="grow"></app-chat-messages> | ||
<app-chat-message-composer | ||
class="flex-none" | ||
></app-chat-message-composer> | ||
<ng-container *ngIf="fetchState === 'complete'"> | ||
<ng-container | ||
*ngIf=" | ||
(chatStore.hasNoConversations$ | async) === false; | ||
else noConversations | ||
" | ||
> | ||
<div class="flex h-[600px] border"> | ||
<app-chat-conversation-list | ||
class="flex-none overflow-y-auto" | ||
></app-chat-conversation-list> | ||
<div class="flex w-full flex-col bg-gray-100"> | ||
<app-chat-messages class="grow"></app-chat-messages> | ||
<app-chat-message-composer | ||
class="flex-none" | ||
></app-chat-message-composer> | ||
</div> | ||
</div> | ||
</ng-container> | ||
</ng-container> | ||
|
||
<ng-template #noConversations> | ||
<div class=""> | ||
<h1 class="font-bold">Du hast noch keine Chats</h1> | ||
<p class="text-gray-500"> | ||
Schau dir die Profile anderer Nutzer an und schreibe ihnen eine | ||
Nachricht. | ||
</p> | ||
<!-- Button zu der Empfehlungsseite --> | ||
<div class="my-4"> | ||
<a | ||
class="rounded bg-blue-500 py-2 px-4 font-bold text-white no-underline hover:bg-blue-700" | ||
routerLink="/recommendations" | ||
>Zurück zur Übersicht</a | ||
> | ||
</div> | ||
</div> | ||
</ng-template> | ||
|
||
<ng-container *ngIf="fetchState === 'error'"> | ||
<app-alert alertType="error" icon="error"> | ||
<p> | ||
Es ist ein Fehler aufgetreten. Bitte versuchen Sie es später erneut. | ||
</p> | ||
</app-alert> | ||
</ng-container> | ||
</div> | ||
|
||
<ng-template #noConversations> | ||
<div class=""> | ||
<h1 class="font-bold">Du hast noch keine Chats</h1> | ||
<p class="text-gray-500"> | ||
Schau dir die Profile anderer Nutzer an und schreibe ihnen eine Nachricht. | ||
</p> | ||
<!-- Button zu der Empfehlungsseite --> | ||
<div class="my-4"> | ||
<a | ||
class="rounded bg-blue-500 py-2 px-4 font-bold text-white no-underline hover:bg-blue-700" | ||
routerLink="/recommendations" | ||
>Zurück zur Übersicht</a | ||
> | ||
<ng-container *ngIf="fetchState === 'loading'"> | ||
<div class="flex rounded border bg-gray-100"> | ||
<div class="w-[300px] flex-col"> | ||
<div *ngFor="let _ of [].constructor(4)" class="flex items-center"> | ||
<div | ||
class="m-4 h-16 w-16 animate-pulse rounded-full bg-gray-400" | ||
></div> | ||
<div class="flex flex-grow flex-col gap-2 px-4 py-2"> | ||
<div class="h-6 w-full animate-pulse rounded bg-gray-400"></div> | ||
<div class="h-4 w-3/4 animate-pulse rounded bg-gray-300"></div> | ||
</div> | ||
</div> | ||
<div></div> | ||
</div> | ||
</div> | ||
</div> | ||
</ng-template> | ||
</ng-container> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters