Skip to content

Commit 52a9635

Browse files
committed
fix(files-tree): updated empty state
1 parent 84f172a commit 52a9635

4 files changed

Lines changed: 19 additions & 33 deletions

File tree

src/app/shared/components/files-drop-zone/files-drop-zone.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
@if (isDragOver()) {
1111
<div class="flex flex-column gap-2 align-items-center pointer-events-none">
1212
<i class="fa-solid fa-cloud-arrow-up text-5xl"></i>
13-
<p class="drop-text text-xl">{{ 'files.dropText' | translate }}</p>
13+
<p class="text-xl">{{ 'files.dropText' | translate }}</p>
1414
</div>
1515
}
1616
</div>

src/app/shared/components/files-tree-row/files-tree-row.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ export class FilesTreeRowComponent {
2626
showMenu = input<boolean>(false);
2727
allowedMenuActions = input.required<FileMenuFlags>();
2828

29+
openParentFolder = output<void>();
30+
openEntry = output<FileModel>();
31+
menuAction = output<FileMenuAction>();
32+
2933
readonly isFolder = computed(() => this.file().kind === FileKind.Folder);
3034

3135
readonly downloadsCount = computed(() => {
@@ -35,10 +39,6 @@ export class FilesTreeRowComponent {
3539
return this.file().extra.downloads;
3640
});
3741

38-
openParentFolder = output<void>();
39-
openEntry = output<FileModel>();
40-
menuAction = output<FileMenuAction>();
41-
4242
onOpenEntry(): void {
4343
this.openEntry.emit(this.file());
4444
}

src/app/shared/components/files-tree/files-tree.component.html

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,20 @@
3333
(menuAction)="onFileMenuAction($event, file.data)"
3434
></osf-files-tree-row>
3535
</ng-template>
36-
</p-tree>
3736

38-
@if (!files().length) {
39-
<div class="empty-state-container p-4">
40-
@if (!canUpload()) {
41-
<h3 class="font-normal mb-4 text-no-transform">{{ 'files.emptyState' | translate }}</h3>
42-
} @else {
43-
<div class="drop-text">
44-
<i class="fa-solid fa-cloud-arrow-up text-5xl"></i>
45-
<p class="text-xl">{{ 'files.dropText' | translate }}</p>
46-
</div>
47-
}
48-
</div>
49-
}
37+
<ng-template pTemplate="empty">
38+
<div class="flex align-items-center justify-content-center h-full p-4">
39+
@if (!canUpload()) {
40+
<h3 class="font-normal mb-4 text-no-transform">{{ 'files.emptyState' | translate }}</h3>
41+
} @else {
42+
<div class="flex flex-column align-items-center justify-content-center">
43+
<i class="fa-solid fa-cloud-arrow-up text-5xl"></i>
44+
<p class="text-xl">{{ 'files.dropText' | translate }}</p>
45+
</div>
46+
}
47+
</div>
48+
</ng-template>
49+
</p-tree>
5050
</div>
5151
}
5252
</osf-files-drop-zone>

src/styles/overrides/tree.scss

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
}
5555

5656
.p-tree-empty-message {
57-
display: none;
57+
height: 100%;
5858
}
5959

6060
.p-tree-node-selected {
@@ -72,18 +72,4 @@
7272
}
7373
}
7474
}
75-
76-
.empty-state-container {
77-
position: absolute;
78-
inset: 0;
79-
top: 2.75rem;
80-
display: flex;
81-
justify-content: center;
82-
align-items: center;
83-
84-
.drop-text {
85-
text-align: center;
86-
margin-bottom: 2.75rem;
87-
}
88-
}
8975
}

0 commit comments

Comments
 (0)