Skip to content

Commit 6b9a2ee

Browse files
committed
example: empty message placeholder
1 parent 81b88de commit 6b9a2ee

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

projects/customizations-example/src/app/app.component.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,3 +282,11 @@
282282
<ng-template #dateSeparator let-date="date" let-parsedDate="parsedDate">
283283
{{ date }} - {{ parsedDate }}
284284
</ng-template>
285+
286+
<ng-template #emptyMainMessageList>
287+
<div class="empty-list"><div>No messages yet</div></div>
288+
</ng-template>
289+
290+
<ng-template #emptyThreadMessageList>
291+
<div class="empty-list"><div>No thread replies yet</div></div>
292+
</ng-template>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.empty-list {
2+
display: flex;
3+
width: 100%;
4+
height: 100%;
5+
align-items: center;
6+
justify-content: center;
7+
}

projects/customizations-example/src/app/app.component.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ export class AppComponent implements AfterViewInit {
9191
private customAttachmentUploadTemplate!: TemplateRef<CustomAttachmentUploadContext>;
9292
@ViewChild('dateSeparator')
9393
private dateSeparatorTemplate!: TemplateRef<DateSeparatorContext>;
94+
@ViewChild('emptyMainMessageList')
95+
private emptyMainMessageListTemplate!: TemplateRef<void>;
96+
@ViewChild('emptyThreadMessageList')
97+
private emptyThreadMessageListTemplate!: TemplateRef<void>;
9498

9599
constructor(
96100
private chatService: ChatClientService,
@@ -170,6 +174,12 @@ export class AppComponent implements AfterViewInit {
170174
this.customTemplatesService.dateSeparatorTemplate$.next(
171175
this.dateSeparatorTemplate
172176
);
177+
this.customTemplatesService.emptyMainMessageListPlaceholder$.next(
178+
this.emptyMainMessageListTemplate
179+
);
180+
this.customTemplatesService.emptyThreadMessageListPlaceholder$.next(
181+
this.emptyThreadMessageListTemplate
182+
);
173183
}
174184

175185
inviteClicked(channel: Channel) {

projects/customizations-example/src/styles.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,8 @@ body {
2727
.material-icons {
2828
font-family: "Material Icons" !important;
2929
}
30+
31+
.str-chat__thread
32+
.str-chat__main-panel-inner.str-chat-angular__message-list-host--empty {
33+
height: 100%;
34+
}

0 commit comments

Comments
 (0)